/* ===================================
   Cart Page Styles
   =================================== */

.cart-page {
    padding: 60px 0 100px;
    background-color: #FFFFFF;
}

.cart-content {
    display: flex;
    gap: 40px;
}

.cart-items-column {
    flex: 1;
}

.summary-column {
    width: 350px;
}

/* Items Grid */
.cart-items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.cart-item-card {
    background: #F5F5F5;
    border: none;
    border-radius: 12px;
    display: flex;
    overflow: hidden;
    position: relative;
    padding: 15px;
}

.item-product-image {
    width: 180px;
    height: 180px;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.item-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0px;
}

.item-details {
    padding-left: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.item-name {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 600;
    color: #1A1A1A;
}

.item-badge {
    background: #E8E8E8;
    color: #8D8D8D;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.item-category {
    font-size: 13px;
    color: #757575;
    margin-bottom: 2px;
}

.item-attribute {
    font-size: 13px;
    color: #757575;
    margin-bottom: 2px;
}

.item-bottom {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quantity-selector {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.qty-select {
    padding: 6px 30px 6px 15px;
    background: #EAEAEA;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #1A1A1A;
    appearance: none;
    cursor: pointer;
}

.select-arrow {
    position: absolute;
    right: 10px;
    pointer-events: none;
    color: #1A1A1A;
}

.item-price-val {
    font-family: var(--font-body);
    font-size: 24px;
    font-weight: 600;
    color: #1A1A1A;
}

.remove-item {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #D1D1D1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-item-card:hover .remove-item {
    opacity: 1;
}

.remove-item:hover {
    color: #FF5252;
}

/* Order Summary */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    font-size: 13px;
    font-weight: 500;
}

.breadcrumbs a,
.breadcrumbs .current,
.breadcrumbs .separator {
    color: #141414;
    text-decoration: none;
    font-size: 13px;
}

.summary-card {
    background: #F8F8F7;
    border-radius: 12px;
    padding: 30px;
}

.summary-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 400;
    color: #555555;
    text-align: center;
    margin-bottom: 30px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #333333;
}

.summary-row .val {
    font-weight: 600;
}

.discount-row {
    margin-bottom: 20px;
}

.summary-divider {
    height: 1px;
    background: #E0E0E0;
    margin-bottom: 20px;
}

.total-row {
    font-size: 16px;
    margin-bottom: 30px;
}

.total-row span {
    font-weight: 400;
}

.total-row .val {
    font-size: 18px;
    font-weight: 600;
}

.btn-payment {
    width: 100%;
    background: #C4A47C;
    color: #000000;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.3s ease;
}

.btn-payment:hover {
    background: #b3936a;
}

.payment-note {
    font-size: 9px;
    color: #B0B0B0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile Specific Elements hidden on Desktop */
.remove-item-mobile,
.mobile-checkout-bar,
.summary-overlay,
.close-summary-mobile {
    display: none;
}

.remove-item-desktop {
    display: block;
}

/* Responsive */
@media (max-width: 1200px) {
    .cart-items-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .cart-content {
        flex-direction: column;
        gap: 0;
    }

    .summary-column {
        width: 100%;
        margin-top: 40px;
    }
}

@media (max-width: 768px) {
    .cart-page {
        padding: 20px 0 100px;
        background: #FFFFFF;
    }

    .breadcrumbs {
        display: none;
    }

    /* Mobile Cart Item Card */
    .cart-item-card {
        flex-direction: column;
        background: #FFFFFF;
        /* White background as per image */
        padding: 0;
        margin-bottom: 30px;
        border-radius: 0;
        position: relative;
    }

    /* Image Section */
    .item-product-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1.4/1;
        border-radius: 12px;
        margin-bottom: 20px;
        position: relative;
    }

    .item-product-image img {
        border-radius: 12px;
    }

    /* Mobile Close Button (Top Right of Image) */
    .remove-item-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 15px;
        right: 15px;
        width: 28px;
        height: 28px;
        background: rgba(0, 0, 0, 0.6);
        border-radius: 50%;
        color: #fff;
        border: none;
        z-index: 10;
        cursor: pointer;
    }

    .remove-item-mobile svg {
        width: 16px;
        height: 16px;
    }

    .remove-item-desktop {
        display: none;
    }

    /* Item Details */
    .item-details {
        padding: 0 5px;
    }

    .item-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 8px;
    }

    .item-name {
        font-family: var(--font-heading);
        font-size: 24px;
        font-weight: 700;
        color: #1A1A1A;
        width: 70%;
        line-height: 1.2;
    }

    .item-badge {
        display: none;
        /* Hide badge on mobile if not in design */
    }

    .item-price-val {
        font-family: var(--font-heading);
        font-size: 24px;
        font-weight: 700;
        color: #1A1A1A;
    }

    .item-attributes {
        margin-bottom: 20px;
    }

    .item-category,
    .item-attribute {
        font-size: 14px;
        color: #333;
        margin-bottom: 5px;
        font-weight: 400;
        line-height: 1.5;
    }

    /* Move Quantity to right side aligned with attributes */
    .item-bottom {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        margin-top: -60px;
        /* Pull up to align with text */
    }

    .quantity-selector {
        background: #E0E0E0;
        border-radius: 6px;
        padding: 0;
        height: 40px;
        display: flex;
        align-items: center;
    }

    .qty-select {
        background: transparent;
        padding: 0 30px 0 15px;
        height: 100%;
        font-size: 16px;
        font-weight: 600;
    }

    .select-arrow {
        right: 12px;
    }

    /* Mobile Checkout Button */
    .mobile-checkout-bar {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #FFFFFF;
        padding: 15px 20px;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
        z-index: 990;
        margin: 0;
    }

    .btn-mobile-checkout {
        width: 100%;
        background: #C4A47C;
        color: #FFFFFF;
        font-size: 16px;
        font-weight: 500;
        padding: 16px;
        border: none;
        border-radius: 8px;
        cursor: pointer;
    }

    /* Empty Cart Mobile Styles */
    .empty-cart-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
        min-height: 50vh;
        text-align: center;
    }

    .empty-cart-container .promo-banner-card {
        margin: 20px auto 40px;
        /* Moved down slightly */
        width: 100%;
        max-width: 340px;
    }

    .empty-text {
        font-family: var(--font-body, "Inter", sans-serif);
        font-size: 18px;
        color: #666;
        font-weight: 500;
    }

    /* Order Summary Modal - Behavior like Navigation Sidebar */
    .summary-column {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        z-index: 1000;
        background: #FFFFFF;
        padding: 10px 25px;
        margin: 0;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .summary-column.active {
        display: flex;
        right: 0;
    }

    .summary-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .summary-overlay.active {
        display: block;
    }

    /* Can't nest overlay inside transformed element usually, but let's see structure */
    /* JS toggles active on summary-column, but overlay is sibling in php?
       Check PHP structure: overlay is INSIDE summary-column.
       Fixed position inside transformed element behaves relative to element not viewport.
       Fix: Move overlay outside in PHP or use JS to handle overlay separately.
       But wait, if overlay is inside summary-column, and summary-column is transformed...
       Let's rely on the JS adding active to overlay separately if needed?
       My JS adds active to ONLY summaryColumn.
       Correction: Modal pattern usually requires overlay outside.
       Let's style overlay assuming it works or I will simple use a full cover background on the summary column itself.
       Actually, let's keep it simple: simpler popup.
    */

    .summary-card {
        background: transparent;
        padding: 10px 0;
        height: auto;
    }

    .summary-title {
        text-align: left;
        font-size: 20px;
        margin-bottom: 20px;
        padding-left: 5px;
    }

    .close-summary-mobile {
        display: none;
    }
}

/* Desktop Styles for Empty Cart */
@media (min-width: 769px) {
    .empty-cart-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 80px 0;
        min-height: 500px;
    }

    .empty-cart-container .promo-banner-card {
        background-color: #FFDFE1;
        border-radius: 15px;
        padding: 40px 30px;
        text-align: center;
        position: relative;
        width: 100%;
        max-width: 400px;
        margin: 0 auto 40px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    }

    .promo-banner-card .promo-discount-text {
        font-family: var(--font-heading, "Fraunces", serif);
        font-size: 24px;
        font-weight: 600;
        color: #000;
        margin-bottom: 8px;
        letter-spacing: 0.5px;
    }

    .promo-banner-card .promo-sub-text {
        font-family: var(--font-body, "Inter", sans-serif);
        font-size: 15px;
        color: #333;
        margin-bottom: 20px;
    }

    .promo-links {
        font-family: var(--font-body, "Inter", sans-serif);
        font-size: 16px;
        color: #666;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
    }

    .promo-links a {
        color: #333;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.3s;
    }

    .promo-links a:hover {
        color: #C4A47C;
    }

    .promo-banner-card::before,
    .promo-banner-card::after {
        content: '';
        position: absolute;
        width: 36px;
        height: 36px;
        background-color: #FFFFFF;
        border-radius: 50%;
        top: 50%;
        transform: translateY(-50%);
    }

    .promo-banner-card::before {
        left: -18px;
    }

    .promo-banner-card::after {
        right: -18px;
    }

    .empty-text {
        font-size: 28px;
        color: #333;
        font-family: var(--font-heading, "Fraunces", serif);
        font-weight: 500;
    }
}