/* ──────────────────────────────────────────────────────────────────────────
   EN-258 — the POLISH layer (his ask after Velvet: «ما تعدل بقي باقي الثيمات
   تخليها احلي واحلي ؟»). Additive on ALL TEN themes, the EN-251 pattern: the
   delivered style.css files stay byte-identical (D-223) and every theme keeps
   its own palette/typography/layout (D-224). This file adds MOTION and FINISH
   only — neutral shadows, transforms, transitions, focus rings drawn in each
   theme's own --accent. Loaded LAST, after every other layer.

   Motion contract: reveal styles apply ONLY under html.coco-motion, which
   coco-polish.js sets when JS runs AND the visitor does not prefer reduced
   motion — so no-JS visitors (and crawlers, and the headless catalog shots)
   always see the full page, and reduced-motion visitors get zero animation.
   ────────────────────────────────────────────────────────────────────────── */

/* ── scroll reveal ── */
html.coco-motion .coco-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
html.coco-motion .coco-reveal.coco-in {
  opacity: 1;
  transform: none;
}

/* ── cards: a soft lift and a deeper (neutral) shadow ── */
.dress-card, .branch-card, .value-card, .testimonial-card {
  transition: transform .3s ease, box-shadow .3s ease;
}
.dress-card:hover, .branch-card:hover, .value-card:hover, .testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(0, 0, 0, .16);
}

/* ── images: a quiet zoom inside their own frame ── */
.dress-card__media, .collection-card__media { overflow: hidden; }
.dress-card__image, .collection-card__media img {
  transition: transform .6s ease;
}
.dress-card:hover .dress-card__image,
.collection-card:hover .collection-card__media img {
  transform: scale(1.04);
}

/* ── EN-263: the product card ──
   Additive on every theme's OWN card variant (arch/bar/index/plain): the
   gown's second photo crossfades in on hover, the «available» badge breathes,
   the price carries a tiny «per rental» clarifier, and a soft backdrop stands
   behind lazy-loading photos so slow networks never flash white. */
.dress-card__media { position: relative; display: block; background: rgba(0, 0, 0, .05); }
.dress-card__altimage {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .45s ease; pointer-events: none; z-index: 1;
}
.dress-card:hover .dress-card__altimage { opacity: 1; }
.dress-card__status { z-index: 2; }
.dress-card__status--available::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; margin-inline-end: 6px; vertical-align: middle;
  animation: coco-pulse 2.2s ease-in-out infinite;
}
@keyframes coco-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.dress-card__per {
  display: block; font-size: 10.5px; font-weight: 400; letter-spacing: .02em;
  text-transform: none; color: var(--sub, #7a7a7a); margin-top: 2px;
}
/* B-091 — the shared --featured grid is auto-fit, so a LONE gown stretched to
   the whole row («الكارد بيبقي كبير اوي لما بيكون برودكت واحد»). Alone, it
   keeps a card's size and sits at the reading edge. */
.dress-grid--featured > .dress-card:only-child { max-width: 340px; }

/* ── buttons and nav links ── */
.theme-btn { transition: transform .25s ease, background .3s, color .3s, border-color .3s, box-shadow .3s; }
.theme-btn:hover { transform: translateY(-1px); }
.theme-btn:active { transform: translateY(0); }
.theme-nav-link { transition: color .2s ease, border-color .25s ease; }

/* ── the sticky header takes a shadow once the page scrolls ── */
.theme-header { transition: box-shadow .3s ease; }
.theme-header.is-scrolled { box-shadow: 0 10px 30px rgba(0, 0, 0, .1); }

/* ── EN-259 follow-up (his ask): the BIG bars COMPRESS on scroll ──
   «لما نعمل سكرول الناف بار يحصلها كومبريشن» — the header shrinks to a calm
   strip once the page moves and swells back at the top. Pure CSS on the same
   `is-scrolled` flag; `!important` outranks coco-nav-split's own important
   sizing (this file loads after it). The maison sidebar has no .theme-header,
   so it is naturally untouched. */
.theme-header__inner { transition: padding .5s cubic-bezier(.33, 0, .16, 1), gap .5s cubic-bezier(.33, 0, .16, 1); }
.theme-brand { transition: font-size .5s cubic-bezier(.33, 0, .16, 1), padding .5s cubic-bezier(.33, 0, .16, 1); }
.theme-brand img { transition: height .5s cubic-bezier(.33, 0, .16, 1); }
.theme-header.is-scrolled .theme-header__inner { padding-top: 8px; padding-bottom: 8px; }
.theme-header.is-scrolled .theme-brand { font-size: clamp(19px, 2.2vw, 24px); }
.theme-header.is-scrolled .theme-brand img { height: 36px !important; }

/* the masthead: the meta row FOLDS closed and the whole thing collapses to one
   compact row — the wordmark leaves the centre and sits BESIDE the pages
   (his follow-ups: «اللوجو مع الاسكرول محتاج يجي جمب الكلام» + «خلي
   الترانزيشن سموز» — every animatable property rides one soft curve; the
   flex reflow itself lands under the cover of those transitions) */
.theme-header--masthead .theme-container { transition: padding .5s cubic-bezier(.33, 0, .16, 1); }
.theme-header--masthead .masthead__meta { overflow: hidden; max-height: 48px; transition: max-height .5s cubic-bezier(.33, 0, .16, 1), opacity .35s ease, padding .5s cubic-bezier(.33, 0, .16, 1); }
.theme-header--masthead.is-scrolled .masthead__meta { max-height: 0; opacity: 0; padding: 0; flex-basis: 100%; }
.masthead__brand { transition: font-size .5s cubic-bezier(.33, 0, .16, 1), padding .5s cubic-bezier(.33, 0, .16, 1), border-bottom-color .35s ease; }
.masthead__brand img { transition: height .5s cubic-bezier(.33, 0, .16, 1); }
.theme-header--masthead.is-scrolled .theme-container { display: flex; align-items: center; justify-content: space-between; column-gap: 20px; row-gap: 0; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.theme-header--masthead.is-scrolled .masthead__brand { font-size: clamp(20px, 2.4vw, 26px); text-align: start; border-bottom-color: transparent; padding: 0; flex: 0 0 auto; }
.theme-header--masthead.is-scrolled .masthead__brand img { height: 38px !important; }
.theme-header--masthead.is-scrolled .masthead__navrow { padding: 0; justify-content: flex-end; margin-inline-start: auto; }
.masthead__navrow { transition: padding .5s cubic-bezier(.33, 0, .16, 1); }

/* the centered header does the same: from a stacked column to one row,
   the brand on one side and the pages beside it */
.theme-header--centered.is-scrolled .theme-header__inner { flex-direction: row; justify-content: space-between; align-items: center; gap: 20px; padding-top: 8px; padding-bottom: 8px; }
.theme-header--centered.is-scrolled .theme-brand { flex: 0 0 auto; }
.theme-header--centered.is-scrolled .masthead__navrow { justify-content: flex-end; margin-inline-start: auto; padding: 0; }

/* ── keyboard focus, drawn in the theme's own accent ── */
.theme-btn:focus-visible, .theme-nav-link:focus-visible, .theme-link:focus-visible,
.filter-chip:focus-visible, .faq-item__question:focus-visible,
.form-field input:focus-visible, .form-field textarea:focus-visible, .form-field select:focus-visible {
  outline: 2px solid var(--accent, #000);
  outline-offset: 2px;
}

/* reduced motion: even the hover transforms hold still */
@media (prefers-reduced-motion: reduce) {
  .dress-card, .branch-card, .value-card, .testimonial-card, .theme-btn,
  .dress-card__image, .collection-card__media img, .theme-header,
  .theme-header__inner, .theme-brand, .theme-brand img,
  .masthead__brand, .masthead__brand img, .masthead__navrow,
  .theme-header--masthead .theme-container, .theme-header--masthead .masthead__meta {
    transition: none;
  }
  .dress-card:hover, .branch-card:hover, .value-card:hover, .testimonial-card:hover,
  .theme-btn:hover { transform: none; }
  .dress-card:hover .dress-card__image,
  .collection-card:hover .collection-card__media img { transform: none; }
  .dress-card__altimage { transition: none; }
  .dress-card__status--available::before { animation: none; }
}
