/* ==========================================================================
   Saudi Boutique — Shared Design System
   Palette is intentionally unchanged: brand #006C35 / #004723 / #E6F0EB
   ========================================================================== */

:root {
    --brand: #006C35;
    --brand-dark: #004723;
    --brand-light: #E6F0EB;
    --surface-50: #FDFDFD;
    --surface-100: #F7F7F7;
    --surface-200: #EFEFEF;
    --neutral-800: #1A1A1A;
    --neutral-900: #0F0F0F;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 8rem;
}

body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.font-arabic {
    font-family: 'IBM Plex Sans Arabic', sans-serif !important;
}

[x-cloak] {
    display: none !important;
}

[dir="rtl"] .dir-flip {
    transform: scaleX(-1);
}

.rtl-flip {
    transform: scaleX(-1);
}

/* Scrollbars ------------------------------------------------------------- */

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--surface-100);
}

::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 999px;
    border: 2px solid var(--surface-100);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand);
}

/* Focus visibility (accessibility) --------------------------------------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
    border-radius: 6px;
}

/* --------------------------------------------------------------------------
   Backgrounds / textures
   -------------------------------------------------------------------------- */

.bg-pattern {
    background-image:
        radial-gradient(at 40% 20%, rgba(0, 108, 53, 0.05) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(0, 108, 53, 0.03) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(0, 108, 53, 0.03) 0px, transparent 50%);
}

.luxury-gradient {
    background: linear-gradient(135deg, #FDFDFD 0%, #F4F8F6 100%);
}

.noise-overlay {
    background-image: url('data:image/svg+xml,%3Csvg viewBox=%220 0 200 200%22 xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cfilter id=%22n%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.8%22 numOctaves=%223%22 stitchTiles=%22stitch%22/%3E%3C/filter%3E%3Crect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23n)%22/%3E%3C/svg%3E');
}

.mesh-brand {
    background:
        radial-gradient(at 20% 10%, rgba(0, 108, 53, 0.18) 0px, transparent 55%),
        radial-gradient(at 85% 15%, rgba(0, 71, 35, 0.22) 0px, transparent 50%),
        radial-gradient(at 50% 95%, rgba(0, 108, 53, 0.12) 0px, transparent 55%);
}

/* Glass ------------------------------------------------------------------ */

.glass {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.glass-dark {
    background: rgba(15, 15, 15, 0.55);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
}

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */

@keyframes sb-fade-up {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: none; }
}

@keyframes sb-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes sb-scale-in {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: none; }
}

@keyframes sb-slide-right {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: none; }
}

@keyframes sb-slide-left {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: none; }
}

@keyframes sb-shimmer {
    0%   { background-position: -800px 0; }
    100% { background-position: 800px 0; }
}

@keyframes sb-marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@keyframes sb-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

@keyframes sb-pop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.35); }
    100% { transform: scale(1); }
}

@keyframes sb-ping-ring {
    0%   { transform: scale(0.9); opacity: 0.7; }
    80%, 100% { transform: scale(1.9); opacity: 0; }
}

@keyframes sb-spin {
    to { transform: rotate(360deg); }
}

@keyframes sb-progress {
    from { width: 0%; }
}

@keyframes sb-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(6px); }
}

/* --------------------------------------------------------------------------
   Scroll reveal — driven by js/app.js IntersectionObserver
   -------------------------------------------------------------------------- */

[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.75s var(--ease-out-expo),
        transform 0.75s var(--ease-out-expo);
    will-change: opacity, transform;
}

[data-reveal="left"]  { transform: translateX(-34px); }
[data-reveal="right"] { transform: translateX(34px); }
[data-reveal="scale"] { transform: scale(0.94); }
[data-reveal="fade"]  { transform: none; }

[data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* Stagger children on reveal */
.stagger > * {
    opacity: 0;
    transform: translateY(26px);
    transition:
        opacity 0.65s var(--ease-out-expo),
        transform 0.65s var(--ease-out-expo);
}

.stagger.is-visible > * {
    opacity: 1;
    transform: none;
}

.stagger.is-visible > *:nth-child(1)  { transition-delay: 0.04s; }
.stagger.is-visible > *:nth-child(2)  { transition-delay: 0.09s; }
.stagger.is-visible > *:nth-child(3)  { transition-delay: 0.14s; }
.stagger.is-visible > *:nth-child(4)  { transition-delay: 0.19s; }
.stagger.is-visible > *:nth-child(5)  { transition-delay: 0.24s; }
.stagger.is-visible > *:nth-child(6)  { transition-delay: 0.29s; }
.stagger.is-visible > *:nth-child(7)  { transition-delay: 0.34s; }
.stagger.is-visible > *:nth-child(8)  { transition-delay: 0.39s; }
.stagger.is-visible > *:nth-child(9)  { transition-delay: 0.44s; }
.stagger.is-visible > *:nth-child(10) { transition-delay: 0.49s; }
.stagger.is-visible > *:nth-child(11) { transition-delay: 0.54s; }
.stagger.is-visible > *:nth-child(12) { transition-delay: 0.59s; }

/* Utility animation classes ---------------------------------------------- */

.anim-fade-up   { animation: sb-fade-up 0.8s var(--ease-out-expo) both; }
.anim-fade-in   { animation: sb-fade-in 0.8s ease both; }
.anim-scale-in  { animation: sb-scale-in 0.5s var(--ease-spring) both; }
.anim-slide-in  { animation: sb-slide-right 0.7s var(--ease-out-expo) both; }
.anim-float     { animation: sb-float 6s ease-in-out infinite; }
.anim-bob       { animation: sb-bob 2.4s ease-in-out infinite; }
.anim-pop       { animation: sb-pop 0.4s var(--ease-spring); }
.anim-spin      { animation: sb-spin 1s linear infinite; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.45s; }
.delay-5 { animation-delay: 0.6s; }
.delay-6 { animation-delay: 0.75s; }

/* --------------------------------------------------------------------------
   Components
   -------------------------------------------------------------------------- */

/* Skeleton loading ------------------------------------------------------- */

.skeleton {
    background: linear-gradient(90deg, #EFEFEF 8%, #F7F7F7 18%, #EFEFEF 33%);
    background-size: 800px 100%;
    animation: sb-shimmer 1.4s linear infinite;
    border-radius: 0.75rem;
}

/* Card lift -------------------------------------------------------------- */

.card-lift {
    transition:
        transform 0.45s var(--ease-out-expo),
        box-shadow 0.45s var(--ease-out-expo),
        border-color 0.35s ease;
}

.card-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 22px 50px -14px rgba(0, 0, 0, 0.18);
}

/* Image zoom ------------------------------------------------------------- */

.img-zoom {
    transition: transform 0.9s var(--ease-out-expo);
}

.group:hover .img-zoom {
    transform: scale(1.08);
}

/* Underline sweep -------------------------------------------------------- */

.link-sweep {
    position: relative;
}

.link-sweep::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 2px;
    background: var(--brand);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s var(--ease-out-expo);
}

.link-sweep:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Shine sweep across a button/card --------------------------------------- */

.shine {
    position: relative;
    overflow: hidden;
}

.shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.75s var(--ease-out-expo);
}

.shine:hover::before {
    left: 140%;
}

/* Live pulse dot --------------------------------------------------------- */

.pulse-dot {
    position: relative;
    display: inline-flex;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: currentColor;
    animation: sb-ping-ring 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Marquee ---------------------------------------------------------------- */

.marquee {
    display: flex;
    width: max-content;
    animation: sb-marquee 38s linear infinite;
}

.marquee-slow {
    animation-duration: 60s;
}

.marquee:hover {
    animation-play-state: paused;
}

.marquee-mask {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

/* Scroll progress bar ---------------------------------------------------- */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--brand-dark));
    z-index: 100;
    transition: width 0.1s linear;
}

/* Rating stars ----------------------------------------------------------- */

.star-track {
    position: relative;
    display: inline-block;
    color: #E2E2E2;
    letter-spacing: 2px;
}

.star-fill {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    white-space: nowrap;
    color: #E8A020;
}

[dir="rtl"] .star-fill {
    left: auto;
    right: 0;
}

/* Line clamp helpers ----------------------------------------------------- */

.line-clamp-1,
.line-clamp-2,
.line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-1 { -webkit-line-clamp: 1; }
.line-clamp-2 { -webkit-line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; }

/* Aspect-safe media ------------------------------------------------------ */

.media-fallback {
    background:
        linear-gradient(135deg, var(--brand-light) 0%, #F7F7F7 100%);
}

/* Range slider ----------------------------------------------------------- */

input[type="range"].sb-range {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 999px;
    background: var(--surface-200);
    outline: none;
}

input[type="range"].sb-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--brand);
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 108, 53, 0.4);
    cursor: pointer;
    transition: transform 0.2s var(--ease-spring);
}

input[type="range"].sb-range::-webkit-slider-thumb:hover {
    transform: scale(1.18);
}

input[type="range"].sb-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--brand);
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 108, 53, 0.4);
    cursor: pointer;
}

/* Toast stack ------------------------------------------------------------ */

.toast-enter {
    animation: sb-scale-in 0.35s var(--ease-spring) both;
}

/* Tab underline ---------------------------------------------------------- */

.tab-underline {
    position: relative;
    transition: color 0.3s ease;
}

.tab-underline::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--brand);
    transform: scaleX(0);
    transition: transform 0.4s var(--ease-out-expo);
}

.tab-underline.is-active::after {
    transform: scaleX(1);
}

/* Count-up numbers ------------------------------------------------------- */

.tabular {
    font-variant-numeric: tabular-nums;
}

/* Reduced motion --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    [data-reveal],
    .stagger > * {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Print ------------------------------------------------------------------ */

@media print {
    header, footer, .no-print { display: none !important; }
}
