/**
 * ╔══════════════════════════════════════════════════════════════╗
 * ║  nav.css — Componenta Navigation                             ║
 * ║                                                              ║
 * ║  STRUCTURA HTML așteptată:                                   ║
 * ║  <nav id="nav" class="nav">                                  ║
 * ║    <div class="nav__container">                              ║
 * ║      <a class="nav__logo"> ... </a>                          ║
 * ║      <ul class="nav__links" id="navLinks"> ... </ul>         ║
 * ║      <div class="nav__actions"> ... </div>                   ║
 * ║      <button class="nav__burger" id="navBurger"> ... </button>║
 * ║    </div>                                                    ║
 * ║  </nav>                                                      ║
 * ║                                                              ║
 * ║  STĂRI:                                                      ║
 * ║  .nav.scrolled   — adăugat de JS când scrollY > 60px        ║
 * ║  .nav__burger.open — burger activ (meniu mobil deschis)     ║
 * ║  .nav__links.open  — meniu mobil vizibil                    ║
 * ║  .nav__link.active — link-ul paginii curente                ║
 * ╚══════════════════════════════════════════════════════════════╝
 */

/* ── Container de bază ──────────────────────────────────────── */
.nav {
  position: fixed;
  inset-block-start: 0;   /* top: 0 — sintaxă logică CSS */
  inset-inline: 0;        /* left: 0; right: 0 */
  z-index: var(--z-nav);
  height: var(--nav-height);

  /* Fundal cu blur — efect frosted glass */
  background: rgba(253, 246, 236, 0.93);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);

  border-bottom: 1px solid transparent;
  transition:
    border-color var(--dur-base),
    box-shadow   var(--dur-base);
}

/* Starea scrolled — bordura și umbra apar */
.nav.scrolled {
  border-bottom-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

/* ── Inner container (centrare conținut) ─────────────────────── */
.nav__container {
  max-width: var(--container-max);
  width: 100%;
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--sp-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}

/* ── Logo ────────────────────────────────────────────────────── */
.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  flex-shrink: 0; /* nu se comprimă la ecrane mici */
}

.nav__logo-mark {
  width: 48px; height: 48px;
  background: var(--brand);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-brand);
  transition: transform var(--dur-base) var(--ease-spring);
  flex-shrink: 0;
}

/* Rotire mică la hover — efect jucăuș, specific cofetăriei */
.nav__logo:hover .nav__logo-mark {
  transform: scale(1.1) rotate(8deg);
}

.nav__logo-text {
  display: flex;
  flex-direction: column;
}

.nav__logo-name {
  font-family: var(--font-script);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--txt-secondary);
  line-height: 1;
}

.nav__logo-tag {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--txt-muted);
  margin-top: 2px;
}

/* ── Link-uri de navigare ────────────────────────────────────── */
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  list-style: none;
}

.nav__link {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--txt-muted);
  letter-spacing: var(--ls-wide);
  text-decoration: none;
  position: relative;
  padding-bottom: 3px;
  transition: color var(--dur-fast);
}

/* Linia animată sub link (underline effect) */
.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1.5px;
  background: var(--brand);
  border-radius: 1px;
  transition: width var(--dur-base) var(--ease-out);
}

.nav__link:hover,
.nav__link.active {
  color: var(--brand);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

/* ── Acțiuni (butoane dreapta) ───────────────────────────────── */
.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

/* ── Burger Button (mobil) ───────────────────────────────────── */
.nav__burger {
  display: none;    /* Ascuns pe desktop */
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--sp-2);
  border-radius: var(--r-sm);
  background: none;
  border: none;
  transition: background var(--dur-fast);
}

.nav__burger:hover { background: var(--brand-subtle); }

.nav__burger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--txt-secondary);
  border-radius: 2px;
  transition:
    transform var(--dur-base) var(--ease-out),
    opacity   var(--dur-base);
}

/* Transformare burger → X când meniul e deschis */
.nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .nav__links { gap: var(--sp-4); }
}

@media (max-width: 900px) {
  /* Ascunde CTA principal pe tabletă mică */
  .nav__actions .btn--primary { display: none; }
}

@media (max-width: 768px) {
  /* Burger devine vizibil */
  .nav__burger { display: flex; }

  /* Meniu drop-down mobil */
  .nav__links {
    display: none;   /* Ascuns implicit */
    position: fixed;
    inset-block-start: var(--nav-height);
    inset-inline: 0;
    background: var(--bg-card);
    padding: var(--sp-6) var(--sp-6) var(--sp-8);
    flex-direction: column;
    align-items: center;
    gap: var(--sp-5);
    border-top: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    max-height: calc(100dvh - var(--nav-height));
  }

  .nav__links.open { display: flex; }

  .nav__link {
    font-size: var(--fs-lg); /* Mai mare pe mobil pentru touch */
  }
}

@media (max-width: 480px) {
  .nav__container { padding-inline: var(--sp-4); }
  .nav__logo-name { font-size: 1.35rem; }
  .nav__logo-tag  { display: none; }
}
