/* --- Inherited Saikey Theme Variables from Product Page --- */
:root {
    --sk-bg-color: #070710; 
    --sk-card-bg: #0b101a; 
    --sk-card-bg2: rgba(0, 0, 0, 0.3);
    --sk-sidebar-bg: rgba(22, 28, 40, 0.5);
    
    --sk-text-color: #E0E0E0;
    --sk-text-muted: #9ca3af;
    --sk-border-color: #0C0E1D;
    --sk-glass-border: rgba(255, 255, 255, 0.1);
    
    --sk-primary-accent: #CCF1FF;
    --sk-secondary-accent: #5FC4FF;
    
    --sk-btn-cart-bg: #ba2663;
    --sk-btn-cart-hover: #DC3A7D;
    --sk-btn-cart-text: #ffffff;
    
    --sk-input-bg: rgba(0,0,0,0.3);
    --sk-input-text: #ffffff;
    
    --sk-success-green: #10b981;
    --sk-danger-red: #ff4d4d;

    --font-main: "Sora", "DM Sans", Arial, sans-serif;
}

/* Base resets for WooCommerce body constraints */
body.woocommerce-cart, body.woocommerce-checkout {
    background-color: var(--sk-bg-color) !important;
    color: var(--sk-text-color) !important;
    font-family: var(--font-main) !important;
}

/* Background Layer */
.page-background {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 115vh;
    z-index: -10;
    background: linear-gradient(90deg, rgba(12,14,30,0.98) 0%, rgba(27,30,63,0.88) 50%, rgba(12,14,30,0.98) 100%) !important;
    opacity: 0.85;
    pointer-events: none;
    will-change: transform;
}

.saikey-checkout-wrapper {
    width: 90%;
    max-width: 1350px;
    min-height: 65vh;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.woocommerce {
    max-width: 1350px !important;
    margin: 0 auto !important;
}

/* --- Brutal Table Border Removals --- */
table caption+thead tr:first-child td, 
table caption+thead tr:first-child th, 
table colgroup+thead tr:first-child td, 
table colgroup+thead tr:first-child th, 
table thead:first-child tr:first-child td, 
table thead:first-child tr:first-child th,
.woocommerce table.shop_table, 
.woocommerce table.shop_table th, 
.woocommerce table.shop_table td,
.saikey-checkout-wrapper table th,
.saikey-checkout-wrapper table td {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

.woocommerce table.shop_table {
    margin-bottom: 20px !important;
}

/* --- Core Typography --- */
.saikey-checkout-wrapper .page-title {
    text-align: center;
    font-size: 40px; font-weight: 700;
    margin-bottom: 40px;
    background: linear-gradient(to bottom, #ffffff 0%, #f4f9ff 45%, #cfdbed 50%, #e0e1e3 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0px 1px 0px rgba(255,255,255,0.2));
    display: block;
}

.section-title {
    font-size: 24px !important; font-weight: 600 !important; color: #ffffff !important;
    border-bottom: 1px solid var(--sk-border-color) !important; padding-bottom: 10px !important;
    margin-bottom: 25px !important; text-transform: uppercase !important; letter-spacing: 1px !important;
}

/* --- Glassmorphic Containers --- */
.sk-card, 
.saikey-checkout-wrapper .cart_totals,
.saikey-checkout-wrapper #customer_details .col-1,
.saikey-checkout-wrapper #customer_details .col-2 {
    background: var(--sk-sidebar-bg) !important;
    backdrop-filter: blur(15px) !important; -webkit-backdrop-filter: blur(15px) !important;
    border-radius: 12px !important; border: 1px solid var(--sk-glass-border) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1) !important;
    padding: 25px !important; margin-bottom: 20px !important;
}

/* --- Buttons --- */
.sk-btn, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button {
    background-color: var(--sk-btn-cart-bg) !important; color: var(--sk-btn-cart-text) !important;
    border: none !important; padding: 12px 24px !important; border-radius: 4px !important;
    font-weight: 700 !important; font-family: var(--font-main) !important; cursor: pointer !important;
    transition: all 0.3s !important; text-align: center !important; display: inline-block !important; text-decoration: none !important;
}
.sk-btn:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover {
    background-color: var(--sk-btn-cart-hover) !important;
}

/* --- Inputs and Selects --- */
.sk-input,
.woocommerce form .form-row .input-text,
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row select {
    width: 100% !important; padding: 12px 15px !important; border-radius: 4px !important;
    border: 1px solid var(--sk-border-color) !important; background-color: var(--sk-input-bg) !important;
    color: var(--sk-input-text) !important; font-size: 15px !important; font-family: inherit !important;
    transition: border-color 0.2s, box-shadow 0.2s !important; box-shadow: none !important; margin: 0 !important;
}
.sk-input:focus, .woocommerce form .form-row .input-text:focus, .woocommerce form .form-row select:focus {
    outline: none !important; border-color: var(--sk-secondary-accent) !important; box-shadow: 0 0 0 2px rgba(95, 196, 255, 0.2) !important;
}

.woocommerce form .form-row select {
    appearance: none !important;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%239ca3af%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E") !important;
    background-repeat: no-repeat !important; background-position: right 15px top 50% !important; background-size: 10px auto !important;
}

/* Select2 Dropdown Overrides (Country & State) */
.woocommerce form .form-row .select2-container--default .select2-selection--single {
    background-color: var(--sk-input-bg) !important;
    border: 1px solid var(--sk-border-color) !important;
    border-radius: 4px !important;
    height: 48px !important;
}
.woocommerce form .form-row .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--sk-input-text) !important;
    line-height: 35px !important;
    padding-left: 15px !important;
}
.woocommerce form .form-row .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px !important;
    right: 10px !important;
}
.woocommerce form .form-row .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--sk-text-muted) transparent transparent transparent !important;
}
.select2-dropdown {
    background-color: var(--sk-card-bg) !important;
    border: 1px solid var(--sk-border-color) !important;
    color: var(--sk-text-color) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8) !important;
}
.select2-search--dropdown .select2-search__field {
    background-color: var(--sk-input-bg) !important;
    border: 1px solid var(--sk-border-color) !important;
    color: var(--sk-input-text) !important;
    padding: 8px !important;
    border-radius: 4px !important;
}
.select2-search--dropdown .select2-search__field:focus {
    outline: none !important;
    border-color: var(--sk-secondary-accent) !important;
}
.select2-container--default .select2-results__option {
    color: var(--sk-text-color) !important;
    padding: 10px 15px !important;
    background-color: transparent !important;
}
.select2-container--default .select2-results__option[aria-selected="true"],
.select2-container--default .select2-results__option[data-selected="true"] {
    background-color: rgba(255, 255, 255, 0.1) !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[data-selected] {
    background-color: var(--sk-secondary-accent) !important;
    color: #000 !important;
}

/* Layouts */
.two-column-layout { display: flex; gap: 30px; align-items: flex-start; }
.col-left { flex: 3; min-width: 0; display: flex; flex-direction: column; }
.col-right { flex: 2; min-width: 0; display: flex; flex-direction: column; }

/* --- Cart Overrides --- */
.cart-table-header { 
    display: grid; 
    grid-template-columns: 60px 3fr 1fr 1fr; 
    padding-bottom: 15px; 
    border-bottom: 1px solid var(--sk-border-color); 
    margin-bottom: 20px; 
    font-weight: 700; 
    font-size: 14px; 
    color: var(--sk-text-muted); 
    text-transform: uppercase; 
}

.cart-item { 
    position: relative;
    display: grid; 
    grid-template-columns: 60px 3fr 1fr 1fr; 
    align-items: center; 
    padding: 20px; 
    border: 1px solid var(--sk-glass-border); 
    border-radius: 12px;
    background: var(--sk-card-bg2);
    margin-bottom: 20px; 
    overflow: hidden;
    min-height: 100px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.cart-item:last-child { margin-bottom: 0; }

.cart-item-remove { 
    position: relative;
    z-index: 2;
    color: var(--sk-text-color) !important; 
    text-decoration: none !important; 
    font-weight: normal; 
    font-size: 24px; 
    line-height: 1;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 36px !important; 
    height: 36px !important; 
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid var(--sk-glass-border) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
    cursor: pointer; 
    transition: all 0.3s ease !important; 
    top: 0;
    left: 0;
    opacity: 0;
    visibility: hidden;
}
.cart-item:hover .cart-item-remove {
    opacity: 1;
    visibility: visible;
}
.cart-item-remove:hover { 
    color: #fff !important; 
    background: var(--sk-danger-red) !important; 
    border-color: var(--sk-danger-red) !important;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 77, 77, 0.4) !important;
}

.cart-item-product { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
    z-index: 1;
    justify-content: flex-end;
}

/* Make image links position absolute so they don't break flex spacing */
.product-thumbnail > a {
    position: absolute;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    z-index: 0;
}

/* Background Masked Image */
.cart-item-img { 
    position: absolute !important;
    top: 0; left: 0;
    width: 65% !important; 
    height: 100% !important;
    object-fit: cover;
    z-index: 0;
    border-radius: 0; 
    box-shadow: none; 
    border: none; 
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,0.9) 40%, rgba(0,0,0,0) 100%) !important;
    mask-image: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,0.9) 40%, rgba(0,0,0,0) 100%) !important;
    opacity: 1 !important;
    pointer-events: none;
}

.cart-item-name { 
    color: #fff !important; 
    text-decoration: none; 
    font-weight: 600; 
    font-size: 16px;
    transition: color 0.3s; 
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
    position: relative;
    z-index: 1;
}
.cart-item-name:hover { color: var(--sk-primary-accent) !important; }

.cart-item-product .product-name {
    display: none !important;
}

.product-price, .product-subtotal {
    position: relative;
    z-index: 1;
    font-weight: 500;
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}

.cart-totals-row { display: flex; justify-content: space-between; margin-bottom: 25px; font-size: 15px; color: #fff; }

/* Cart & Checkout Specific Adjustments */
.woocommerce .cart-collaterals .cart_totals, 
.woocommerce-page .cart-collaterals .cart_totals {
    width: 100% !important;
    float: none !important;
}

.coupon-wrapper {
    padding: 15px !important;
}
.coupon-wrapper form { display: flex; gap: 10px; width: 100%; margin: 0; align-items: center; }
.coupon-wrapper .sk-btn {
    border-radius: 50px !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    width: auto !important;
}

.wc-proceed-to-checkout a.checkout-button { 
    width: 100% !important; 
    margin-top: 15px !important; 
    padding: 12px 20px !important; 
    font-size: 14px !important; 
    border-radius: 50px !important;
}

/* Force container to bypass theme max-widths when Elementor is stripped */
body.woocommerce-cart .site-main,
body.woocommerce-checkout .site-main,
body:not([class*="elementor-page-"]) .site-main {
    max-width: 100% !important;
}

/* --- Checkout Overrides --- */
.woocommerce-checkout .woocommerce-checkout-review-order { 
    background: transparent !important; 
    border: none !important; 
    box-shadow: none !important; 
    padding: 0 !important; 
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.woocommerce-checkout .form-row { display: flex !important; flex-direction: column !important; gap: 8px !important; width: 100% !important; float: none !important; margin-bottom: 20px !important; }
.woocommerce-checkout .form-row-first { float: left !important; width: 48% !important; }
.woocommerce-checkout .form-row-last { float: right !important; width: 48% !important; }
.woocommerce-checkout .form-row label { font-size: 13px !important; font-weight: 600 !important; color: var(--sk-text-muted) !important; text-transform: uppercase !important; display: block !important; margin: 0 !important; }
.woocommerce-checkout .form-row .required { color: var(--sk-danger-red) !important; text-decoration: none !important; border: none !important; }
.woocommerce-checkout::after { content: ""; display: table; clear: both; }
.woocommerce-cart-form .product-thumbnail a .cart-item-img { width: 350px !important;}

/* Order Summary */
.order-summary-table, .shop_table { width: 100% !important; border-collapse: collapse !important; font-size: 14px !important; border: none !important; margin: 0 !important; }
.order-summary-table th, .order-summary-table td, .shop_table th, .shop_table td { padding: 12px 0 !important; text-align: left !important; border-bottom: 1px solid var(--sk-glass-border) !important; border-top: none !important; background: transparent !important; }
.order-summary-table th, .shop_table th { color: var(--sk-text-muted) !important; font-weight: 600 !important; text-transform: uppercase !important; font-size: 12px !important; }
.order-summary-table th:last-child, .order-summary-table td:last-child, .shop_table th:last-child, .shop_table td:last-child { text-align: right !important; }
.order-summary-table tr:last-child td, .shop_table tr:last-child td { border-bottom: none !important; padding-bottom: 0 !important; }
.product-name { color: var(--sk-secondary-accent) !important; padding-right: 20px;}
.product-name a { text-decoration: none; z-index: 5;position: relative; text-shadow: 0px 0px 5px black; font-weight: 600;}
.woocommerce-checkout-review-order-table tbody::after { content: ""; display: table-row; height: 20px;}

/* Payments Box */
#payment.woocommerce-checkout-payment { background-color: rgba(0, 0, 0, 0.2) !important; padding: 20px; border-radius: 12px !important; border: 1px solid var(--sk-border-color) !important; margin-top: 20px; }
#payment ul.payment_methods { margin: 0 !important; padding: 0 !important; border: none !important; }
#payment ul.payment_methods li.wc_payment_method { margin-bottom: 20px !important; cursor: pointer; padding: 15px !important; background-color: var(--sk-card-bg) !important; border: 1px solid var(--sk-glass-border) !important; border-radius: 8px !important; transition: all 0.2s ease !important; }
#payment ul.payment_methods li.wc_payment_method:last-child { margin-bottom: 0 !important; }
#payment ul.payment_methods li.wc_payment_method:hover { border-color: var(--sk-secondary-accent) !important; }
#payment ul.payment_methods li input[type="radio"] { margin-top: 4px; accent-color: var(--sk-btn-cart-bg); width: 16px; height: 16px; float: left; margin-right: 15px; }
#payment ul.payment_methods li label { font-size: 14px; line-height: 1.4; color: #fff; font-weight: 500; display: block; margin: 0; }
#payment div.payment_box { background-color: rgba(0,0,0,0.4) !important; padding: 15px; border-radius: 6px !important; margin-top: 15px; text-align: left !important; border: 1px solid var(--sk-border-color) !important; color: var(--sk-text-muted) !important; width: 100%; display: block; box-sizing: border-box; clear: both; }
#payment div.payment_box::before { display: none !important; }

#place_order { 
    width: 100% !important; 
    margin-top: 20px !important; 
    padding: 15px !important; 
    font-size: 16px !important; 
    display: block !important; 
    visibility: visible !important; 
    opacity: 1 !important; 
}

/* Ensure the place-order container stays visible against gateway JS overrides */
body .woocommerce-checkout .form-row.place-order { 
    display: flex !important; 
    visibility: visible !important; 
    opacity: 1 !important; 
}

/* Coupon prompts - Removed padding and margin !important for smoother jQuery animations */
.woocommerce-form-coupon-toggle { background-color: rgba(0,0,0,0.2) !important; border: 1px solid var(--sk-border-color) !important; border-radius: 8px !important; padding: 15px 20px !important; font-size: 14px !important; backdrop-filter: blur(10px) !important; }
.woocommerce-form-coupon-toggle .woocommerce-info { border: none !important; color: var(--sk-text-color) !important; padding: 0 !important; margin: 0 !important; display: flex; gap: 5px; align-items: center; box-shadow: none !important; background-color: rgb(40 37 37 / 20%) !important;}
.woocommerce-form-coupon-toggle .woocommerce-info::before { display: none !important; }
.woocommerce-form-coupon-toggle .woocommerce-info a { color: var(--sk-secondary-accent) !important; text-decoration: none !important; font-weight: 500 !important; }
.woocommerce-form-coupon-toggle .woocommerce-info a:hover { text-decoration: underline !important; }
form.checkout_coupon { background: var(--sk-sidebar-bg) !important; padding: 20px; border: 1px solid var(--sk-glass-border) !important; border-radius: 8px !important; margin-bottom: 20px; backdrop-filter: blur(15px) !important; }

/* Fix for checkout coupon form inputs stacking awkwardly */
.woocommerce-checkout form.checkout_coupon .form-row { display: block !important; width: auto !important; margin-bottom: 0 !important; }
.woocommerce-checkout form.checkout_coupon .form-row-first { width: 68% !important; float: left !important; }
.woocommerce-checkout form.checkout_coupon .form-row-last { width: 30% !important; float: right !important; }
.woocommerce-checkout form.checkout_coupon .button { border-radius: 50px !important; padding: 12px 16px !important; font-size: 13px !important; width: 100% !important; white-space: nowrap !important; }
.woocommerce-checkout form.checkout_coupon::after { content: ""; display: table; clear: both; }

/* Notices */
.woocommerce-message, .woocommerce-error, .woocommerce-info {
    background-color: var(--sk-card-bg2) !important; backdrop-filter: blur(10px) !important; -webkit-backdrop-filter: blur(10px) !important;
    border-radius: 8px !important; padding: 15px 25px !important; 
    display: flex; /* REMOVED !important tag here so JS gateway toggles can successfully hide empty boxes */
    justify-content: space-between !important;
    align-items: center !important; margin-bottom: 30px !important; position: relative !important; overflow: hidden !important;
    border: 1px solid var(--sk-glass-border) !important; box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important; color: #fff !important;
}
.woocommerce-message::before, .woocommerce-error::before, .woocommerce-info::before {
    content: '' !important; position: absolute !important; top: 0 !important; left: 0 !important; right: 0 !important;
    height: 3px !important; background: linear-gradient(90deg, var(--sk-btn-cart-bg) 0%, var(--sk-secondary-accent) 100%) !important;
}
.woocommerce-message a.button, .woocommerce-error a.button, .woocommerce-info a.button { background-color: transparent !important; color: var(--sk-text-color) !important; border: 1px solid var(--sk-glass-border) !important; }
.woocommerce-message a.button:hover, .woocommerce-error a.button:hover, .woocommerce-info a.button:hover { background-color: var(--sk-card-bg2) !important; border-color: var(--sk-secondary-accent) !important; color: #ffffff !important; }

/* Prevent hidden or empty gateway-injected notices from rendering as blank glowing rectangles */
.woocommerce-message[style*="none"], .woocommerce-error[style*="none"], .woocommerce-info[style*="none"],
p.woocommerce-error:empty,
.woocommerce-message:empty, .woocommerce-error:empty, .woocommerce-info:empty {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

/* Responsive Grid Adjustments */
@media (max-width: 900px) {
    .two-column-layout { flex-direction: column; }
    .col-left, .col-right { width: 100%; }
    .woocommerce-checkout .form-row-first, .woocommerce-checkout .form-row-last { float: none !important; width: 100% !important; }
    .woocommerce-checkout form.checkout_coupon .form-row-first, .woocommerce-checkout form.checkout_coupon .form-row-last { width: 100% !important; margin-bottom: 10px !important; }
    
    .cart-table-header { 
        display: grid; 
        grid-template-columns: 40px 2fr 1fr 1fr; 
        gap: 5px; 
        font-size: 11px; 
        padding-bottom: 10px; 
        margin-bottom: 10px; 
    }
    
    /* Responsive Cart Item Card overrides */
    .cart-item { 
        grid-template-columns: 40px 2fr 1fr 1fr; 
        gap: 5px; 
        text-align: left; 
        position: relative; 
        padding: 15px 10px; 
    }
    .cart-item-remove { 
        position: relative; 
        top: 0; 
        left: 0; 
        right: auto;
        z-index: 3; 
        opacity: 1 !important; 
        visibility: visible !important;
        width: 30px !important;
        height: 30px !important;
        font-size: 20px;
    }
    .cart-item-product { flex-direction: row; }
    
    /* Adapt mask on mobile so the image sits elegantly behind the top text */
    .cart-item-img {
        width: 100% !important;
        -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,0.9) 40%, rgba(0,0,0,0) 100%) !important;
        mask-image: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,0.9) 40%, rgba(0,0,0,0) 100%) !important;
    }

    .coupon-wrapper form { flex-direction: column !important; }
}