/* Strat de finisaj mobil — Voost Vision.
   Aditiv: nu modifica designul, doar comportamentul de incarcare si atingere.
   Se poate scoate complet stergand link-ul catre enhance.css si enhance.js. */

:root {
  --nu-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --nu-skel-a: #F1E7E0;
  --nu-skel-b: #FBF6F2;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* ancorele nu mai intra sub header-ul sticky */
  scroll-padding-top: 96px;
}

body {
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-x: none;
}

a, button, [role="button"], input, select, textarea, label {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* iOS nu mai face zoom la focus daca fontul e >= 16px */
input, select, textarea { font-size: 16px; }

img { max-width: 100%; }

/* ---------- incarcarea imaginilor ---------- */
/* Cutia are intotdeauna fundal si sclipire; imaginea intra prin fade cand e gata,
   deci nu mai apare niciodata un dreptunghi gol. */
.nu-skel {
  position: relative;
  background-color: var(--nu-skel-a);
  overflow: hidden;
}
.nu-skel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(100deg, var(--nu-skel-a) 18%, var(--nu-skel-b) 38%, var(--nu-skel-a) 58%);
  background-size: 240% 100%;
  animation: nu-shimmer 1.35s linear infinite;
}
.nu-skel.nu-ready::after {
  opacity: 0;
  animation: none;
  transition: opacity 0.35s var(--nu-ease);
}
.nu-skel.nu-ready { background-color: transparent; }
@keyframes nu-shimmer { to { background-position: -240% 0; } }

/* Nu atingem NICIODATA opacity-ul imaginii. Cardurile de produs au doua imagini
   suprapuse cu opacity controlat inline de runtime (`opacity:{{ p.op1 }}` / `{{ p.op2 }}`),
   iar aparitia la hover a vederii de sus se face exact din acele valori. O animatie CSS
   cu fill-mode bate stilul inline si ar tine ambele poze vizibile simultan.
   Fade-ul de incarcare il face invelisul, nu imaginea: sclipirea acopera cutia si se stinge. */

/* ---------- aparitia cardurilor ---------- */
[data-nu-rise] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--nu-ease), transform 0.6s var(--nu-ease);
  transition-delay: var(--nu-delay, 0ms);
  will-change: opacity, transform;
}
[data-nu-rise].nu-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* ---------- atingere ---------- */
@media (hover: none) {
  /* apasarea da raspuns vizual, ca intr-o aplicatie */
  a:active, button:active, [role="button"]:active {
    transform: scale(0.985);
    transition: transform 0.12s var(--nu-ease);
  }
  /* backdrop-filter repictat la fiecare cadru de scroll face wordmark-ul sa palpaie
     pe telefoanele reale; fundalul e oricum 94% opac, deci diferenta vizuala e nula */
  header { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
}

/* zona de atingere de 44px pentru linkurile mici, fara sa se schimbe layoutul.
   Suprapunerea invizibila creste doar suprafata de atins, nu si cutia din pagina. */
@media (hover: none) and (max-width: 900px) {
  nav a, footer a, footer p > a, p > a[href^="tel:"], p > a[href^="mailto:"], p > a[href^="/"], p > a[href^="https://www.instagram"] {
    position: relative;
  }
  nav a::after, footer a::after, footer p > a::after,
  p > a[href^="tel:"]::after, p > a[href^="mailto:"]::after, p > a[href^="/"]::after,
  p > a[href^="https://www.instagram"]::after {
    content: "";
    position: absolute;
    left: -8px; right: -8px;
    top: 50%;
    height: 44px;
    transform: translateY(-50%);
  }
  /* butoanele de acordeon (intrebari frecvente) ating pragul real de 44px */
  button { min-height: 44px; }

  /* linkurile de contact scrise in mijlocul unui paragraf: cutia reala creste la 44px,
     iar marginea negativa anuleaza cresterea, deci pagina arata identic */
  p > a[href^="tel:"], p > a[href^="mailto:"], p > a[href*="instagram.com"], p > a[href*="tiktok.com"] {
    display: inline-block;
    padding-top: 9px;
    padding-bottom: 9px;
    margin-top: -9px;
    margin-bottom: -9px;
  }
}

/* ---------- iPhone: crestatura in peisaj ---------- */
@supports (padding: max(0px, env(safe-area-inset-left))) {
  @media (orientation: landscape) {
    body {
      padding-left: env(safe-area-inset-left);
      padding-right: env(safe-area-inset-right);
    }
  }
}

/* ---------- randuri orizontale: derulare cu inertie si oprire pe card ---------- */
[data-nu-swipe] {
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
[data-nu-swipe]::-webkit-scrollbar { display: none; }
[data-nu-swipe] > * { scroll-snap-align: center; }

/* ---------- respecta setarea de miscare redusa ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nu-skel::after { animation: none; }
  [data-nu-rise] { opacity: 1 !important; transform: none !important; transition: none !important; }
  a:active, button:active, [role="button"]:active { transform: none; }
}


/* ---------- header pe telefon: un singur rand + meniu burger ---------- */
/* Designul are 6 linkuri text plus butonul de comanda intr-un nav care se rupe pe doua
   randuri sub 820px si mananca un sfert din ecran. Pe telefon randul ramane
   logo + nume ......... comanda + burger, iar linkurile trec in panoul burger. */
@media (max-width: 820px) {
  header nav {
    flex-wrap: nowrap !important;
    gap: 10px !important;
    justify-content: flex-end !important;
  }
  header nav > a:not(.nu-cart):not(.nu-burger),
  header nav > button:not(.nu-cart):not(.nu-burger) { display: none !important; }

  /* logo mai prezent, nume putin mai mic ca sa incapa langa butoane */
  header > div > a:first-child img { width: 52px !important; height: 52px !important; }
  header > div > a:first-child span { font-size: 15px !important; letter-spacing: 0.12em !important; }
  header > div {
    padding: 10px 14px !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    justify-content: space-between !important;
  }
  /* numele se poate ingusta ca sa incapa butonul de comanda si burgerul */
  header > div > a:first-child { min-width: 0 !important; flex: 0 1 auto !important; overflow: hidden; }
  header > div > a:first-child span {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  header nav { flex: 0 0 auto !important; min-width: 0 !important; }
  header .nu-cart { padding: 10px 14px !important; }
  header .nu-cart > span:first-child { font-size: 13px; }

  header .nu-burger { display: inline-flex !important; }
}

.nu-burger {
  display: none;
  position: relative;
  z-index: 2;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  flex: none;
  border: 1px solid #EADFD7;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.nu-burger span {
  display: block;
  width: 18px; height: 1.5px;
  background: #2A211D;
  border-radius: 2px;
  position: relative;
  transition: transform 0.28s var(--nu-ease), opacity 0.2s var(--nu-ease);
}
.nu-burger span::before, .nu-burger span::after {
  content: ""; position: absolute; left: 0;
  width: 18px; height: 1.5px; background: #2A211D; border-radius: 2px;
  transition: transform 0.28s var(--nu-ease);
}
.nu-burger span::before { top: -6px; }
.nu-burger span::after { top: 6px; }
.nu-burger[aria-expanded="true"] span { background: transparent; }
.nu-burger[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nu-burger[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* panoul */
.nu-sheet {
  position: fixed; inset: 0; z-index: 60;
  visibility: hidden;
  pointer-events: none;
}
.nu-sheet.nu-open { visibility: visible; pointer-events: auto; }
.nu-sheet__veil {
  position: absolute; inset: 0;
  background: rgba(42, 33, 29, 0.34);
  opacity: 0;
  transition: opacity 0.3s var(--nu-ease);
}
.nu-sheet.nu-open .nu-sheet__veil { opacity: 1; }
.nu-sheet__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(78vw, 320px);
  background: #FBF8F5;
  border-left: 1px solid #EADFD7;
  padding: 18px 22px max(22px, env(safe-area-inset-bottom));
  padding-right: max(22px, env(safe-area-inset-right));
  display: flex; flex-direction: column; gap: 4px;
  transform: translateX(100%);
  transition: transform 0.34s var(--nu-ease);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.nu-sheet.nu-open .nu-sheet__panel { transform: none; }
.nu-sheet__panel a {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 24px;
  color: #2A211D;
  padding: 13px 0;
  border-bottom: 1px solid #EFE5DE;
  min-height: 44px;
  display: flex; align-items: center;
}
.nu-sheet__panel a[aria-current="page"] { color: #B9714F; }
.nu-sheet__panel a:last-of-type { border-bottom: 0; }
.nu-sheet__tel {
  margin-top: auto;
  display: flex !important; align-items: center; justify-content: center;
  gap: 8px;
  background: #7A5347; color: #FBF8F5 !important;
  border-radius: 999px; padding: 14px 20px !important;
  font-family: Karla, system-ui, sans-serif !important;
  font-size: 15px !important; font-weight: 500;
  border-bottom: 0 !important;
}
body.nu-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .nu-sheet__panel, .nu-sheet__veil, .nu-burger span, .nu-burger span::before, .nu-burger span::after {
    transition: none !important;
  }
}

/* ---------- ecrane inguste: butonul de comanda devine iconita cu numar ---------- */
/* „Comanda mea" ocupa ~150px si taia numele cofetariei in „NOSSA U…".
   Punga + numarul spun acelasi lucru in 64px, iar wordmark-ul incape intreg. */
@media (max-width: 460px) {
  header .nu-cart { padding: 10px 13px !important; gap: 7px !important; }
  header .nu-cart > span:first-child { display: none !important; }
  header .nu-cart::before {
    content: "";
    width: 17px; height: 17px; flex: none;
    background: currentColor;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"/><path d="M3 6h18"/><path d="M16 10a4 4 0 0 1-8 0"/></svg>') center / contain no-repeat;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"/><path d="M3 6h18"/><path d="M16 10a4 4 0 0 1-8 0"/></svg>') center / contain no-repeat;
  }
  header > div > a:first-child span { font-size: 14px !important; letter-spacing: 0.1em !important; }
}

/* iPhone SE si alte 320px: numele intra intreg doar cu font mai mic */
@media (max-width: 360px) {
  header > div > a:first-child img { width: 46px !important; height: 46px !important; }
  header > div > a:first-child span { font-size: 12px !important; letter-spacing: 0.05em !important; }
  header > div { padding: 10px 12px !important; gap: 8px !important; }
}
