/* ============================================================
   Global Leather — ULTRA 3D layer
   3D tilt + glare, magnetic buttons, scroll progress stitch,
   3D swatch ring, exploding jacket layers, 3D reveals.
   All motion is disabled for prefers-reduced-motion.
   ============================================================ */

/* ── Scroll progress: a stitched seam across the top ─────────── */
.ux-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2000; pointer-events: none;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
    transform-origin: 0 50%; transform: scaleX(var(--p, 0));
    box-shadow: 0 0 12px rgba(230,189,140,.6);
}
.ux-progress::after {
    content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 0;
    border-top: 1.5px dashed rgba(230,189,140,.55);
}

/* ── 3D reveal (upgrade of .reveal) ──────────────────────────── */
.ux-3d .reveal { transform: perspective(900px) translateY(40px) rotateX(14deg); transform-origin: 50% 100%; transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.ux-3d .reveal.revealed { transform: perspective(900px) translateY(0) rotateX(0); }

/* ── Tilt cards with light glare ─────────────────────────────── */
.ux-tilt { transform-style: preserve-3d; will-change: transform; transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .5s; }
.ux-tilt.is-tilting { transition: transform .08s linear, box-shadow .3s; }
.ux-tilt .ux-glare {
    position: absolute; inset: 0; z-index: 5; pointer-events: none; border-radius: inherit;
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,236,210,.28), transparent 55%);
    opacity: 0; transition: opacity .35s; mix-blend-mode: soft-light;
}
.ux-tilt.is-tilting .ux-glare { opacity: 1; }
.product-card.ux-tilt { position: relative; }
.product-card.ux-tilt:hover { transform: none; }
.product-card.ux-tilt .product-card-img img { transform: translateZ(40px) scale(.94); }
.product-card.ux-tilt.is-tilting .product-card-img img { transform: translateZ(60px) scale(.98); }
.product-card.ux-tilt .product-card-body { transform: translateZ(25px); }
.product-card.ux-tilt.is-tilting { box-shadow: 0 30px 60px -20px rgba(0,0,0,.75), 0 0 0 1px rgba(201,141,85,.45); }

/* Category rings become 3D leather medallions */
.category-card { perspective: 700px; }
.category-card-ring { transition: transform .8s cubic-bezier(.2,.7,.2,1), box-shadow .5s; transform-style: preserve-3d; position: relative; }
.category-card-ring::before {
    content: ""; position: absolute; inset: -6px; border-radius: 50%;
    border: 1.5px dashed rgba(230,189,140,.45); transform: translateZ(-10px);
}
.category-card:hover .category-card-ring { transform: rotateY(18deg) rotateX(-8deg) translateZ(14px); box-shadow: -18px 22px 40px -12px rgba(0,0,0,.7), 0 0 30px rgba(201,141,85,.25); }

/* ── Magnetic buttons ─────────────────────────────────────────── */
.ux-magnet { transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.ux-magnet.is-pulled { transition: transform .1s linear; }

/* ── Section title: embossed leather stamp ───────────────────── */
.section-title {
    text-shadow: 0 1px 0 rgba(255,235,210,.08), 0 -1px 0 rgba(0,0,0,.6), 0 12px 30px rgba(0,0,0,.35);
}
.section-subtitle { display: inline-flex; align-items: center; gap: .6rem; }
.section-header .section-subtitle::before, .section-header .section-subtitle::after {
    content: ""; width: 26px; height: 0; border-top: 1.5px dashed var(--gold);
}

/* ════════════════════════════════════════════════════════════
   3D SWATCH RING
   ════════════════════════════════════════════════════════════ */
.ux-swatch-section { overflow: hidden; background: radial-gradient(ellipse 70% 60% at 50% 60%, rgba(110,63,28,.22), transparent 70%); }
.ux-ring-stage {
    --radius: clamp(240px, 32vw, 420px);
    position: relative; height: clamp(360px, 46vw, 470px);
    perspective: 1400px; perspective-origin: 50% 30%;
    cursor: grab; touch-action: pan-y; outline: none; user-select: none;
    margin-top: 1rem;
}
.ux-ring-stage:active { cursor: grabbing; }
.ux-ring-stage:focus-visible { outline: 2px dashed var(--gold-light); outline-offset: 8px; border-radius: 20px; }
.ux-ring {
    position: absolute; left: 50%; top: 42%; width: 0; height: 0;
    transform-style: preserve-3d;
    transform: rotateX(-8deg) rotateY(var(--rot, 0deg));
}
.ux-swatch {
    position: absolute; width: clamp(170px, 18vw, 230px); aspect-ratio: 3 / 4;
    left: 0; top: 0; translate: -50% -50%;
    transform: rotateY(calc(var(--i) * 360deg / var(--n))) translateZ(var(--radius));
    transform-style: preserve-3d;
}
.ux-swatch-face {
    position: absolute; inset: 0; border-radius: 18px; padding: 1.2rem;
    display: flex; flex-direction: column; justify-content: flex-end;
    color: var(--cream);
    background-color: var(--c1);
    background-image:
        var(--leather-grain),
        radial-gradient(120% 80% at 30% 15%, color-mix(in srgb, var(--c2) 85%, white 15%), transparent 60%),
        linear-gradient(160deg, var(--c2), var(--c1));
    background-blend-mode: overlay, normal, normal;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -30px 60px rgba(0,0,0,.45), 0 25px 50px -20px rgba(0,0,0,.8);
    backface-visibility: hidden;
}
.ux-swatch-face::before {
    content: ""; position: absolute; inset: 9px; border-radius: 12px;
    border: 1.5px dashed rgba(255,232,200,.5); pointer-events: none;
}
.ux-swatch-num { position: absolute; top: 1rem; left: 1.1rem; font-family: var(--font-serif); font-size: 2.2rem; font-weight: 700; color: rgba(255,232,200,.35); }
.ux-swatch-face h3 { font-family: var(--font-serif); font-size: 1.35rem; line-height: 1.1; margin-bottom: .35rem; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.ux-swatch-face p { font-size: .78rem; color: rgba(243,233,220,.82); line-height: 1.45; }
.ux-ring-floor {
    position: absolute; left: 50%; bottom: 4%; width: 70%; height: 60px; translate: -50% 0;
    background: radial-gradient(ellipse at center, rgba(0,0,0,.65), transparent 70%); filter: blur(8px);
}
.ux-ring-controls { display: flex; justify-content: center; gap: .75rem; margin-top: .5rem; }
.ux-ring-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(201,141,85,.45); color: var(--gold-light); background: var(--dark-2); }
.ux-ring-btn:hover { background: var(--gold); color: var(--black); }

/* ════════════════════════════════════════════════════════════
   EXPLODING JACKET LAYERS
   ════════════════════════════════════════════════════════════ */
.ux-anatomy-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); gap: 3rem; align-items: center; }
.ux-anatomy-list { list-style: none; counter-reset: l; display: grid; gap: .9rem; padding: 0; }
.ux-anatomy-list li {
    counter-increment: l; display: grid; grid-template-columns: 42px 1fr; column-gap: .9rem;
    padding: .9rem 1rem; border-radius: 14px; border: 1px solid var(--border); background: var(--dark-2);
    transition: border-color .4s, transform .4s, background .4s;
}
.ux-anatomy-list li::before {
    content: counter(l, decimal-leading-zero); grid-row: span 2;
    font-family: var(--font-serif); font-size: 1.6rem; font-weight: 700; color: var(--gold);
}
.ux-anatomy-list strong { color: var(--cream); }
.ux-anatomy-list span { color: var(--gray-400); font-size: .86rem; }
.ux-anatomy-list li.is-active { border-color: var(--gold); transform: translateX(8px); background: linear-gradient(90deg, rgba(201,141,85,.12), var(--dark-2)); }

.ux-stack-stage { height: clamp(360px, 42vw, 480px); perspective: 1300px; display: grid; place-items: center; overflow: hidden; }
.ux-stack { position: relative; width: min(78%, 360px); aspect-ratio: 4 / 5; transform-style: preserve-3d; transform: rotateX(56deg) rotateZ(-38deg); --e: 0; }
.ux-layer {
    position: absolute; inset: 0; border-radius: 26px 26px 34px 34px;
    transform: translateZ(calc(var(--i) * (6px + var(--e) * 70px)));
    transition: transform .25s linear, box-shadow .4s;
    box-shadow: 0 20px 40px rgba(0,0,0,.55);
    display: flex; align-items: flex-end; justify-content: flex-end; padding: 1rem 1.2rem;
}
.ux-layer span {
    font-size: .72rem; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--cream); background: rgba(10,7,5,.55); padding: .25rem .6rem; border-radius: 999px;
    opacity: var(--e); transition: opacity .3s;
}
/* bottom → top: hardware, lining, stitching, hide (reversed index visual) */
.ux-layer-0 { z-index: 4; background-color: #4a2a14; background-image: var(--leather-grain), linear-gradient(150deg, #7a4a24, #3a2010); background-blend-mode: overlay, normal; transform: translateZ(calc(3 * (6px + var(--e) * 70px))); }
.ux-layer-1 { z-index: 3; background: transparent; border: 2px dashed rgba(230,189,140,.85); box-shadow: none; transform: translateZ(calc(2 * (6px + var(--e) * 70px))) scale(.96); }
.ux-layer-2 { z-index: 2; background: repeating-linear-gradient(45deg, #8e6d55 0 2px, transparent 2px 18px), repeating-linear-gradient(-45deg, #8e6d55 0 2px, transparent 2px 18px), linear-gradient(160deg, #b8957a, #7a5a45); transform: translateZ(calc(1 * (6px + var(--e) * 70px))) scale(.94); }
.ux-layer-3 { z-index: 1; background: radial-gradient(circle at 50% 20%, #d9d2c8 0 6px, transparent 7px), linear-gradient(90deg, transparent 47%, #b9b1a6 47% 53%, transparent 53%), #2a2420; transform: translateZ(0) scale(.92); }
.ux-anatomy.is-active .ux-layer { box-shadow: 0 30px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(201,141,85,.25); }

@media (max-width: 900px) {
    .ux-anatomy-grid { grid-template-columns: 1fr; }
    .ux-stack-stage { order: -1; height: 340px; }
    .ux-stack { width: min(62%, 260px); }
}

/* ── Motion safety ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .ux-3d .reveal, .ux-tilt, .ux-magnet, .category-card-ring, .ux-layer { transition: none !important; transform: none !important; }
    .ux-progress { display: none; }
}

/* ── Leather promo banners (home) ───────────────────────────── */
.ux-promo { padding-top: 40px; }
.ux-promo-grid { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: 1fr 1fr; gap: 1.25rem; min-height: 520px; }
.ux-promo-card { position: relative; display: block; overflow: hidden; border-radius: 22px; isolation: isolate; box-shadow: 0 25px 50px -25px rgba(0,0,0,.8); transform-style: preserve-3d; }
.ux-promo-big { grid-row: span 2; }
.ux-promo-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.ux-promo-card:hover img { transform: scale(1.06); }
.ux-promo-body { position: absolute; inset: auto 0 0 0; z-index: 2; display: flex; flex-direction: column; gap: .35rem; padding: clamp(1.25rem, 3vw, 2.25rem); background: linear-gradient(0deg, rgba(10,6,3,.75), transparent); }
.ux-promo-tag { font-size: .7rem; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: var(--gold-light); }
.ux-promo-title { font-family: var(--font-serif); font-weight: 700; color: var(--cream); font-size: clamp(1.5rem, 3vw, 2.6rem); line-height: 1.05; text-shadow: 0 4px 20px rgba(0,0,0,.6); }
.ux-promo-small .ux-promo-title { font-size: clamp(1.3rem, 2.2vw, 1.9rem); }
.ux-promo-text { color: rgba(243,233,220,.8); font-size: .9rem; }
.ux-promo-cta { margin-top: .6rem; align-self: flex-start; display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.2rem; border-radius: 999px; font-weight: 700; font-size: .85rem; color: #1a0f07; background: linear-gradient(135deg, var(--gold-light), var(--gold)); transition: gap .3s; }
.ux-promo-card:hover .ux-promo-cta { gap: .9rem; }
.ux-promo-card:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 4px; }
@media (max-width: 900px) { .ux-promo-grid { grid-template-columns: 1fr; grid-template-rows: none; min-height: 0; } .ux-promo-big { grid-row: auto; } .ux-promo-card { aspect-ratio: 12 / 8; } }
