/* ===================================
   Cart Page Styles
   =================================== */

.cart-page {
    padding: 60px 0 100px;
    background-color: #FFFFFF;
}

.cart-content {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.cart-items-column {
    flex: 1;
}

.summary-column {
    width: 400px;
    flex-shrink: 0;
}

/* Items Grid */
.cart-items-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cart-item-card {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    display: flex;
    overflow: hidden;
    position: relative;
    padding: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cart-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border-color: rgba(196, 164, 124, 0.3);
}

.item-product-image {
    width: 160px;
    height: 160px;
    background: #F8F8F8;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.item-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0px;
}

.item-details {
    padding-left: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevents flex children from overflowing */
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    margin-bottom: 12px;
    padding-right: 34px;
    /* Ensure space for the top-right remove button */
}

.item-name {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: #1A1A1A;
    letter-spacing: -0.4px;
    line-height: 1.1;
}

.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-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.item-category-tag {
    background: rgba(196, 164, 124, 0.15);
    color: #8B6E4A;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(196, 164, 124, 0.2);
}

.item-attribute-tag {
    background: rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(4px);
    color: #555;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.cart-item-card:hover .item-attribute-tag {
    background: rgba(0, 0, 0, 0.07);
    color: #1A1A1A;
}

.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-heading);
    font-size: 24px;
    font-weight: 700;
    color: #1A1A1A;
    white-space: nowrap;
    text-align: right;
}

.remove-item-top {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.03);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
}

.remove-item-top:hover {
    background: #FFEBEB;
    color: #FF5252;
}

/* Quantity Stepper & Bottom Actions */
.qty-stepper {
    display: flex;
    align-items: center;
    background: #F2F2F2;
    border-radius: 8px;
    height: 36px;
    padding: 2px;
}

.stepper-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    font-size: 18px;
    font-weight: 500;
    color: #1A1A1A;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.stepper-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.stepper-input {
    width: 30px;
    border: none;
    background: transparent;
    text-align: center;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: #1A1A1A;
}

.remove-action {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.remove-action:hover {
    background: #FFF5F5;
    color: #FF5252;
}

.remove-action svg {
    stroke-width: 1.5;
}

/* Order Summary */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0 40px;
    font-size: 14px;
    color: #888;
}

.breadcrumbs a {
    color: #888;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: var(--color-gold);
}

.breadcrumbs span {
    color: #1A1A1A;
    font-weight: 500;
}

.breadcrumbs a,
.breadcrumbs .current,
.breadcrumbs .separator {
    color: #141414;
    text-decoration: none;
    font-size: 13px;
}

.summary-card {
    background: #F9F9F8;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.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 {
    position: relative;
    margin-bottom: 20px;
    background: rgba(196, 164, 124, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px dashed rgba(196, 164, 124, 0.3);
}

.remove-coupon-btn {
    position: absolute;
    right: -10px;
    top: -10px;
    background: #FF5252;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.coupon-section {
    margin: 25px 0;
}

.coupon-input-group {
    display: flex;
    gap: 10px;
}

.coupon-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.coupon-input:focus {
    border-color: #C4A47C;
}

.btn-apply {
    background: #1A1A1A;
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-apply:hover {
    background: #333;
}

.coupon-applied-msg {
    font-size: 13px;
    color: #27AE60;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(39, 174, 96, 0.05);
    padding: 10px;
    border-radius: 8px;
}

.success-dot {
    width: 8px;
    height: 8px;
    background: #27AE60;
    border-radius: 50%;
}

.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;
}

@media (max-width: 1400px) {
    .container {
        max-width: 1200px;
    }
}

@media (max-width: 1024px) {
    .cart-content {
        flex-direction: column;
        gap: 40px;
    }

    .summary-column {
        width: 100%;
    }
}

@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;
    }

    .remove-item-top {
        display: flex;
        top: 12px;
        right: 12px;
        background: rgba(0, 0, 0, 0.5);
        color: #fff;
    }

    /* 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-tag,
    .item-attribute-tag {
        font-size: 11px;
        color: #333;
        margin-bottom: 0;
        font-weight: 500;
        line-height: 1.5;
    }

    .item-attributes {
        margin-bottom: 15px;
        gap: 6px;
    }

    .item-bottom {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 15px;
    }

    .remove-action span {
        display: none;
        /* Hide 'Remove' text on mobile, just icon */
    }

    .remove-action {
        padding: 8px;
    }

    /* 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;
    }
}