/**
 * Critical CSS — loaded as a blocking <link> immediately after
 * the theme-detection script to prevent FOUC.
 *
 * Keeps the page visually stable until the full theme stylesheet
 * (auction-frontend-light / dark) finishes loading asynchronously.
 */

/* ─── Dark theme base (applied while full CSS loads) ─── */
html.wowauction-dark-theme,
html.wowauction-dark-theme body {
    background: #0b1120;
    color: #e0e7ef;
}

/* ─── Light-mode dashboard body ─── */
html:not(.wowauction-dark-theme) body.wowauction-user-dashboard-body {
    background: #f1f5f9;
    color: #0f172a;
}

/* ─── Theme toggle switch — prevent jump ─── */
.wowauction-theme-switch__thumb {
    transform: translateX(0);
}
html.wowauction-dark-theme .wowauction-theme-switch__thumb {
    transform: translateX(18px);
}
html.wowauction-theme-loading .wowauction-theme-switch__thumb {
    transition: none !important;
}

/* ─── Theme toggle icons ─── */
.wowauction-theme-icon-sun  { display: none;  }
.wowauction-theme-icon-moon { display: block; }
html.wowauction-dark-theme .wowauction-theme-icon-sun  { display: block; }
html.wowauction-dark-theme .wowauction-theme-icon-moon { display: none;  }

/* ─── Hidden utilities (must be available before async CSS) ─── */
.wowauction-hidden,
.wowauction-card--hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   Checkout — prevent flash when WC's native checkout / order-pay
   pages are styled by the auction plugin.
   ═══════════════════════════════════════════════════════════════ */

.wowauction-checkout-body {
    transition: none !important;
}

/* Light checkout base */
.wowauction-checkout-body {
    background: #f5f3ff !important;
    color: #111827 !important;
}

/* Dark checkout overrides */
html.wowauction-dark-theme .wowauction-checkout-body {
    background: #0f172a !important;
    color: #f1f5f9 !important;
}
html.wowauction-dark-theme .wowauction-checkout-body .woocommerce form.checkout,
html.wowauction-dark-theme .wowauction-checkout-body .woocommerce form#order_review {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}
html.wowauction-dark-theme .wowauction-checkout-body table.shop_table {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}
html.wowauction-dark-theme .wowauction-checkout-body table.shop_table th,
html.wowauction-dark-theme .wowauction-checkout-body table.shop_table td {
    color: #f1f5f9 !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}
html.wowauction-dark-theme .wowauction-checkout-body #payment ul.payment_methods li,
html.wowauction-dark-theme .wowauction-checkout-body .wc_payment_methods li {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}
html.wowauction-dark-theme .wowauction-checkout-body #payment ul.payment_methods li > label,
html.wowauction-dark-theme .wowauction-checkout-body .wc_payment_methods li > label {
    color: #f1f5f9 !important;
}
html.wowauction-dark-theme .wowauction-checkout-body .wc_payment_methods .payment_box,
html.wowauction-dark-theme .wowauction-checkout-body .wc_payment_methods .payment_box p {
    color: #cbd5e1 !important;
    background: rgba(255, 255, 255, 0.04) !important;
}
html.wowauction-dark-theme .wowauction-checkout-body .woocommerce-privacy-policy-text p {
    color: #94a3b8 !important;
}
html.wowauction-dark-theme .wowauction-checkout-body .woocommerce-privacy-policy-text a {
    color: #f59e0b !important;
}
html.wowauction-dark-theme .wowauction-checkout-body #place_order {
    background: #f59e0b !important;
    color: #1a1a1a !important;
}

/* ─── Preloader ─── */
.wowauction-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b1120;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
html:not(.wowauction-dark-theme) .wowauction-preloader {
    background: #f8fafc;
}
.wowauction-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.wowauction-preloader__spinner {
    position: relative;
    width: 48px;
    height: 48px;
}
.wowauction-preloader__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #7c3aed;
    animation: wowauction-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.wowauction-preloader__ring:nth-child(2) {
    inset: 6px;
    border-top-color: #a78bfa;
    animation-delay: -0.15s;
}
.wowauction-preloader__ring:nth-child(3) {
    inset: 12px;
    border-top-color: #c4b5fd;
    animation-delay: -0.3s;
}
html.wowauction-dark-theme .wowauction-preloader__ring {
    border-top-color: #f59e0b;
}
html.wowauction-dark-theme .wowauction-preloader__ring:nth-child(2) {
    border-top-color: #fbbf24;
}
html.wowauction-dark-theme .wowauction-preloader__ring:nth-child(3) {
    border-top-color: #fcd34d;
}
@keyframes wowauction-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
