/* ===================================================================
   NABILHUT — Advanced Animation Layer (Phase 2)
   Additive only — no existing styles modified
   =================================================================== */

/* ---------------------------------------------------------------
   Scroll Reveal System — Extended Delays (ao--delay-1 through ao--delay-12)
   Existing storefront.js already handles ao--delay-1 to ao--delay-8.
   This extends to 12 and adds new animation variants.
--------------------------------------------------------------- */

/* Base hidden state for all .ao elements */
.ao {
    opacity: 0;
    will-change: opacity, transform;
}

/* Visible state — triggered by IntersectionObserver in storefront.js */
.ao.ao--visible {
    opacity: 1;
    transform: none !important;
}

/* Fade Up */
.ao.ao--fade-up    { transform: translateY(28px); transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1); }
/* Fade In (opacity only) */
.ao.ao--fade-in    { transform: none; transition: opacity 0.6s ease; }
/* Fade Down */
.ao.ao--fade-down  { transform: translateY(-20px); transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1); }
/* Fade Left */
.ao.ao--fade-left  { transform: translateX(28px); transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1); }
/* Fade Right */
.ao.ao--fade-right { transform: translateX(-28px); transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1); }
/* Scale Up */
.ao.ao--scale-up   { transform: scale(0.94); transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.16,1,0.3,1); }

/* Stagger delay tokens — 1 through 12 */
.ao--delay-1  { transition-delay: 0.05s; }
.ao--delay-2  { transition-delay: 0.12s; }
.ao--delay-3  { transition-delay: 0.19s; }
.ao--delay-4  { transition-delay: 0.26s; }
.ao--delay-5  { transition-delay: 0.33s; }
.ao--delay-6  { transition-delay: 0.40s; }
.ao--delay-7  { transition-delay: 0.47s; }
.ao--delay-8  { transition-delay: 0.54s; }
.ao--delay-9  { transition-delay: 0.61s; }
.ao--delay-10 { transition-delay: 0.68s; }
.ao--delay-11 { transition-delay: 0.75s; }
.ao--delay-12 { transition-delay: 0.82s; }

/* ---------------------------------------------------------------
   Skeleton / Shimmer Loader
   Usage: <div class="skeleton skeleton--text"></div>
          <div class="skeleton skeleton--thumb"></div>
--------------------------------------------------------------- */
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #EEEEEE 25%,
        #F8F8F8 50%,
        #EEEEEE 75%
    );
    background-size: 1200px 100%;
    animation: shimmer 1.6s infinite linear;
    border-radius: var(--radius-sm);
    display: block;
    will-change: background-position;
}

.skeleton--text {
    height: 14px;
    width: 100%;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton--text-sm {
    height: 10px;
    width: 70%;
    margin-bottom: 6px;
    border-radius: 4px;
}

.skeleton--thumb {
    width: 100%;
    padding-top: 125%;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.skeleton--title {
    height: 18px;
    width: 80%;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton--badge {
    height: 20px;
    width: 50px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.skeleton--price {
    height: 22px;
    width: 90px;
    border-radius: 4px;
}

/* Product card skeleton wrapper */
.product-card-skeleton {
    background: var(--color-pure-white);
    border: 1px solid #EEEEF4;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.product-card-skeleton .skeleton-body {
    padding: 1.1rem;
}

/* ---------------------------------------------------------------
   Header Compact Scroll Mode
   JS will add .store-header--compact when scrollY > 100px
--------------------------------------------------------------- */
.store-header {
    transition: padding 0.25s ease, box-shadow 0.25s ease;
    /* Removed backdrop-filter transition — it caused header jitter on scroll */
}

.store-header--compact {
    padding-top: 0.55rem !important;
    padding-bottom: 0.55rem !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35) !important;
    /* Removed backdrop-filter — causes GPU jitter when transitioning */
}

.store-header--compact .header-logo img {
    height: 38px;
    transition: height 0.3s ease;
}

/* ---------------------------------------------------------------
   Page Transition Overlay
   Adds a brief fade-out / fade-in on internal link navigation.
   JS controls .page-leaving class on <body>.
--------------------------------------------------------------- */
@keyframes pageEnter {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Removed translateY — it caused vertical jitter on page load */
/* pageEnter animation removed — caused visible flash/jitter on every page load.
   Content appears instantly; page transitions handled via JS opacity fade only. */
.main-content-wrapper {
    /* No CSS animation — JS-driven opacity fade in initPageTransition() is sufficient */
    animation: none;
}

/* ---------------------------------------------------------------
   Counter-Up Number Animation
   Applied automatically by animations.js to .counter-number elements.
   The CSS handles the base state; JS drives the value.
--------------------------------------------------------------- */
.counter-number {
    display: inline-block;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}

/* ---------------------------------------------------------------
   Magnetic Hover — DISABLED
   Caused product images to appear blank on hover.
--------------------------------------------------------------- */

/* ---------------------------------------------------------------
   Card Shine / Gloss Sweep Effect — DISABLED
   Removed as it caused a white overlay on product images on hover.
--------------------------------------------------------------- */

/* ---------------------------------------------------------------
   Toast Slide-In Animation
   Already referenced in storefront.js — keyframe was missing from CSS
--------------------------------------------------------------- */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------------------------------------------------------------
   Cart Badge Bounce Animation
   Referenced in storefront.js animateCartIcon() — keyframe was missing
--------------------------------------------------------------- */
@keyframes cartBadgeBounce {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.45); }
    55%  { transform: scale(0.88); }
    75%  { transform: scale(1.18); }
    100% { transform: scale(1); }
}

.cart-badge-bounce {
    animation: cartBadgeBounce 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ---------------------------------------------------------------
   Heart Pulse Animation
   Referenced in storefront.js initWishlistButtons() — keyframe was missing
--------------------------------------------------------------- */
@keyframes heartPulse {
    0%   { transform: scale(1); }
    25%  { transform: scale(1.35); }
    50%  { transform: scale(0.9); }
    75%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.heart-pulse {
    animation: heartPulse 0.5s ease both;
}

/* ---------------------------------------------------------------
   Button Ripple Effect
   Referenced in storefront.js initButtonRipple() — CSS was missing
--------------------------------------------------------------- */
.btn-gold,
.btn-outline-gold,
.btn-hero-primary {
    position: relative;
    overflow: hidden;
}

@keyframes rippleExpand {
    from { width: 8px; height: 8px; opacity: 0.5; transform: translate(-50%, -50%) scale(0); }
    to   { width: 200px; height: 200px; opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.btn-ripple {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    pointer-events: none;
    animation: rippleExpand 0.55s ease-out forwards;
}

/* ---------------------------------------------------------------
   Spinner — Global consistent loading state
   Usage: <span class="nhut-spinner"></span>
--------------------------------------------------------------- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.nhut-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.nhut-spinner--gold {
    border-color: rgba(217, 154, 32, 0.3);
    border-top-color: var(--color-luxury-gold);
}

.nhut-spinner--sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

/* ---------------------------------------------------------------
   Flash Message Fade-Up
   Referenced in master.php inline style — keyframe was missing
--------------------------------------------------------------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------
   Scroll-to-Top Button
   Appears after 400px scroll via animations.js
--------------------------------------------------------------- */
#scroll-to-top {
    position: fixed;
    bottom: 110px;
    right: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-premium-black);
    border: 1px solid rgba(217, 154, 32, 0.4);
    color: var(--color-champagne-gold);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1040;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
    pointer-events: none;
}

#scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

#scroll-to-top:hover {
    background: var(--color-luxury-gold);
    color: var(--color-premium-black);
    border-color: var(--color-luxury-gold);
    transform: translateY(-2px);
}

@media (min-width: 992px) {
    #scroll-to-top {
        bottom: 40px;
        right: 28px;
    }
}

/* ---------------------------------------------------------------
   Parallax Section
   JS drives --parallax-offset CSS var on .parallax-bg elements
--------------------------------------------------------------- */
.parallax-bg {
    background-attachment: fixed;
    will-change: background-position;
}

/* Disable parallax on touch devices for performance */
@media (hover: none) {
    .parallax-bg {
        background-attachment: scroll;
    }
}

/* ---------------------------------------------------------------
   Service Icon Hover Animation
   Adds a gentle pulse to service icon wrappers on hover
--------------------------------------------------------------- */
@keyframes iconPulse {
    0%   { box-shadow: 0 0 0 0 rgba(217, 154, 32, 0.4); }
    70%  { box-shadow: 0 0 0 10px rgba(217, 154, 32, 0); }
    100% { box-shadow: 0 0 0 0 rgba(217, 154, 32, 0); }
}

.service-highlight-box:hover .service-icon-wrap {
    animation: iconPulse 0.8s ease-out;
}

/* ---------------------------------------------------------------
   prefers-reduced-motion — All non-essential animations disabled
--------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .ao {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .skeleton {
        animation: none;
        background: #EEEEEE;
    }

    .main-content-wrapper {
        animation: none;
    }

    .product-card::before {
        display: none;
    }

    .service-highlight-box:hover .service-icon-wrap {
        animation: none;
    }

    #scroll-to-top {
        transition: opacity 0.1s ease;
    }
}

/* ===================================================================
   Phase 3 — Micro-interactions & UX Feedback
   =================================================================== */

/* ---------------------------------------------------------------
   Form Input Focus Glow — Animated Gold Border Draw
   Adds a smooth animated border highlight on focus.
   Works with existing .form-control focus styles in brand.css.
--------------------------------------------------------------- */
/* Form input focus — removed borderGlow animation (caused flicker with transition) */
.form-control:focus,
.form-select:focus {
    border-color: var(--color-luxury-gold) !important;
    box-shadow: 0 0 0 3px rgba(217, 154, 32, 0.2);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Input wrapper for password toggle — positions the eye icon */
.input-password-wrap {
    position: relative;
}

.input-password-wrap .form-control {
    padding-right: 2.8rem;
}

.btn-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9999AA;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.95rem;
    line-height: 1;
    transition: color 0.2s ease;
    z-index: 5;
}

.btn-password-toggle:hover {
    color: var(--color-luxury-gold);
}

/* ---------------------------------------------------------------
   Password Strength Indicator
--------------------------------------------------------------- */
.password-strength-bar {
    height: 4px;
    border-radius: 2px;
    background: #E8E8EE;
    margin-top: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.password-strength-fill {
    height: 100%;
    border-radius: 2px;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
}

.password-strength-fill.strength-weak   { width: 25%; background: #E53E3E; }
.password-strength-fill.strength-fair   { width: 50%; background: #ED8936; }
.password-strength-fill.strength-good   { width: 75%; background: #D99A20; }
.password-strength-fill.strength-strong { width: 100%; background: #38A169; }

.password-strength-label {
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 4px;
    transition: color 0.3s ease;
}

/* ---------------------------------------------------------------
   Form Submit Button — Loading State Enhancement
   Adds consistent loading state across all forms.
   JS adds .btn--loading class to trigger these styles.
--------------------------------------------------------------- */
.btn--loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    cursor: not-allowed;
}

.btn--loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(17, 17, 22, 0.3);
    border-top-color: var(--color-premium-black);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* White spinner variant (for dark buttons) */
.btn--loading.btn-dark-luxury::after,
.btn--loading.btn-hero-primary::after,
.btn--loading.quick-action-add::after {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
}

/* ---------------------------------------------------------------
   Success Checkmark Animation
   Usage: <div class="success-check"><svg>...</svg></div>
   JS injects the SVG; CSS animates the stroke-dashoffset.
--------------------------------------------------------------- */
@keyframes checkmarkDraw {
    from { stroke-dashoffset: 100; opacity: 0.6; }
    to   { stroke-dashoffset: 0;   opacity: 1; }
}

@keyframes checkCirclePop {
    0%   { transform: scale(0.7); opacity: 0; }
    60%  { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}

.success-check-circle {
    animation: checkCirclePop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.success-check-path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: checkmarkDraw 0.45s 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ---------------------------------------------------------------
   Active Nav Tab indicator on mobile bottom nav
   Adds animated gold dot below active tab icon
--------------------------------------------------------------- */
.mobile-nav-tab.active::before {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-luxury-gold);
    margin: 0 auto 2px;
    animation: dotPop 0.3s ease both;
}

@keyframes dotPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ---------------------------------------------------------------
   Offcanvas / Drawer Slide Enhancement
   Adds a subtle scale + translate entrance to Bootstrap offcanvas
--------------------------------------------------------------- */
.offcanvas {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* ---------------------------------------------------------------
   Dropdown Menu Slide-Down
   Enhances Bootstrap dropdown with smooth enter animation
--------------------------------------------------------------- */
.dropdown-menu.show {
    animation: dropdownSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes dropdownSlideIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------------------------------------------------------------
   Modal Scale + Fade Animation
   Enhances Bootstrap modals with scale entrance
--------------------------------------------------------------- */
.modal.show .modal-dialog {
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------------------------------------------------------------
   Alert / Flash Messages — Refined entrance
--------------------------------------------------------------- */
.nhut-flash {
    animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* badge-sale glow pulse — reduced to non-jittery subtle static shadow */
.badge-sale {
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

/* ---------------------------------------------------------------
   Wishlist corner button — hover scale micro-interaction
--------------------------------------------------------------- */
.btn-wishlist-corner {
    transition: background 0.25s ease, color 0.25s ease,
                transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s ease !important;
}

.btn-wishlist-corner:hover {
    transform: scale(1.12) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18) !important;
}

/* ---------------------------------------------------------------
   Header action buttons — enhanced hover micro-interaction
--------------------------------------------------------------- */
.header-action-btn {
    transition: color 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.header-action-btn:hover {
    transform: translateY(-2px) scale(1.08) !important;
}

/* ---------------------------------------------------------------
   Service highlight box — hover lift
--------------------------------------------------------------- */
.service-highlight-box {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: var(--radius-md);
}

.service-highlight-box:hover {
    transform: translateY(-3px);
}

/* ---------------------------------------------------------------
   Footer social icons — bounce on hover
--------------------------------------------------------------- */
.store-footer .footer-social a {
    transition: color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.store-footer .footer-social a:hover {
    transform: translateY(-4px) scale(1.15) !important;
}

/* ---------------------------------------------------------------
   Category card overlay text — slide up on hover
--------------------------------------------------------------- */
.category-card-overlay {
    transition: background 0.4s ease;
}

.category-card-overlay h5,
.category-card-overlay span {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-card:hover .category-card-overlay h5 {
    transform: translateY(-3px);
}

.category-card:hover .category-card-overlay span {
    transform: translateY(-3px);
}

/* ---------------------------------------------------------------
   prefers-reduced-motion — Phase 3 additions
--------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .form-control:focus,
    .form-select:focus { animation: none; }

    .badge-sale { animation: none; }

    .btn-wishlist-corner:hover { transform: none !important; }
    .header-action-btn:hover   { transform: none !important; }
    .service-highlight-box:hover { transform: none; }
    .store-footer .footer-social a:hover { transform: none !important; }
    .category-card-overlay h5,
    .category-card-overlay span { transition: none; }

    .dropdown-menu.show { animation: none; }
    .modal.show .modal-dialog { animation: none; }
}

/* ---------------------------------------------------------------
   Phase 3 — Input Has Value State
   JS adds .input-has-value when a field contains content.
   Enables subtle visual confirmation that data is entered.
--------------------------------------------------------------- */
.form-control.input-has-value,
.form-select.input-has-value {
    border-color: rgba(217, 154, 32, 0.45);
    background-color: rgba(217, 154, 32, 0.03);
}

/* ---------------------------------------------------------------
   Phase 3 — Order Success Icon Enhancement
   Targets the existing order success icon container
   so JS can inject the SVG without markup changes.
--------------------------------------------------------------- */
.order-success-icon,
.nhut-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.2rem;
}

/* ---------------------------------------------------------------
   Phase 3 — Auth Card Enhancement
   Adds a subtle gold top-border to login/register cards for brand depth.
   Completely additive — no existing card styles changed.
--------------------------------------------------------------- */
.card.rounded-4 {
    border-top: 3px solid rgba(217, 154, 32, 0.35) !important;
    transition: box-shadow 0.3s ease;
}

.card.rounded-4:hover {
    box-shadow: 0 16px 40px rgba(17, 17, 22, 0.1), 0 4px 12px rgba(217, 154, 32, 0.08) !important;
}

/* ---------------------------------------------------------------
   Phase 3 — Table Row Hover Micro-interaction
   Adds a smooth highlight to admin/customer table rows on hover.
--------------------------------------------------------------- */
.table > tbody > tr {
    transition: background-color 0.18s ease;
}

.table-hover > tbody > tr:hover {
    background-color: rgba(217, 154, 32, 0.04) !important;
}

/* ---------------------------------------------------------------
   Phase 3 — prefers-reduced-motion additions
--------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .form-control.input-has-value { transition: none; }
    .card.rounded-4 { transition: none; }
    .table > tbody > tr { transition: none; }
}

/* ===================================================================
   Phase 4 — Product Card Enhancements
   =================================================================== */

/* ---------------------------------------------------------------
   Out of Stock Overlay
   Applied when .product-card has data-stock="0" or .out-of-stock class
--------------------------------------------------------------- */
.product-card.out-of-stock .product-thumb-container::after {
    content: 'Out of Stock';
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 22, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    z-index: 4;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.product-card.out-of-stock .product-thumb-img {
    filter: grayscale(35%) brightness(0.85);
}

.product-card.out-of-stock .quick-action-add,
.product-card.out-of-stock .quick-action-order {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

/* ---------------------------------------------------------------
   Product Card Image Zoom — preserve-3d REMOVED
   transform-style: preserve-3d caused image to go blank on hover
   when combined with perspective transforms on parent elements.
--------------------------------------------------------------- */
.product-thumb-container {
    /* intentionally no transform-style: preserve-3d */
    transform-style: flat;
}

/* ---------------------------------------------------------------
   Secondary Image Crossfade
   When a card has data-hover-img attribute, JS swaps to it.
   CSS handles the crossfade transition via opacity layering.
--------------------------------------------------------------- */
.product-thumb-img.is-hover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 2;
}

/* Secondary image crossfade — only when card has data-hover-img */
.product-card[data-hover-img]:hover .product-thumb-img.is-hover-img {
    opacity: 1;
}

.product-card[data-hover-img]:hover .product-thumb-img:not(.is-hover-img) {
    opacity: 0;
}

/* ---------------------------------------------------------------
   Quick Action Bar — Refined timing
   storefront.css already defines max-height animation.
   This sharpens the easing and adds icon micro-animation.
--------------------------------------------------------------- */
.quick-action-btn i {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quick-action-btn:hover i {
    transform: scale(1.25);
}

/* ---------------------------------------------------------------
   Product Card — Gold border focus ring on keyboard nav
--------------------------------------------------------------- */
.product-card:focus-within {
    outline: 2px solid rgba(217, 154, 32, 0.5);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------
   New / Featured badge — subtle entrance animation
--------------------------------------------------------------- */
.product-badge-pill .badge-gold,
.product-badge-pill .badge-luxury-black,
.product-badge-pill .badge-sale {
    animation: badgeEntrance 0.4s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes badgeEntrance {
    from { opacity: 0; transform: scale(0.7) translateY(-4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------------------------------------------------------------
   Product Price — Animated highlight on sale price
--------------------------------------------------------------- */
.price-current {
    position: relative;
    display: inline-block;
}

/* Sale price gets a subtle gold underline emphasis */
.product-price-box:has(.price-regular) .price-current::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--color-luxury-gold), transparent);
    border-radius: 1px;
    opacity: 0.6;
}

/* ---------------------------------------------------------------
   Wishlist Active State — filled heart with red glow
--------------------------------------------------------------- */
.btn-wishlist-corner.active {
    background: #FFF0F1 !important;
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* ---------------------------------------------------------------
   Category Card — Enhanced overlay gradient on hover
--------------------------------------------------------------- */
.category-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 30%,
        rgba(217, 154, 32, 0.08) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.category-card:hover::after {
    opacity: 1;
}

/* Ensure overlay content stays above the new pseudo-element */
.category-card-overlay {
    z-index: 2;
}

/* Product Grid — Stagger entrance uses ao--delay-* tokens only.
   No extra animation-delay here to avoid conflict with .ao base state. */
.product-grid .product-card:nth-child(1)  { --ao-delay: 0.05s; }
.product-grid .product-card:nth-child(2)  { --ao-delay: 0.10s; }
.product-grid .product-card:nth-child(3)  { --ao-delay: 0.15s; }
.product-grid .product-card:nth-child(4)  { --ao-delay: 0.20s; }
.product-grid .product-card:nth-child(5)  { --ao-delay: 0.25s; }
.product-grid .product-card:nth-child(6)  { --ao-delay: 0.30s; }
.product-grid .product-card:nth-child(7)  { --ao-delay: 0.35s; }
.product-grid .product-card:nth-child(8)  { --ao-delay: 0.40s; }

/* ---------------------------------------------------------------
   Product Card Skeleton — dark background variant
   Used when skeleton appears on dark-bg sections
--------------------------------------------------------------- */
.dark-section .skeleton {
    background: linear-gradient(
        90deg,
        #22222C 25%,
        #2A2A38 50%,
        #22222C 75%
    );
    background-size: 1200px 100%;
}

/* ---------------------------------------------------------------
   prefers-reduced-motion — Phase 4 additions
--------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .product-thumb-img.is-hover-img { transition: none; }
    .product-card:hover .product-thumb-img { transition: none; }
    .quick-action-btn i { transition: none; }
    .quick-action-btn:hover i { transform: none; }
    .product-badge-pill .badge-gold,
    .product-badge-pill .badge-luxury-black,
    .product-badge-pill .badge-sale { animation: none; }
    .category-card::after { transition: none; }
    .category-card-overlay h5,
    .category-card-overlay span { transition: none; }
}

/* ===================================================================
   Phase 6 — Page-specific Improvements
   =================================================================== */

/* ---------------------------------------------------------------
   Order Success Page — Confetti entrance + card polish
--------------------------------------------------------------- */
@keyframes confettiDrop {
    0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(80px)  rotate(720deg); opacity: 0; }
}

.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confettiDrop 1.2s ease-out forwards;
    pointer-events: none;
}

.order-success-confetti {
    position: relative;
    overflow: visible;
}

/* Order info cards — hover lift */
.order-success-wrapper .card {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.order-success-wrapper .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(17, 17, 22, 0.1) !important;
}

/* ---------------------------------------------------------------
   Checkout Page — Payment option card selection animation
--------------------------------------------------------------- */
.payment-option-card {
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease,
                transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.payment-option-card:hover {
    border-color: rgba(217, 154, 32, 0.5) !important;
    transform: translateY(-2px);
}

.payment-option-card.selected,
.payment-option-card:has(input:checked) {
    border-color: var(--color-luxury-gold) !important;
    box-shadow: 0 0 0 3px rgba(217, 154, 32, 0.15) !important;
    background: rgba(217, 154, 32, 0.04) !important;
}

/* Checkout step headings */
.card h5.fw-bold.border-bottom {
    position: relative;
}

/* ---------------------------------------------------------------
   Checkout — Multi-step Progress Indicator
   Injected by JS above the checkout form
--------------------------------------------------------------- */
.checkout-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.checkout-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-muted);
    position: relative;
}

.checkout-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #E8E8EE;
    color: #7A7A88;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

.checkout-step.active .checkout-step-num {
    background: var(--color-luxury-gold);
    color: var(--color-premium-black);
    box-shadow: 0 0 0 4px rgba(217, 154, 32, 0.2);
}

.checkout-step.done .checkout-step-num {
    background: var(--color-premium-black);
    color: var(--color-champagne-gold);
}

.checkout-step-line {
    width: 48px;
    height: 2px;
    background: #E8E8EE;
    margin: 0 4px;
    flex-shrink: 0;
}

.checkout-step.done + .checkout-step-line,
.checkout-step.active + .checkout-step-line {
    background: rgba(217, 154, 32, 0.4);
}

/* ---------------------------------------------------------------
   Cart Page — Item remove slide-out animation
   JS adds .removing class before removing the DOM node
--------------------------------------------------------------- */
@keyframes slideOutLeft {
    from { opacity: 1; transform: translateX(0) scale(1); max-height: 200px; }
    to   { opacity: 0; transform: translateX(-24px) scale(0.97); max-height: 0; padding: 0; margin: 0; }
}

.cart-item-row.removing,
.cart-mobile-card.removing {
    animation: slideOutLeft 0.35s cubic-bezier(0.4, 0, 1, 1) forwards;
    overflow: hidden;
}

/* Cart page total update flash */
@keyframes totalFlash {
    0%   { color: var(--color-text-primary); }
    30%  { color: var(--color-luxury-gold); }
    100% { color: var(--color-text-primary); }
}

.total-flash {
    animation: totalFlash 0.6s ease;
}

/* ---------------------------------------------------------------
   Product Page — Image hover zoom enhancement
   The main image already has transition in storefront.css.
   This adds a subtle zoom cursor and overflow clip.
--------------------------------------------------------------- */
.main-image-wrap {
    cursor: zoom-in;
    overflow: hidden;
}

.main-image-wrap img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform-origin: center center;
}

.main-image-wrap:hover img {
    transform: scale(1.05);
}

/* Thumbnail strip active state */
.thumb-wrap {
    border-radius: var(--radius-sm) !important;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.thumb-wrap:hover {
    transform: translateY(-2px);
    border-color: rgba(217, 154, 32, 0.6) !important;
}

.thumb-wrap.active-thumb {
    border-color: var(--color-luxury-gold) !important;
    box-shadow: 0 0 0 2px rgba(217, 154, 32, 0.3);
}

/* Variant swatch hover */
.btn-check:checked + .btn-outline-dark {
    background: var(--color-premium-black);
    color: var(--color-champagne-gold);
    border-color: var(--color-premium-black);
    box-shadow: 0 0 0 3px rgba(217, 154, 32, 0.25);
}

/* Mobile sticky buy bar — slide up entrance */
.sticky-bottom-buy-bar {
    display: none;
    position: fixed;
    bottom: 60px; /* above mobile nav */
    left: 0;
    right: 0;
    z-index: 1025;
    background: var(--color-premium-black);
    border-top: 1px solid rgba(217, 154, 32, 0.3);
    padding: 0.6rem 1rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    animation: slideUpBar 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideUpBar {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.product-bar-name {
    font-size: 0.82rem;
    color: #E2E2EA;
    font-weight: 600;
    max-width: 160px;
}

.product-bar-price {
    color: var(--color-champagne-gold);
}

@media (min-width: 768px) {
    .sticky-bottom-buy-bar { display: none !important; }
}

/* ---------------------------------------------------------------
   Product page tabs — animated underline indicator
--------------------------------------------------------------- */
#prodTabs .nav-link {
    position: relative;
    transition: color 0.2s ease;
    border-bottom: 3px solid transparent !important;
}

#prodTabs .nav-link.active {
    color: var(--color-premium-black) !important;
    border-bottom-color: var(--color-luxury-gold) !important;
}

#prodTabs .nav-link:hover:not(.active) {
    color: var(--color-luxury-gold) !important;
}

/* ---------------------------------------------------------------
   prefers-reduced-motion — Phase 6 additions
--------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .confetti-piece            { animation: none; opacity: 0; }
    .payment-option-card:hover { transform: none; }
    .cart-item-row.removing,
    .cart-mobile-card.removing { animation: none; opacity: 0; }
    .main-image-wrap:hover img { transform: none; }
    .thumb-wrap:hover          { transform: none; }
    .sticky-bottom-buy-bar     { animation: none; }
}

/* ===================================================================
   Phase 7 — Performance & Accessibility
   =================================================================== */

/* ---------------------------------------------------------------
   will-change — Only on actively animated elements
   Tells the browser to promote these to their own compositor layer.
   Applied sparingly to avoid excessive memory use.
--------------------------------------------------------------- */
/* hero-slide-item: will-change removed — parallax disabled on slides */

.ao.ao--fade-up,
.ao.ao--fade-in,
.ao.ao--fade-left,
.ao.ao--fade-right,
.ao.ao--scale-up {
    will-change: opacity, transform;
}

/* Remove will-change after animation completes (handled by JS) */
.ao.ao--visible {
    will-change: auto;
}


/* ---------------------------------------------------------------
   Skip to Content Link (Accessibility)
   Visually hidden until focused via keyboard — appears at top-left.
--------------------------------------------------------------- */
.skip-to-content {
    position: fixed;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    background: var(--color-premium-black);
    color: var(--color-champagne-gold);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.65rem 1.2rem;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border: 2px solid var(--color-luxury-gold);
    text-decoration: none;
    transition: top 0.2s ease;
    outline: none;
}

.skip-to-content:focus {
    top: 0;
    outline: 3px solid var(--color-champagne-gold);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------
   Focus Indicators — Globally visible for keyboard navigation
   Overrides browser defaults with a consistent gold ring.
--------------------------------------------------------------- */
:focus-visible {
    outline: 2px solid var(--color-luxury-gold) !important;
    outline-offset: 3px !important;
}

/* Suppress focus ring on mouse click (only show on keyboard nav) */
:focus:not(:focus-visible) {
    outline: none !important;
}

/* Buttons need a slightly larger offset */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--color-luxury-gold) !important;
    outline-offset: 3px !important;
    border-radius: 3px;
}

/* ---------------------------------------------------------------
   Toast — aria-live region (screen reader support)
   The toast container gets role="status" and aria-live="polite"
   added by JS. CSS ensures it has correct visual stacking.
--------------------------------------------------------------- */
#nabilhut-toast-container[aria-live] {
    /* Already styled in storefront.js — this just ensures
       the live region is not clipped */
    clip: unset;
    overflow: visible;
}

/* ---------------------------------------------------------------
   Image lazy-load fade-in — DISABLED
   Removed to prevent images appearing blank before JS runs.
   Images load and display normally without opacity manipulation.
--------------------------------------------------------------- */

/* Prevent layout shift — images without explicit dimensions */
img {
    max-width: 100%;
    height: auto;
}

/* ---------------------------------------------------------------
   font-display: swap equivalent for @import
   Already handled in master.php via media="print" async trick.
   This ensures no invisible text during font load (FOIT).
--------------------------------------------------------------- */
body {
    font-display: swap;  /* informational — actual swap is in @import URL param */
}

/* ---------------------------------------------------------------
   Reduced data / slow connection — disable heavy effects
--------------------------------------------------------------- */
@media (prefers-reduced-data: reduce) {
    .product-card::before          { display: none; }
    .hero-slider-section::before   { display: none; }
}

/* ---------------------------------------------------------------
   High contrast mode support
--------------------------------------------------------------- */
@media (forced-colors: active) {
    .btn-gold,
    .btn-outline-gold {
        border: 2px solid ButtonText;
    }

    .header-badge {
        forced-color-adjust: none;
    }

    .section-heading-animated::after {
        background: Highlight;
    }
}

/* ---------------------------------------------------------------
   Print styles — clean printable invoice/order pages
--------------------------------------------------------------- */
@media print {
    /* Hide all interactive / decorative elements */
    .store-header,
    .main-nav,
    .announcement-bar,
    .store-footer,
    .footer-bottom,
    .mobile-bottom-nav,
    .floating-contact-widget,
    #scroll-to-top,
    .sticky-bottom-buy-bar,
    .btn-wishlist-corner,
    .product-quick-actions,
    .nhut-flash,
    #nabilhut-toast-container {
        display: none !important;
    }

    /* Ensure full-width single-column layout */
    .container,
    .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    /* Remove shadows and gradients */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Clean link display */
    a[href]::after {
        content: none !important;
    }

    /* Page breaks */
    .card {
        break-inside: avoid;
    }

    /* Ensure black text for readability */
    body {
        color: #000 !important;
        background: #fff !important;
    }
}

/* ---------------------------------------------------------------
   Final prefers-reduced-motion — master override
   This is the definitive catch-all placed at the end of the file
   to ensure ALL phase animations are properly disabled.
--------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    /* Kill all transitions */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Keep will-change reset */
    .ao.ao--visible {
        will-change: auto !important;
    }
}
