@charset "UTF-8";

/* ==========================================================================
   Modern Cart Design - Common (Desktop & Mobile)
   ========================================================================== */

/* Shared Table Wrapper */
.woocommerce-cart .woocommerce,
.woocommerce-checkout .woocommerce {
    max-width: 1200px;
    margin: 0 auto;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* 
   Shared Table Styles (.is-modern-cart-layout)
   Applied to both Cart and Checkout Review tables
*/
table.is-modern-cart-layout {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    background: #fff;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 3rem;
    width: 100%;
}

table.is-modern-cart-layout th {
    background-color: #f7f7f7;
    color: #333;
    font-weight: 600;
    padding: 1.2rem;
    border-bottom: 2px solid #eee;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.05em;
}

table.is-modern-cart-layout td {
    padding: 1.5rem 1.2rem;
    border-top: 1px solid #f0f0f0;
    vertical-align: middle;
}

/* Product Thumbnail */
table.is-modern-cart-layout td.product-thumbnail img {
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    width: 80px;
    height: auto;
    display: block;
}

/* Product Name */
table.is-modern-cart-layout td.product-name a {
    color: #333;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.05em;
    transition: color 0.2s;
}

table.is-modern-cart-layout td.product-name a:hover {
    color: #0073aa;
}

/* Remove "X" link (Cart Only) */
table.is-modern-cart-layout td.product-remove a.remove {
    color: #ccc !important;
    background: transparent !important;
    font-size: 1.5rem;
    font-weight: normal;
    transition: color 0.2s;
}

table.is-modern-cart-layout td.product-remove a.remove:hover {
    color: #e74c3c !important;
    background: transparent !important;
}

/* Cart Totals (Cart Page Only - Hidden on Mobile if Sticky) */
.cart-collaterals .cart_totals {
    background: #f9f9f9;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #eee;
}

.cart-collaterals .cart_totals h2 {
    font-size: 1.4rem;
    border-bottom: 2px solid #ddd;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}


/* ==========================================================================
   Mobile Optimization (Stack View)
   ========================================================================== */
@media screen and (max-width: 768px) {

    /* --- Stack View for Shared Table --- */
    table.is-modern-cart-layout,
    table.is-modern-cart-layout thead,
    table.is-modern-cart-layout tbody,
    table.is-modern-cart-layout th,
    table.is-modern-cart-layout tr {
        display: block;
    }

    table.is-modern-cart-layout {
        background: transparent;
        box-shadow: none;
        border: none;
    }

    table.is-modern-cart-layout thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    /* Card Style Row */
    table.is-modern-cart-layout tr.cart_item {
        background: #fff;
        margin-bottom: 30px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        position: relative;
        border: 1px solid #eee;

        /* Grid Layout - Single Column */
        display: grid !important;
        grid-template-columns: 1fr;
        grid-template-areas:
            "image"
            "info"
            "price";
        gap: 5px 0;
        align-items: start;
    }

    /* Reset Cell Layouts for Grid */
    table.is-modern-cart-layout td {
        border: none;
        padding: 0;
        margin: 0;
        display: block;
        min-height: 0;
    }

    table.is-modern-cart-layout td::before {
        content: none !important;
    }

    /* 1. Image (Thumbnail) - Large Display */
    table.is-modern-cart-layout td.product-thumbnail {
        grid-area: image;
        text-align: center;
        margin-bottom: 0;
        display: block !important;
    }

    table.is-modern-cart-layout td.product-thumbnail a {
        display: block;
        width: 100%;
        height: auto;
        opacity: 1;
        position: relative;
    }

    table.is-modern-cart-layout td.product-thumbnail img {
        display: block !important;
        width: 100% !important;
        /* Cap width for sanity, centered */
        max-width: 200px !important;
        height: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        margin: 0 auto;
        border-radius: 8px;
        object-fit: cover;
        aspect-ratio: 1 / 1;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    }

    /* 2. Info (Name & Variations) */
    table.is-modern-cart-layout td.product-name {
        grid-area: info;
        text-align: left !important;
        margin-bottom: 0;
    }

    table.is-modern-cart-layout td.product-name a {
        font-size: 1.0rem;
        font-weight: bold;
        color: #333;
        display: block;
        margin-bottom: 8px;
        line-height: 1.4;
        text-align: left !important;
    }

    /* Remove button (Cart Only) */
    table.is-modern-cart-layout td.product-remove {
        position: absolute;
        top: 0;
        right: 0;
        width: 30px;
        height: 30px;
        z-index: 10;
    }

    table.is-modern-cart-layout td.product-remove a.remove {
        color: #999 !important;
        background: rgba(255, 255, 255, 0.9) !important;
        font-size: 1.5rem;
        width: 100%;
        height: 100%;
        line-height: 28px;
        border-radius: 50%;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    /* Variation Tags */
    table.is-modern-cart-layout td.product-name dl.variation {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin: 0;
        font-size: 0.8rem;
    }

    table.is-modern-cart-layout td.product-name dl.variation dt {
        display: none;
    }

    table.is-modern-cart-layout td.product-name dl.variation dd {
        margin: 0;
        padding: 6px 10px;
        display: inline-block;
        background: #fff;
        border: 1px solid #ff9800;
        /* Orange border */
        border-radius: 4px;
        color: #ff9800;
        /* Orange text */
        font-size: 0.75rem;
        line-height: 1.2;
        box-shadow: none;
    }

    table.is-modern-cart-layout td.product-name dl.variation dd p {
        margin: 0;
        padding: 0;
        display: inline;
    }

    /* 3. Price (Subtotal) */
    table.is-modern-cart-layout td.product-subtotal {
        grid-area: price;
        text-align: right;
        display: block;
    }

    table.is-modern-cart-layout td.product-subtotal::before {
        content: none;
    }

    table.is-modern-cart-layout td.product-price {
        display: none !important;
    }


    /* --- Mobile Cleanup & Sticky Footer --- */

    /* Hide Cart Totals on mobile (moved to sticky footer) */
    .cart_totals h2,
    .cart_totals table.shop_table,
    .cart-collaterals .cart_totals {
        display: none !important;
        padding: 0 !important;
        border: none !important;
        margin: 0 !important;
    }

    /* Sticky Footer Logic (Cart Page Only) */
    .wc-proceed-to-checkout {
        opacity: 0;
        pointer-events: none;
    }

    .wc-proceed-to-checkout.is-mobile-sticky-footer {
        opacity: 1 !important;
        pointer-events: auto !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        background: #fff !important;
        z-index: 2147483647 !important;
        padding: 15px !important;
        box-sizing: border-box !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15) !important;
        border-top: 1px solid #eee !important;
        display: flex !important;
        flex-direction: column !important;
        margin: 0 !important;
        border-radius: 0 !important;
        animation: slideUp 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .wc-proceed-to-checkout.is-mobile-sticky-footer .sticky-total-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #f5f5f5;
        padding-bottom: 8px;
        margin-bottom: 5px;
        margin-bottom: 5px;
        order: -1 !important;
        /* Force Top */
        width: 100%;
    }

    .wc-proceed-to-checkout.is-mobile-sticky-footer .sticky-total-wrapper .label {
        font-weight: bold;
        color: #555;
        font-size: 1.0rem;
    }

    .wc-proceed-to-checkout.is-mobile-sticky-footer .sticky-total-wrapper .amount {
        font-weight: bold;
        color: #333;
        font-size: 28px;
    }

    .woocommerce-Price-currencySymbol {
        font-size: 15px;
    }

    .wc-proceed-to-checkout.is-mobile-sticky-footer>* {
        margin-bottom: 8px !important;
        width: 100% !important;
    }

    .wc-proceed-to-checkout.is-mobile-sticky-footer>*:last-child {
        margin-bottom: 0 !important;
    }

    /* Force unified button styling for both Cart (<a>) and Checkout (<button>) */
    .wc-proceed-to-checkout.is-mobile-sticky-footer .button {
        padding: 1em !important;
        font-size: 1.1rem !important;
        line-height: 1.5 !important;
        height: auto !important;
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        order: 3;
        /* Bottom */
    }

    /* ==========================================================================
       Amazon Pay Widget Customization (Mobile)
       - Global: Prevent FOUC and Blank Space on load
       - Sticky: Show only the button
       ========================================================================== */

    /* 1. Global State (All Mobile Contexts) */
    .wc-amazon-checkout-message {
        width: 100% !important;
        margin-bottom: 10px !important;

        /* Initial Layout: Hidden & Removed from Flow */
        position: absolute !important;
        left: 0;
        top: 0;
        opacity: 0 !important;
        pointer-events: none !important;
        z-index: -100 !important;

        /* Reset container styles */
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    /* 2. Logic to Hide Text/Icons & Show Button Only (Applied Globally) */

    /* Hide the text container and pseudo-elements */
    .wc-amazon-checkout-message .woocommerce-info {
        font-size: 0 !important;
        visibility: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        background: transparent !important;
        color: transparent !important;
        min-height: 0 !important;
    }

    .wc-amazon-checkout-message .woocommerce-info::before,
    .wc-amazon-checkout-message .woocommerce-info::after {
        content: none !important;
        display: none !important;
    }

    /* Force the button itself to be visible */
    .wc-amazon-checkout-message #pay_with_amazon {
        visibility: visible !important;
        display: block !important;
        font-size: initial !important;
        width: 100% !important;
        margin: 0 !important;
        line-height: normal !important;
    }

    .wc-amazon-checkout-message div {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 3. Sticky Footer Active State */
    /* When moved to footer, restore flow and visibility */
    .wc-proceed-to-checkout.is-mobile-sticky-footer .wc-amazon-checkout-message {
        position: static !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: auto !important;
        order: 2;
        /* Top -> Middle */
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }
}

/* GLOBAL Override for Coupon Form */
/* To prevent JS from hiding it on load (flashing issue) */
#woocommerce-checkout-form-coupon {
    display: block !important;
}