/* ============================================================
   UX ENHANCEMENTS v2 — Premium Polish Layer
   Apple / Stripe / Shopify caliber motion & feedback
   
   Design Principles:
   1. Every transition uses the SAME easing curve
   2. Shadows are soft, layered, and subtle
   3. Animations are GPU-accelerated (transform/opacity only)
   4. Nothing is abrupt — everything interpolates
   5. Consistent 4px spacing rhythm
   ============================================================ */

/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════ */
:root {
    /* Timing — One curve to rule them all */
    --ux-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ux-ease-out: cubic-bezier(0.0, 0, 0.2, 1);
    --ux-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ux-duration-fast: 0.15s;
    --ux-duration: 0.25s;
    --ux-duration-slow: 0.4s;
    --ux-duration-reveal: 0.6s;

    /* Colors — Carefully curated palette */
    --ux-primary: #14532d;
    --ux-primary-rgb: 20, 83, 45;
    --ux-primary-light: rgba(20, 83, 45, 0.08);
    --ux-primary-glow: rgba(20, 83, 45, 0.15);
    --ux-accent: #22c55e;
    --ux-accent-rgb: 34, 197, 94;

    --ux-success: #059669;
    --ux-success-bg: #ecfdf5;
    --ux-error: #dc2626;
    --ux-error-bg: #fef2f2;
    --ux-warning: #d97706;
    --ux-warning-bg: #fffbeb;
    --ux-info: #2563eb;
    --ux-info-bg: #eff6ff;

    /* Shadows — Soft, layered, natural */
    --ux-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
    --ux-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --ux-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --ux-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --ux-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.07), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --ux-shadow-float: 0 25px 50px -12px rgba(0, 0, 0, 0.10);

    /* Radius */
    --ux-radius-sm: 8px;
    --ux-radius: 12px;
    --ux-radius-lg: 16px;
    --ux-radius-xl: 20px;
}


/* ═══════════════════════════════════════════════════════════════
   1. GLOBAL SMOOTHNESS — Base layer
   ═══════════════════════════════════════════════════════════════ */

/* Smooth scroll for everything */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* GPU-hint for animated elements */
.reveal,
.ux-card,
.ux-toast,
.fly-ghost {
    will-change: transform, opacity;
}

/* Better line height for readability */
body {
    line-height: 1.6;
    letter-spacing: -0.01em;
}

/* Selection color */
::selection {
    background: rgba(var(--ux-primary-rgb), 0.12);
    color: var(--ux-primary);
}


/* ═══════════════════════════════════════════════════════════════
   2. SCROLL PROGRESS BAR
   ═══════════════════════════════════════════════════════════════ */
#ux-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, var(--ux-primary), var(--ux-accent));
    z-index: 9999;
    pointer-events: none;
    transition: none;
    /* Must be instant for smooth tracking */
    opacity: 0.85;
}


/* ═══════════════════════════════════════════════════════════════
   3. BUTTON MICRO-INTERACTIONS — Soft, satisfying, consistent
   ═══════════════════════════════════════════════════════════════ */

button:not(.no-ux),
a[class*="bg-"]:not(.no-ux),
input[type="submit"]:not(.no-ux) {
    transition: transform var(--ux-duration-fast) var(--ux-ease),
        box-shadow var(--ux-duration) var(--ux-ease),
        background-color var(--ux-duration) var(--ux-ease),
        border-color var(--ux-duration) var(--ux-ease),
        opacity var(--ux-duration) var(--ux-ease);
    position: relative;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Hover: subtle lift + soft glow (not harsh shadow) */
button:not(.no-ux):hover:not(:disabled),
a[class*="bg-"]:not(.no-ux):hover,
input[type="submit"]:not(.no-ux):hover:not(:disabled) {
    transform: translateY(-1px) scale(1.005);
    box-shadow: var(--ux-shadow-md);
}

/* Press: satisfying click feel */
button:not(.no-ux):active:not(:disabled),
a[class*="bg-"]:not(.no-ux):active,
input[type="submit"]:not(.no-ux):active:not(:disabled) {
    transform: scale(0.97);
    box-shadow: var(--ux-shadow-xs);
    transition-duration: 0.08s;
}

/* Disabled: muted, no movement */
button:disabled,
input[type="submit"]:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    filter: grayscale(0.1);
}

/* Button loading state */
.ux-btn-loading {
    pointer-events: none;
    opacity: 0.75;
}

/* Spinner */
.ux-spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-right-color: currentColor;
    border-radius: 50%;
    animation: ux-spin 0.55s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
    flex-shrink: 0;
}

.ux-btn-loading .ux-spinner {
    display: inline-block;
}

@keyframes ux-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Ripple — subtle white glow on click */
.ux-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 70%);
    transform: scale(0);
    animation: ux-ripple-anim 0.5s var(--ux-ease-out);
    pointer-events: none;
}

@keyframes ux-ripple-anim {
    to {
        transform: scale(3.5);
        opacity: 0;
    }
}


/* ═══════════════════════════════════════════════════════════════
   4. CARD DEPTH & LIFT — Layered, natural
   ═══════════════════════════════════════════════════════════════ */
.ux-card {
    transition: transform var(--ux-duration) var(--ux-ease),
        box-shadow var(--ux-duration-slow) var(--ux-ease);
    backface-visibility: hidden;
}

.ux-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ux-shadow-lg);
}

.ux-card:active {
    transform: translateY(0);
    box-shadow: var(--ux-shadow-sm);
    transition-duration: 0.1s;
}

/* Elevated card variant — for primary cards */
.ux-card-elevated {
    box-shadow: var(--ux-shadow-md);
}

.ux-card-elevated:hover {
    box-shadow: var(--ux-shadow-xl);
    transform: translateY(-3px);
}


/* ═══════════════════════════════════════════════════════════════
   5. TOAST NOTIFICATIONS — Glassmorphism, smooth entry
   ═══════════════════════════════════════════════════════════════ */
#ux-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 380px;
}

.ux-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--ux-radius-lg);
    box-shadow: var(--ux-shadow-xl), 0 0 0 1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transform: translateX(110%) scale(0.95);
    opacity: 0;
    transition: transform var(--ux-duration-slow) var(--ux-ease-spring),
        opacity var(--ux-duration) var(--ux-ease);
    pointer-events: auto;
    min-width: 280px;
    position: relative;
    overflow: hidden;
}

.ux-toast.ux-toast-visible {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.ux-toast.ux-toast-exit {
    transform: translateX(110%) scale(0.95);
    opacity: 0;
    transition: transform 0.3s var(--ux-ease),
        opacity 0.2s var(--ux-ease);
}

.ux-toast-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--ux-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ux-toast-success .ux-toast-icon {
    background: var(--ux-success-bg);
    color: var(--ux-success);
}

.ux-toast-error .ux-toast-icon {
    background: var(--ux-error-bg);
    color: var(--ux-error);
}

.ux-toast-warning .ux-toast-icon {
    background: var(--ux-warning-bg);
    color: var(--ux-warning);
}

.ux-toast-info .ux-toast-icon {
    background: var(--ux-info-bg);
    color: var(--ux-info);
}

.ux-toast-content {
    flex: 1;
    min-width: 0;
}

.ux-toast-title {
    font-weight: 700;
    font-size: 13px;
    color: #0f172a;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.ux-toast-message {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 1px;
    line-height: 1.4;
}

.ux-toast-close {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #cbd5e1;
    flex-shrink: 0;
    transition: all var(--ux-duration-fast) var(--ux-ease);
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    line-height: 1;
}

.ux-toast-close:hover {
    background: #f1f5f9;
    color: #475569;
    transform: none !important;
    box-shadow: none !important;
}

/* Progress bar */
.ux-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    overflow: hidden;
}

.ux-toast-progress-bar {
    height: 100%;
    animation: ux-toast-countdown linear forwards;
    border-radius: 0 0 var(--ux-radius-lg) var(--ux-radius-lg);
}

.ux-toast-success .ux-toast-progress-bar {
    background: var(--ux-success);
}

.ux-toast-error .ux-toast-progress-bar {
    background: var(--ux-error);
}

.ux-toast-warning .ux-toast-progress-bar {
    background: var(--ux-warning);
}

.ux-toast-info .ux-toast-progress-bar {
    background: var(--ux-info);
}

@keyframes ux-toast-countdown {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}


/* ═══════════════════════════════════════════════════════════════
   6. SKELETON / SHIMMER — Perceived performance
   ═══════════════════════════════════════════════════════════════ */
.ux-skeleton {
    background: linear-gradient(110deg,
            #f1f5f9 30%,
            #e8ecf1 48%,
            #f1f5f9 66%);
    background-size: 300% 100%;
    animation: ux-shimmer 1.8s var(--ux-ease) infinite;
    border-radius: var(--ux-radius-sm);
    color: transparent !important;
    pointer-events: none;
    user-select: none;
}

.ux-skeleton * {
    visibility: hidden;
}

@keyframes ux-shimmer {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.ux-skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 6px;
}

.ux-skeleton-title {
    height: 22px;
    width: 60%;
    margin-bottom: 12px;
    border-radius: 6px;
}

.ux-skeleton-circle {
    border-radius: 50%;
}

.ux-skeleton-card {
    height: 200px;
    border-radius: var(--ux-radius);
}


/* ═══════════════════════════════════════════════════════════════
   7. STATUS BADGES — Semantic, consistent
   ═══════════════════════════════════════════════════════════════ */
.ux-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 20px;
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1.5;
    transition: all var(--ux-duration-fast) var(--ux-ease);
}

.ux-badge-pending {
    background: #fefce8;
    color: #a16207;
    border-color: #fde047;
}

.ux-badge-processing {
    background: #fffbeb;
    color: #b45309;
    border-color: #fcd34d;
}

.ux-badge-shipped {
    background: #eef2ff;
    color: #4338ca;
    border-color: #a5b4fc;
}

.ux-badge-in-transit,
.ux-badge-in_transit {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #93c5fd;
}

.ux-badge-delivered {
    background: #ecfdf5;
    color: #047857;
    border-color: #6ee7b7;
}

.ux-badge-cancelled {
    background: #f8fafc;
    color: #475569;
    border-color: #cbd5e1;
}

.ux-badge-paid {
    background: #ecfdf5;
    color: #047857;
    border-color: #6ee7b7;
}

.ux-badge-rejected {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.ux-badge-approved {
    background: #ecfdf5;
    color: #047857;
    border-color: #6ee7b7;
}

.ux-badge-under-review,
.ux-badge-under_review {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #93c5fd;
}

.ux-badge-awaiting-images,
.ux-badge-awaiting_images {
    background: #f5f3ff;
    color: #6d28d9;
    border-color: #c4b5fd;
}


/* ═══════════════════════════════════════════════════════════════
   8. PULSE / LIVE INDICATOR
   ═══════════════════════════════════════════════════════════════ */
.ux-pulse {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ux-success);
    position: relative;
    flex-shrink: 0;
}

.ux-pulse::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--ux-success);
    animation: ux-pulse-ring 2s var(--ux-ease-out) infinite;
    opacity: 0;
}

@keyframes ux-pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

.ux-pulse-amber {
    background: var(--ux-warning);
}

.ux-pulse-amber::before {
    background: var(--ux-warning);
}

.ux-pulse-blue {
    background: var(--ux-info);
}

.ux-pulse-blue::before {
    background: var(--ux-info);
}


/* ═══════════════════════════════════════════════════════════════
   9. FORM INPUT FOCUS — Soft glow, not harsh ring
   ═══════════════════════════════════════════════════════════════ */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]),
select,
textarea {
    transition: border-color var(--ux-duration) var(--ux-ease),
        box-shadow var(--ux-duration) var(--ux-ease),
        background-color var(--ux-duration) var(--ux-ease) !important;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):focus,
select:focus,
textarea:focus {
    border-color: rgba(var(--ux-primary-rgb), 0.4) !important;
    box-shadow: 0 0 0 3px var(--ux-primary-light),
        0 1px 2px rgba(0, 0, 0, 0.04) !important;
    background-color: #fff !important;
    outline: none !important;
}

/* Validation states */
.ux-valid {
    border-color: rgba(5, 150, 105, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.06) !important;
}

.ux-invalid {
    border-color: rgba(220, 38, 38, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.06) !important;
}

/* Error shake — subtle, not jarring */
@keyframes ux-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-4px);
    }

    40% {
        transform: translateX(4px);
    }

    60% {
        transform: translateX(-3px);
    }

    80% {
        transform: translateX(2px);
    }
}

.ux-shake {
    animation: ux-shake 0.4s var(--ux-ease);
}

/* Floating label support */
.ux-float-label {
    position: relative;
}

.ux-float-label label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #94a3b8;
    pointer-events: none;
    transition: all var(--ux-duration) var(--ux-ease);
    background: transparent;
    padding: 0 4px;
}

.ux-float-label input:focus~label,
.ux-float-label input:not(:placeholder-shown)~label,
.ux-float-label textarea:focus~label,
.ux-float-label textarea:not(:placeholder-shown)~label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    color: var(--ux-primary);
    font-weight: 600;
    background: white;
}


/* ═══════════════════════════════════════════════════════════════
   10. PAGE TRANSITIONS — Smooth fade + slide
   ═══════════════════════════════════════════════════════════════ */
body {
    animation: ux-pageEnter var(--ux-duration-slow) var(--ux-ease-out) both !important;
}

body.ux-leaving {
    animation: ux-pageLeave 0.2s var(--ux-ease) forwards !important;
}

@keyframes ux-pageEnter {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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

@keyframes ux-pageLeave {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-3px);
    }
}


/* ═══════════════════════════════════════════════════════════════
   11. NAVIGATION STATES
   ═══════════════════════════════════════════════════════════════ */
.ux-nav-active {
    color: var(--ux-primary) !important;
    position: relative;
}

.ux-nav-active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 2px;
    background: var(--ux-primary);
    border-radius: 2px;
    animation: ux-navIndicator 0.3s var(--ux-ease-spring) both;
}

@keyframes ux-navIndicator {
    from {
        width: 0;
        opacity: 0;
    }

    to {
        width: 14px;
        opacity: 1;
    }
}

/* Hover underline — grows from center */
header nav a:not(.ux-nav-active) {
    position: relative;
}

header nav a:not(.ux-nav-active)::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--ux-primary);
    border-radius: 2px;
    transition: all var(--ux-duration) var(--ux-ease);
    transform: translateX(-50%);
}

header nav a:not(.ux-nav-active):hover::after {
    width: 14px;
}


/* ═══════════════════════════════════════════════════════════════
   12. LAST UPDATED / META LABELS
   ═══════════════════════════════════════════════════════════════ */
.ux-last-updated {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    padding: 4px 10px;
    background: #f8fafc;
    border-radius: var(--ux-radius-sm);
    border: 1px solid #e2e8f0;
    transition: all var(--ux-duration) var(--ux-ease);
}


/* ═══════════════════════════════════════════════════════════════
   13. COUNT-UP & CELEBRATION
   ═══════════════════════════════════════════════════════════════ */
.ux-count-up {
    display: inline-block;
    transition: all 0.3s var(--ux-ease);
}

@keyframes ux-celebration-bounce {

    0%,
    100% {
        transform: scale(1);
    }

    20% {
        transform: scale(1.12);
    }

    45% {
        transform: scale(0.96);
    }

    70% {
        transform: scale(1.04);
    }
}

.ux-celebrate {
    animation: ux-celebration-bounce 0.7s var(--ux-ease-out);
}

@keyframes ux-checkmark-draw {
    to {
        stroke-dashoffset: 0;
    }
}

.ux-checkmark-circle {
    animation: ux-pageEnter 0.3s var(--ux-ease) forwards;
}

.ux-checkmark-check {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: ux-checkmark-draw 0.5s 0.3s var(--ux-ease) forwards;
}


/* ═══════════════════════════════════════════════════════════════
   14. ORDER TIMELINE
   ═══════════════════════════════════════════════════════════════ */
.ux-order-timeline {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px 0;
}

.ux-timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    position: relative;
}

.ux-timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
    transition: background var(--ux-duration-slow) var(--ux-ease);
}

.ux-timeline-step.ux-step-done:not(:last-child)::after {
    background: var(--ux-success);
}

.ux-timeline-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    font-size: 11px;
    color: #94a3b8;
    border: 2px solid #e2e8f0;
    transition: all var(--ux-duration-slow) var(--ux-ease);
}

.ux-step-done .ux-timeline-dot {
    background: var(--ux-success);
    border-color: var(--ux-success);
    color: white;
}

.ux-step-active .ux-timeline-dot {
    background: white;
    border-color: var(--ux-info);
    color: var(--ux-info);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.ux-timeline-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    text-align: center;
    margin-top: 2px;
}

.ux-step-done .ux-timeline-label {
    color: var(--ux-success);
}

.ux-step-active .ux-timeline-label {
    color: var(--ux-info);
    font-weight: 800;
}


/* ═══════════════════════════════════════════════════════════════
   15. ALERT SYSTEM — Replaces raw <p> errors
   ═══════════════════════════════════════════════════════════════ */
.ux-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--ux-radius);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    animation: ux-alertEnter 0.35s var(--ux-ease-out) both;
}

@keyframes ux-alertEnter {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ux-alert-error {
    background: var(--ux-error-bg);
    color: var(--ux-error);
    border-color: #fecaca;
}

.ux-alert-success {
    background: var(--ux-success-bg);
    color: var(--ux-success);
    border-color: #a7f3d0;
}

.ux-alert-warning {
    background: var(--ux-warning-bg);
    color: var(--ux-warning);
    border-color: #fde68a;
}

.ux-alert-info {
    background: var(--ux-info-bg);
    color: var(--ux-info);
    border-color: #bfdbfe;
}

.ux-alert i,
.ux-alert svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}


/* ═══════════════════════════════════════════════════════════════
   16. WELCOME BANNER
   ═══════════════════════════════════════════════════════════════ */
.ux-welcome-banner {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f0fdfa 100%);
    border: 1px solid rgba(187, 247, 208, 0.6);
    border-radius: var(--ux-radius-lg);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: ux-pageEnter 0.5s var(--ux-ease-out) both;
}

.ux-welcome-banner .ux-welcome-wave {
    display: inline-block;
    animation: ux-wave 1.8s var(--ux-ease) 0.4s 2;
    transform-origin: 70% 70%;
}

@keyframes ux-wave {
    0% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(14deg);
    }

    20% {
        transform: rotate(-8deg);
    }

    30% {
        transform: rotate(14deg);
    }

    40% {
        transform: rotate(-4deg);
    }

    50% {
        transform: rotate(10deg);
    }

    60%,
    100% {
        transform: rotate(0deg);
    }
}


/* ═══════════════════════════════════════════════════════════════
   17. TABLE & LIST ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════ */
tbody tr {
    transition: background-color var(--ux-duration-fast) var(--ux-ease);
}

/* Sidebar nav slide */
aside nav a,
aside .space-y-1 a {
    transition: all var(--ux-duration) var(--ux-ease) !important;
}

aside nav a:hover,
aside .space-y-1 a:hover {
    transform: translateX(2px);
}


/* ═══════════════════════════════════════════════════════════════
   18. SCROLLBAR — Minimal, elegant
   ═══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}


/* ═══════════════════════════════════════════════════════════════
   19. STAGGER ANIMATION SYSTEM — Lists animate sequentially
   ═══════════════════════════════════════════════════════════════ */
.ux-stagger>* {
    animation: ux-staggerIn var(--ux-duration-reveal) var(--ux-ease-out) both;
}

.ux-stagger>*:nth-child(1) {
    animation-delay: 0.04s;
}

.ux-stagger>*:nth-child(2) {
    animation-delay: 0.08s;
}

.ux-stagger>*:nth-child(3) {
    animation-delay: 0.12s;
}

.ux-stagger>*:nth-child(4) {
    animation-delay: 0.16s;
}

.ux-stagger>*:nth-child(5) {
    animation-delay: 0.20s;
}

.ux-stagger>*:nth-child(6) {
    animation-delay: 0.24s;
}

.ux-stagger>*:nth-child(7) {
    animation-delay: 0.28s;
}

.ux-stagger>*:nth-child(8) {
    animation-delay: 0.32s;
}

.ux-stagger>*:nth-child(9) {
    animation-delay: 0.36s;
}

.ux-stagger>*:nth-child(10) {
    animation-delay: 0.40s;
}

.ux-stagger>*:nth-child(n+11) {
    animation-delay: 0.44s;
}

@keyframes ux-staggerIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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


/* ═══════════════════════════════════════════════════════════════
   20. IMAGE LOADING — Smooth appearance
   ═══════════════════════════════════════════════════════════════ */
img {
    transition: opacity var(--ux-duration-slow) var(--ux-ease);
}

img.ux-img-loaded {
    opacity: 1;
}


/* ═══════════════════════════════════════════════════════════════
   21. EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */
.ux-empty-state {
    text-align: center;
    padding: 48px 24px;
    animation: ux-pageEnter 0.5s var(--ux-ease-out) both;
}

.ux-empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--ux-radius-lg);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #cbd5e1;
}


/* ═══════════════════════════════════════════════════════════════
   22. RESPONSIVE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    #ux-toast-container {
        top: auto;
        bottom: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .ux-toast {
        min-width: auto;
    }

    /* Reduce motion for mobile */
    .ux-card:hover {
        transform: translateY(-1px);
    }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    body {
        animation: none !important;
    }
}


/* ═══════════════════════════════════════════════════════════════
   23. PRINT — Hide overlays
   ═══════════════════════════════════════════════════════════════ */
@media print {

    #ux-scroll-progress,
    #ux-toast-container,
    .ux-pulse::before {
        display: none !important;
    }
}


/* ═══════════════════════════════════════════════════════════════
   24. FOCUS-VISIBLE — Keyboard accessibility
   ═══════════════════════════════════════════════════════════════ */
:focus-visible {
    outline: 2px solid rgba(var(--ux-primary-rgb), 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}

/* ═══════════════════════════════════════════════════════════════
   25. BEST SELLERS CAROUSEL
   ═══════════════════════════════════════════════════════════════ */

/* Hide scrollbar across browsers */
.bs-carousel::-webkit-scrollbar {
    display: none;
}

.bs-carousel {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ── Card Structure — Perfect Alignment ── */
.bs-card {
    flex: 0 0 280px;
    max-width: 280px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    border: 1px solid #f1f5f9;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;

    /* Smooth, Apple-quality hover easing */
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
}

/* Hover: subtle lift + layered shadow — NOT harsh */
.bs-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.06),
        0 16px 40px -8px rgba(0, 0, 0, 0.08);
    border-color: rgba(var(--ux-primary-rgb), 0.12);
}

/* ── Fixed-height Image Container ── */
.bs-card .bs-img-wrap {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
    overflow: hidden;
}

.bs-card .bs-img-wrap img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.bs-card:hover .bs-img-wrap img {
    transform: scale(1.08);
}

/* ── Content Section — Fill remaining space ── */
.bs-card .bs-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 20px 20px;
}

/* Category label — fixed height row */
.bs-card .bs-category {
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 6px;
    line-height: 1;
}

/* Title — fixed 2 lines, always same height */
.bs-card .bs-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
    min-height: 36px;
    /* exactly 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

/* Social proof — fixed height slot */
.bs-card .bs-social-proof {
    height: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

/* ── Pricing & Button — Pinned to bottom ── */
.bs-card .bs-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.bs-card .bs-price {
    font-size: 20px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.bs-card .bs-vat {
    font-size: 8px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.bs-card .bs-unit-price {
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
}

/* ── Action Button — Smooth, consistent ── */
.bs-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 0;
    background: #0f172a;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.15);
}

.bs-action-btn:hover {
    background: var(--ux-accent, #22c55e);
    color: #0f172a;
    transform: scale(1.02);
    box-shadow: 0 4px 15px -3px rgba(var(--ux-primary-rgb), 0.25);
}

.bs-action-btn:active {
    transform: scale(0.97);
    transition-duration: 0.08s;
}

/* ── Quick View Overlay ── */
.bs-card .bs-quick-view {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.bs-card:hover .bs-quick-view {
    background: rgba(15, 23, 42, 0.04);
}

.bs-card .bs-quick-view span {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    color: #0f172a;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 8px;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f5f9;
}

.bs-card:hover .bs-quick-view span {
    opacity: 1;
    transform: translateY(0);
}

/* ── Badges ── */
.bs-card .bs-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.bs-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 8px;
    box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.08);
}

.bs-badge-top {
    background: #fbbf24;
    color: #78350f;
}

.bs-badge-pack {
    background: rgba(15, 23, 42, 0.88);
    color: #fff;
    backdrop-filter: blur(4px);
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Responsive Sizing ── */
@media (min-width: 768px) {
    .bs-card {
        flex: 0 0 300px;
        max-width: 300px;
        min-width: 300px;
    }

    .bs-card .bs-img-wrap {
        height: 220px;
    }
}

@media (min-width: 1280px) {
    .bs-card {
        flex: 0 0 320px;
        max-width: 320px;
        min-width: 320px;
    }

    .bs-card .bs-img-wrap {
        height: 240px;
    }
}

@media (max-width: 640px) {
    .bs-card {
        flex: 0 0 260px;
        max-width: 260px;
        min-width: 260px;
    }

    .bs-card .bs-img-wrap {
        height: 180px;
        padding: 16px;
    }
}


/* ═══════════════════════════════════════════════════════════════
   26. STICKY FOOTER & LAYOUT FIXES
   ═══════════════════════════════════════════════════════════════ */

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Ensure the main content area grows to fill space */
main,
.flex-1,
.flex-grow {
    flex-grow: 1 !important;
}

/* Ensure footer is at the bottom */
footer {
    margin-top: auto;
}