/* Page Specific Layouts (Moved from internal styles) */

/* Cart Page */
.cart-container {
    padding: var(--spacing-lg) 0;
    margin-top: 120px;
    min-height: 60vh;
}

.cart-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.cart-table td {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.cart-product {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.qty-control {
    display: flex;
    align-items: center;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--color-border);
    background: white;
    cursor: pointer;
}

.qty-val {
    width: 40px;
    text-align: center;
    font-size: 0.9rem;
}

.remove-btn {
    color: #d9534f;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
}

.cart-summary {
    margin-top: 2rem;
    background: #f9f9f9;
    padding: 2rem;
    max-width: 400px;
    margin-left: auto;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.total-row {
    font-weight: 700;
    font-size: 1.25rem;
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
}

/* Checkout Page */
.checkout-container {
    padding: var(--spacing-lg) 0;
    margin-top: 120px;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
}

.checkout-form {
    background: #fff;
    padding: 18px;
}

.order-summary {
    background: #f9f9f9;
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 140px;
    border: 1px solid #eee;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-top: 1rem;
    border-top: 2px solid var(--color-border);
    padding-top: 1rem;
}

/* Product Detail Page */
.product-detail-container {
    padding: var(--spacing-lg) 0;
    margin-top: 120px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.gallery-wrapper {
    background-color: #f9f9f9;
    padding: 2rem;
    border-radius: 4px;
}

.main-image {
    width: 100%;
    height: auto;
    display: block;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.main-image:hover {
    transform: scale(1.02);
    cursor: zoom-in;
}

.detail-info h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.detail-price {
    font-size: 1.5rem;
    color: var(--color-primary-dark);
    margin-bottom: 2rem;
    font-weight: 500;
}

.detail-desc {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.specs-table {
    width: 100%;
    margin-bottom: 2rem;
    border-collapse: collapse;
}

.specs-table td {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--color-border);
}

.specs-table td:first-child {
    font-weight: 600;
    width: 120px;
}

.atc-wrapper {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.qty-input {
    width: 80px;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--color-border);
    font-size: 1rem;
}

.atc-btn {
    flex: 1;
    background-color: var(--color-text-main);
    color: white;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.atc-btn:hover {
    background-color: var(--color-primary);
}

/* Mobile Adjustments for Internal Pages */
@media (max-width: 900px) {
    .checkout-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .order-summary {
        order: 0;
        margin-top: 2rem;
        position: static;
        /* remove sticky on mobile if needed, or keep it */
    }
}

@media (max-width: 768px) {

    .cart-table,
    .cart-table tbody,
    .cart-table tr,
    .cart-table td {
        display: block;
        width: 100%;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tr {
        margin-bottom: 1.5rem;
        border: 1px solid var(--color-border);
        padding: 1rem;
        border-radius: 4px;
        background: white;
    }

    .cart-table td {
        padding: 0.5rem 0;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dotted #eee;
    }

    .cart-table td:last-child {
        border-bottom: none;
    }

    /* Add labels for mobile */
    .cart-table td:nth-child(2)::before {
        content: "Price";
        font-weight: 500;
        color: #666;
    }

    .cart-table td:nth-child(3)::before {
        content: "Quantity";
        font-weight: 500;
        color: #666;
    }

    .cart-table td:nth-child(4)::before {
        content: "Total";
        font-weight: 500;
        color: #666;
    }

    .cart-product {
        flex-direction: row;
        align-items: center;
    }

    .cart-img {
        width: 60px;
        height: 60px;
    }

    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}