/* ==========================================================================
   BLOCK HP-0 — Navigation Bar
   Files: block-hp-0-nav.php | block-hp-0-nav.css | block-hp-0-nav.js
   ========================================================================== */

/* ── Base shell ─────────────────────────────────────────────────────────── */
.taula-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 80px;
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Admin-bar offset */
.admin-bar .taula-nav {
  top: 32px;
}
@media screen and (max-width: 782px) {
  .admin-bar .taula-nav {
    top: 46px;
  }
}

/* Scrolled state — white background */
.taula-nav.is-scrolled {
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

/* ── Inner layout ───────────────────────────────────────────────────────── */
.taula-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 32px;
  gap: 24px;
}

/* ── Logo ───────────────────────────────────────────────────────────────── */
.taula-nav__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.taula-nav__logo-img {
  display: block;
  height: 55px;
  width: auto;
  /* White logo on dark hero — inverts to black when scrolled */
  filter: none;
  transition: filter 0.3s ease;
}

.taula-nav.is-scrolled .taula-nav__logo-img {
  filter: invert(1);
}

/* ── Centre nav links ───────────────────────────────────────────────────── */
.taula-nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.taula-nav__link {
  font-family: 'Staatliches', sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-color: transparent;
  color: #ffffff;
  transition: color 0.3s ease, text-decoration-color 0.25s ease;
}

.taula-nav__link:hover {
  text-decoration-color: currentColor;
}

.taula-nav.is-scrolled .taula-nav__link {
  color: #000000;
}

/* ── Right cluster ──────────────────────────────────────────────────────── */
.taula-nav__right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* ── Icon buttons (account + cart) ─────────────────────────────────────── */
.taula-nav__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s ease, opacity 0.2s ease;
}

.taula-nav__icon-btn:hover {
  opacity: 0.7;
}

.taula-nav.is-scrolled .taula-nav__icon-btn {
  color: #000000;
}

/* Cart count badge */
.taula-nav__cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--color-accent);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  display: none; /* shown by JS when count > 0 */
}

.taula-nav__cart-count[data-count]:not([data-count="0"]) {
  display: block;
}

/* ── Language switcher ──────────────────────────────────────────────────── */
.taula-nav__lang {
  position: relative;
}

.taula-nav__lang-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 4px 6px;
  cursor: pointer;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.3s ease, opacity 0.2s ease;
  white-space: nowrap;
}

.taula-nav__lang-trigger:hover {
  opacity: 0.7;
}

.taula-nav.is-scrolled .taula-nav__lang-trigger {
  color: #000000;
}

.taula-nav__lang-caret {
  transition: transform 0.2s ease;
}

.taula-nav__lang[aria-expanded="true"] .taula-nav__lang-caret,
.taula-nav__lang-trigger[aria-expanded="true"] .taula-nav__lang-caret {
  transform: rotate(180deg);
}

/* Dropdown */
.taula-nav__lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 64px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.taula-nav__lang-dropdown.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.taula-nav__lang-opt {
  display: block;
  width: 100%;
  padding: 7px 14px;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #000000;
  cursor: pointer;
  transition: background 0.15s ease;
}

.taula-nav__lang-opt:hover {
  background: rgba(0, 0, 0, 0.05);
}

.taula-nav__lang-opt.is-active {
  font-weight: 700;
}

/* ── ORDER NOW CTA button ───────────────────────────────────────────────── */
.taula-nav__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  background: #ffffff;
  color: #000000;
  border: 1px solid #000000;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.taula-nav__cta:hover {
  background: #000000;
  color: #ffffff;
}

/* ── Mobile hamburger ───────────────────────────────────────────────────── */
.taula-nav__hamburger {
  display: none; /* hidden on desktop */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.taula-nav__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: background 0.3s ease, transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}

.taula-nav.is-scrolled .taula-nav__bar {
  background: #000000;
}

/* Hamburger → X animation */
.taula-nav__hamburger[aria-expanded="true"] .taula-nav__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.taula-nav__hamburger[aria-expanded="true"] .taula-nav__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.taula-nav__hamburger[aria-expanded="true"] .taula-nav__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile drawer ──────────────────────────────────────────────────────── */
.taula-nav__mobile-drawer {
  display: none; /* shown on mobile */
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 16px 24px 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  /* Collapsed by default */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
}

.taula-nav__mobile-drawer.is-open {
  max-height: 400px;
  opacity: 1;
  padding: 16px 24px 24px;
}

.taula-nav__mobile-link {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: #000000;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: block;
  transition: opacity 0.2s ease;
}

.taula-nav__mobile-link:hover {
  opacity: 0.6;
}

.taula-nav__mobile-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  padding: 12px 24px;
  background: #ffffff;
  color: #000000;
  border: 1px solid #000000;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  align-self: flex-start;
  transition: background 0.2s ease, color 0.2s ease;
}

.taula-nav__mobile-cta:hover {
  background: #000000;
  color: #ffffff;
}

/* ── Responsive breakpoint ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .taula-nav__links {
    display: none;
  }

  .taula-nav__right {
    display: none;
  }

  .taula-nav__hamburger {
    display: flex;
  }

  .taula-nav__mobile-drawer {
    display: flex;
  }
}

@media (max-width: 480px) {
  .taula-nav__inner {
    padding: 0 20px;
  }
}

/* ── Forced dark nav on pages with white backgrounds ────────────────────────
   These pages have no dark hero behind the nav, so transparent + white text
   would be invisible. Apply the same visual state as .is-scrolled from load.
   body.taula-checkout-page  — page-checkout.php
   body.taula-product-page   — templates/template-product-page.php
   body.page-template-page-contact-php — page-contact.php (WP auto-class)
   ─────────────────────────────────────────────────────────────────────────── */
body.taula-checkout-page .taula-nav,
body.taula-product-page .taula-nav,
body.page-template-page-contact-php .taula-nav {
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

body.taula-checkout-page .taula-nav .taula-nav__logo-img,
body.taula-product-page .taula-nav .taula-nav__logo-img,
body.page-template-page-contact-php .taula-nav .taula-nav__logo-img {
  filter: invert(1);
}

body.taula-checkout-page .taula-nav .taula-nav__link,
body.taula-product-page .taula-nav .taula-nav__link,
body.page-template-page-contact-php .taula-nav .taula-nav__link {
  color: #000000;
}

body.taula-checkout-page .taula-nav .taula-nav__icon-btn,
body.taula-product-page .taula-nav .taula-nav__icon-btn,
body.page-template-page-contact-php .taula-nav .taula-nav__icon-btn {
  color: #000000;
}

body.taula-checkout-page .taula-nav .taula-nav__lang-trigger,
body.taula-product-page .taula-nav .taula-nav__lang-trigger,
body.page-template-page-contact-php .taula-nav .taula-nav__lang-trigger {
  color: #000000;
}

body.taula-checkout-page .taula-nav .taula-nav__bar,
body.taula-product-page .taula-nav .taula-nav__bar,
body.page-template-page-contact-php .taula-nav .taula-nav__bar {
  background: #000000;
}
