/* Cliprz Storefront V2 — platform-owned visual system. */

:root {
    --sf-content-max: 88rem;
    --sf-section-gap: 4.5rem;
    --sf-grid-desktop: 4;
    --sf-grid-tablet: 3;
    --sf-grid-mobile: 2;
    --sf-image-ratio: 1 / 1;
    --sf-motion-fast: 180ms;
    --sf-motion-normal: 360ms;
    --sf-motion-slow: 650ms;
    --sf-ease: cubic-bezier(.2,.8,.2,1);
    --sf-surface: #fff;
    --sf-surface-muted: color-mix(in srgb, var(--page-bg) 84%, #fff);
    --sf-border: color-mix(in srgb, var(--text-color) 10%, transparent);
    --sf-shadow-sm: 0 8px 24px rgb(15 23 42 / 7%);
    --sf-shadow-md: 0 20px 55px rgb(15 23 42 / 12%);
}

body[data-sf-content-width="contained"] { --sf-content-max: 72rem; }
body[data-sf-content-width="wide"] { --sf-content-max: 88rem; }
body[data-sf-content-width="full"] { --sf-content-max: 100%; }
body[data-sf-section-spacing="compact"] { --sf-section-gap: 2.5rem; }
body[data-sf-section-spacing="comfortable"] { --sf-section-gap: 4.5rem; }
body[data-sf-section-spacing="airy"] { --sf-section-gap: 7rem; }
body[data-sf-image-ratio="portrait"] { --sf-image-ratio: 4 / 5; }
body[data-sf-image-ratio="landscape"] { --sf-image-ratio: 4 / 3; }

.sf-container {
    width: min(100%, var(--sf-content-max));
    margin-inline: auto;
    padding-inline: clamp(1rem, 3vw, 2.25rem);
}

.sf-page-stack {
    display: flex;
    flex-direction: column;
    gap: var(--sf-section-gap);
    padding-block: clamp(1.5rem, 4vw, 4rem);
}

.sf-section {
    position: relative;
}

.sf-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: clamp(1rem, 2vw, 1.75rem);
}

.sf-section-heading h2 {
    margin: 0;
    font-size: clamp(1.4rem, 2.5vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -.025em;
}

.sf-product-grid {
    display: grid;
    grid-template-columns: repeat(var(--sf-grid-mobile), minmax(0, 1fr));
    gap: clamp(.75rem, 1.6vw, 1.4rem);
}

@media (min-width: 768px) {
    .sf-product-grid { grid-template-columns: repeat(var(--sf-grid-tablet), minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    .sf-product-grid { grid-template-columns: repeat(var(--sf-grid-desktop), minmax(0, 1fr)); }
}

.product-card {
    position: relative;
    min-width: 0;
    border-radius: var(--radius-card);
    transition: transform var(--sf-motion-normal) var(--sf-ease), box-shadow var(--sf-motion-normal) var(--sf-ease), border-color var(--sf-motion-fast) ease;
}

.product-card .product-card__image,
.product-card [data-product-image] {
    aspect-ratio: var(--sf-image-ratio);
    object-fit: cover;
    transition: transform var(--sf-motion-slow) var(--sf-ease);
}

body[data-sf-card-style="flat"] .product-card {
    background: transparent;
    box-shadow: none;
    border-color: transparent;
}

body[data-sf-card-style="bordered"] .product-card {
    background: var(--sf-surface);
    border: 1px solid var(--sf-border);
    box-shadow: none;
}

body[data-sf-card-style="elevated"] .product-card {
    background: var(--sf-surface);
    border: 1px solid color-mix(in srgb, var(--sf-border) 65%, transparent);
    box-shadow: var(--sf-shadow-sm);
}

body[data-sf-card-style="glass"] .product-card {
    background: color-mix(in srgb, white 82%, transparent);
    border: 1px solid color-mix(in srgb, white 68%, var(--sf-border));
    box-shadow: var(--sf-shadow-sm);
    backdrop-filter: blur(16px);
}

body[data-sf-card-style="image_first"] .product-card {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

body[data-sf-button-style="pill"] button,
body[data-sf-button-style="pill"] .sf-button { border-radius: 999px !important; }

body[data-sf-button-style="outline"] .sf-primary-action {
    background: transparent !important;
    color: var(--brand-700) !important;
    border: 1px solid var(--brand-600) !important;
}

body[data-sf-button-style="soft"] .sf-primary-action {
    background: var(--brand-50) !important;
    color: var(--brand-700) !important;
}

/* Personality presets intentionally affect rhythm and treatment, not only color. */
body[data-sf-personality="minimal"] {
    --radius-card: 4px;
    --sf-shadow-sm: none;
    --sf-shadow-md: 0 16px 40px rgb(15 23 42 / 7%);
}
body[data-sf-personality="minimal"] .product-card { border-color: transparent; }

body[data-sf-personality="luxury"] {
    --sf-section-gap: max(var(--sf-section-gap), 6rem);
    --sf-shadow-sm: 0 16px 42px rgb(15 23 42 / 8%);
}
body[data-sf-personality="luxury"] .sf-section-heading h2 {
    font-weight: 600;
    letter-spacing: .01em;
}
body[data-sf-personality="luxury"] .product-card .product-card__image,
body[data-sf-personality="luxury"] .product-card [data-product-image] { aspect-ratio: 4 / 5; }

body[data-sf-personality="fashion"] .product-card .product-card__image,
body[data-sf-personality="fashion"] .product-card [data-product-image] { aspect-ratio: 4 / 5; }
body[data-sf-personality="fashion"] .product-card { border-color: transparent; box-shadow: none; }

body[data-sf-personality="electronics"] {
    --radius-card: 10px;
    --sf-section-gap: 3.5rem;
}
body[data-sf-personality="electronics"] .product-card { border: 1px solid var(--sf-border); }

body[data-sf-personality="grocery"] {
    --radius-card: 16px;
    --sf-section-gap: 3rem;
}
body[data-sf-personality="grocery"] .product-card { box-shadow: 0 5px 18px rgb(15 23 42 / 7%); }

/* Slider engine */
.sf-slider {
    position: relative;
    overflow: hidden;
    border-radius: max(var(--radius-card), 12px);
}

.sf-slider__track {
    display: flex;
    transform: translate3d(0,0,0);
    transition: transform var(--sf-slider-speed, 650ms) var(--sf-ease);
    touch-action: pan-y;
    will-change: transform;
}

.sf-slider__slide {
    flex: 0 0 100%;
    min-width: 0;
}

.sf-slider[data-variant="cards"] .sf-slider__slide,
.sf-slider[data-variant="product"] .sf-slider__slide,
.sf-slider[data-variant="category"] .sf-slider__slide,
.sf-slider[data-variant="brand"] .sf-slider__slide {
    flex-basis: min(84%, 22rem);
    padding-inline-end: 1rem;
}

.sf-slider[data-variant="centered_peek"] {
    overflow: visible;
    clip-path: inset(-4rem -8vw);
}
.sf-slider[data-variant="centered_peek"] .sf-slider__slide {
    flex-basis: min(88%, 66rem);
    padding-inline: .5rem;
}

.sf-slider[data-variant="story"] .sf-slider__slide {
    flex-basis: 78%;
    padding-inline-end: .75rem;
}

@media (min-width: 768px) {
    .sf-slider[data-variant="cards"] .sf-slider__slide,
    .sf-slider[data-variant="product"] .sf-slider__slide,
    .sf-slider[data-variant="category"] .sf-slider__slide,
    .sf-slider[data-variant="brand"] .sf-slider__slide { flex-basis: 33.333%; }
    .sf-slider[data-variant="story"] .sf-slider__slide { flex-basis: 32%; }
}

@media (min-width: 1200px) {
    .sf-slider[data-variant="cards"] .sf-slider__slide,
    .sf-slider[data-variant="product"] .sf-slider__slide { flex-basis: 25%; }
    .sf-slider[data-variant="category"] .sf-slider__slide,
    .sf-slider[data-variant="brand"] .sf-slider__slide { flex-basis: 20%; }
}

.sf-slider__controls {
    position: absolute;
    inset-inline: 1rem;
    top: 50%;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    transform: translateY(-50%);
}

.sf-slider__button {
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, white 60%, var(--sf-border));
    border-radius: 999px;
    background: color-mix(in srgb, white 88%, transparent);
    box-shadow: var(--sf-shadow-sm);
    backdrop-filter: blur(12px);
    pointer-events: auto;
    transition: transform var(--sf-motion-fast) ease, background var(--sf-motion-fast) ease;
}
.sf-slider__button:hover { transform: scale(1.06); background: white; }

.sf-slider__dots {
    display: flex;
    justify-content: center;
    gap: .45rem;
    margin-top: 1rem;
}
.sf-slider__dot {
    width: .5rem;
    height: .5rem;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-color) 25%, transparent);
    transition: width var(--sf-motion-fast) ease, background var(--sf-motion-fast) ease;
}
.sf-slider__dot[aria-current="true"] { width: 1.6rem; background: var(--brand-600); }
.sf-slider__progress { height: 3px; background: var(--sf-border); overflow: hidden; margin-top: 1rem; }
.sf-slider__progress > span { display:block; height:100%; background:var(--brand-600); transform-origin: right; }

/* Motion */
body[data-sf-motion="subtle"] .product-card:hover,
body[data-sf-motion="expressive"] .product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sf-shadow-md);
}
body[data-sf-motion="expressive"] .product-card:hover { transform: translateY(-8px) scale(1.012); }
body[data-sf-motion="expressive"] .product-card:hover .product-card__image,
body[data-sf-motion="expressive"] .product-card:hover [data-product-image] { transform: scale(1.045); }

[data-sf-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 600ms var(--sf-ease), transform 600ms var(--sf-ease);
}
[data-sf-reveal].is-visible { opacity: 1; transform: none; }
body[data-sf-motion="off"] [data-sf-reveal] { opacity: 1; transform: none; transition: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    [data-sf-reveal] { opacity: 1 !important; transform: none !important; }
}
