/* ============================================================
   CHIC CHARMS — d7-luxury-motion.css
   Stage 1 · Luxury Mobile Header + Hero Redesign
   Mobile-only additive layer — desktop untouched
   ============================================================ */

/* ============================================================
   D7 · MOBILE TOKENS
   ============================================================ */
:root {
  --d7-nav-h:         60px;
  --d7-ease-silk:     cubic-bezier(0.16, 1, 0.3, 1);
  --d7-ease-drift:    cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --d7-ease-enter:    cubic-bezier(0.22, 1, 0.36, 1);
  --d7-menu-bg:       rgba(250, 247, 244, 0.98);
  --d7-overlay-bg:    rgba(28, 25, 23, 0.38);
  --d7-ink:           #1C1917;
  --d7-muted:         #6E6460;
  --d7-rose:          #B5657A;
  --d7-rose-faint:    rgba(181, 101, 122, 0.10);
  --d7-border:        rgba(237, 230, 221, 0.9);
  --d7-separator:     rgba(237, 230, 221, 0.7);
}

/* ============================================================
   D7 · MOBILE HEADER — Luxury Minimal
   ============================================================ */
@media (max-width: 900px) {

  /* ── Header shell ── */
  .navbar {
    height: var(--d7-nav-h);
    background: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(24px) saturate(1.9);
    -webkit-backdrop-filter: blur(24px) saturate(1.9);
    border-bottom: 1px solid var(--d7-border);
    transition:
      box-shadow 0.4s var(--d7-ease-drift),
      background 0.4s var(--d7-ease-drift);
  }

  .navbar.scrolled {
    background: rgba(250, 248, 245, 0.98);
    box-shadow: 0 1px 24px rgba(60, 40, 30, 0.07);
  }

  .nav-inner {
    height: var(--d7-nav-h);
    padding: 0 22px;
    gap: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* ── Logo ── */
  .logo {
    font-size: 1.22rem;
    letter-spacing: 0.04em;
    flex: 0 0 auto;
    line-height: 1;
    z-index: 2;
  }

  /* ── Nav actions cluster (right side) ── */
  .nav-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    min-width: auto;
    max-width: none;
    overflow: visible;
    z-index: 2;
    min-height: auto;
  }

  /* ── Hide desktop auth identity pill on mobile ── */
  .nav-auth-identity {
    display: none;
  }

  .nav-auth-meta { display: none; }

  /* ── Hide admin badge text on mobile ── */
  .nav-auth-admin {
    display: none;
  }

  /* ── Mobile icon button base ── */
  .d7-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--d7-ink);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition:
      background 0.18s ease,
      color 0.18s ease;
    position: relative;
    flex-shrink: 0;
  }

  .d7-icon-btn:active {
    background: var(--d7-rose-faint);
    transform: scale(0.93);
    transition: transform 0.08s ease, background 0.08s ease;
  }

  /* ── Cart icon button ── */
  .d7-cart-btn {
    position: relative;
  }

  .d7-cart-count {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--d7-rose);
    border: 1.5px solid rgba(250, 248, 245, 0.95);
    display: none;
  }

  .d7-cart-count.visible {
    display: block;
  }

  /* ── Avatar icon button (profile) ── */
  .d7-avatar-btn {
    position: relative;
  }

  .d7-avatar-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f4c6d4 0%, #e8a0b8 100%);
    border: 1px solid rgba(181, 101, 122, 0.22);
    font-family: var(--font-head);
    font-size: 0.68rem;
    font-weight: 500;
    color: #8b3a52;
    letter-spacing: 0;
    line-height: 1;
    user-select: none;
  }

  /* ── Luxury hamburger: two thin lines ── */
  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 11px 12px;
    border-radius: 50%;
    transition: background 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    flex-shrink: 0;
  }

  .hamburger:active {
    background: var(--d7-rose-faint);
  }

  .hamburger span {
    display: block;
    height: 1px;
    background: var(--d7-ink);
    border-radius: 1px;
    transition:
      transform 0.36s var(--d7-ease-silk),
      opacity 0.22s ease,
      width 0.36s var(--d7-ease-silk);
  }

  .hamburger span:nth-child(1) {
    width: 20px;
  }

  .hamburger span:nth-child(2) {
    width: 14px;
    align-self: flex-end;
  }

  /* Animated open state: two lines → elegant X */
  .hamburger[aria-expanded="true"] span:nth-child(1) {
    width: 18px;
    transform: translateY(3.5px) rotate(45deg);
    align-self: center;
  }

  .hamburger[aria-expanded="true"] span:nth-child(2) {
    width: 18px;
    transform: translateY(-3.5px) rotate(-45deg);
    align-self: center;
  }

  /* ── nav-links: collapsed state on mobile ── */
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    transform: none;
    left: unset;
    white-space: normal;
  }
}

/* ============================================================
   D7 · MOBILE MENU — Premium Overlay Panel
   ============================================================ */
@media (max-width: 900px) {

  /* Overlay backdrop */
  .nav-links::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--d7-overlay-bg);
    opacity: 0;
    transition: opacity 0.38s var(--d7-ease-drift);
    z-index: 0;
  }

  /* Menu panel */
  .nav-links::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: min(320px, 88vw);
    bottom: 0;
    background: var(--d7-menu-bg);
    z-index: 1;
    transform: translateX(100%);
    transition: transform 0.46s var(--d7-ease-silk);
    box-shadow: -8px 0 48px rgba(28, 25, 23, 0.10);
  }

  /* Open state */
  .nav-links.open {
    display: flex;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
    box-shadow: none;
    border: none;
    animation: none;
  }

  .nav-links.open::before {
    opacity: 1;
  }

  .nav-links.open::after {
    transform: translateX(0);
  }

  /* Individual links inside panel */
  .nav-links a {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    margin-left: auto;
    width: min(320px, 88vw);
    padding: 22px 32px;
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--d7-ink);
    border-bottom: 1px solid var(--d7-separator);
    transition:
      color 0.2s ease,
      padding-left 0.22s var(--d7-ease-drift);
    opacity: 0;
    transform: translateX(18px);
    min-height: 0;
  }

  /* Staggered reveal animation for links */
  .nav-links.open a {
    animation: d7LinkReveal 0.38s var(--d7-ease-enter) forwards;
  }

  .nav-links.open a:nth-child(1) { animation-delay: 0.14s; }
  .nav-links.open a:nth-child(2) { animation-delay: 0.18s; }
  .nav-links.open a:nth-child(3) { animation-delay: 0.22s; }
  .nav-links.open a:nth-child(4) { animation-delay: 0.26s; }
  .nav-links.open a:nth-child(5) { animation-delay: 0.30s; }
  .nav-links.open a:nth-child(6) { animation-delay: 0.34s; }

  @keyframes d7LinkReveal {
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  /* First link: leave top space for the header bar */
  .nav-links.open a:first-child {
    margin-top: var(--d7-nav-h);
    padding-top: 28px;
  }

  /* Last link: no separator */
  .nav-links.open a:last-child {
    border-bottom: none;
  }

  /* Remove the underline pseudo-element on mobile */
  .nav-links a::after {
    display: none;
  }

  /* Tap / hover state */
  .nav-links.open a:active,
  .nav-links.open a:hover {
    color: var(--d7-rose);
    padding-left: 38px;
  }

  /* ── Close backdrop on overlay tap ── */
  .nav-links.open::before {
    cursor: pointer;
  }
}

/* ============================================================
   D7 · MOBILE HERO — Editorial Cinematic
   ============================================================ */
@media (max-width: 900px) {

  .hero {
    min-height: 100svh;
    padding-top: var(--d7-nav-h);
    display: flex;
    flex-direction: column;
  }

  .hero-bg-layer {
    background:
      radial-gradient(ellipse 110% 50% at 50% 0%, rgba(212, 135, 156, 0.11) 0%, transparent 60%),
      radial-gradient(ellipse 70% 55% at 0% 80%, rgba(237, 230, 221, 0.5) 0%, transparent 60%);
  }

  /* ── Hero inner: stacked editorial layout ── */
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 0;
    padding-top: 0;
    padding-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  /* Text block: top */
  .hero-text {
    order: 1;
    padding-top: 44px;
    padding-bottom: 40px;
    flex: 0 0 auto;
  }

  /* Visual block: bottom */
  .hero-visual {
    order: 2;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 48svh;
  }

  /* ── Hero eyebrow ── */
  .hero-eyebrow {
    justify-content: center;
    font-size: 0.6rem;
    letter-spacing: 0.34em;
    margin-bottom: 24px;
    opacity: 0;
    animation: d7FadeUp 0.7s var(--d7-ease-enter) 0.1s forwards;
  }

  .eyebrow-line {
    display: none;
  }

  /* Decorative flanking lines replacing eyebrow-line */
  .hero-eyebrow::before,
  .hero-eyebrow::after {
    content: '';
    display: block;
    width: 28px;
    height: 1px;
    background: var(--d7-rose);
    flex-shrink: 0;
    opacity: 0.6;
  }

  /* ── Hero headline: cinematic scale ── */
  .hero-headline {
    font-size: clamp(2.75rem, 10.5vw, 3.8rem);
    letter-spacing: -0.03em;
    line-height: 1.06;
    margin-bottom: 22px;
    opacity: 0;
    animation: d7FadeUp 0.75s var(--d7-ease-enter) 0.22s forwards;
  }

  /* ── Hero sub ── */
  .hero-sub {
    font-size: 0.88rem;
    line-height: 1.9;
    margin: 0 auto 36px;
    max-width: 280px;
    color: var(--muted);
    font-weight: 300;
    opacity: 0;
    animation: d7FadeUp 0.7s var(--d7-ease-enter) 0.34s forwards;
  }

  /* ── CTA buttons ── */
  .hero-ctas {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 0 24px;
    opacity: 0;
    animation: d7FadeUp 0.65s var(--d7-ease-enter) 0.44s forwards;
  }

  .hero-ctas .btn-primary {
    width: 100%;
    max-width: 300px;
    padding: 16px 28px;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    border-radius: 2px;
    box-shadow: 0 6px 28px rgba(181, 101, 122, 0.28);
  }

  .hero-ctas .btn-ghost {
    width: 100%;
    max-width: 300px;
    padding: 14px 28px;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    border-radius: 2px;
  }

  /* ── Trust row ── */
  .hero-trust-row {
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    opacity: 0;
    animation: d7FadeUp 0.6s var(--d7-ease-enter) 0.52s forwards;
  }

  .hero-trust-item {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
  }

  /* ── Hero image: full-bleed cinematic ── */
  .hero-img-wrap {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    overflow: hidden;
    opacity: 0;
    animation: d7ImgReveal 0.9s var(--d7-ease-drift) 0.3s forwards;
  }

  .hero-img {
    width: 100%;
    height: 100%;
    min-height: 48svh;
    max-height: none;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 0;
    box-shadow: none;
    display: block;
    flex: 1;
  }

  /* ── Hide desktop flourishes ── */
  .hero-float-card,
  .hero-float-tag,
  .hero-img-frame,
  .hero-scroll-hint {
    display: none;
  }
}

/* ── Narrow phones ── */
@media (max-width: 560px) {

  .hero-headline {
    font-size: clamp(2.4rem, 10vw, 3rem);
  }

  .hero-sub {
    font-size: 0.84rem;
    max-width: 260px;
  }

  .hero-ctas {
    padding: 0 20px;
  }

  .hero-ctas .btn-primary,
  .hero-ctas .btn-ghost {
    max-width: 100%;
  }

  .hero-img {
    min-height: 44svh;
  }
}

@media (max-width: 380px) {
  .nav-inner { padding: 0 16px; }
  .hero-headline { font-size: 2.2rem; }
  .hero-text { padding-top: 36px; padding-bottom: 32px; }
}

/* ============================================================
   D7 · MOBILE HERO ANIMATIONS
   ============================================================ */
@keyframes d7FadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes d7ImgReveal {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================================
   D7 · REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow,
  .hero-headline,
  .hero-sub,
  .hero-ctas,
  .hero-trust-row,
  .hero-img-wrap {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .nav-links.open::after {
    transition: none;
  }

  .nav-links.open a {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .hamburger span {
    transition: none;
  }
}

/* ============================================================
   D7 · MOBILE NAV SCROLL LOCK
   When menu is open, block body scroll
   ============================================================ */
body.d7-menu-open {
  overflow: hidden;
  touch-action: none;
}

/* ============================================================
   D7 · SAFE AREA (iPhone notch)
   ============================================================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 900px) {
    .navbar {
      padding-top: env(safe-area-inset-top, 0px);
      height: calc(var(--d7-nav-h) + env(safe-area-inset-top, 0px));
    }

    .nav-links.open a:first-child {
      margin-top: calc(var(--d7-nav-h) + env(safe-area-inset-top, 0px));
    }

    .nav-links.open a:last-child {
      padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    }
  }
}

/* ============================================================
   D7 · OVERRIDE D5 CONFLICTS — Take priority on mobile
   ============================================================ */
@media (max-width: 900px) {
  /* D5 set fixed heights on .nav-links.open items; reset here */
  .nav-links.open a {
    min-height: unset;
  }

  /* D5 navDrawerReveal animation — disable since D7 uses slide-in panel */
  .nav-links.open {
    animation: none !important;
  }

  /* D5 had padding on open drawer; D7 uses pseudoelements */
  .nav-links.open {
    padding: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border-bottom: none !important;
  }

  /* Sync hero padding with new nav height */
  .hero {
    padding-top: var(--d7-nav-h) !important;
  }
}
