/*
 * LAYOUT STYLES - Le First (French Tacos)
 * Neon sign on dark brick wall aesthetic
 */

/* === CONTAINER === */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* === HEADER === */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  height: var(--header-height);
  background: rgba(21, 15, 16, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.header-spacer {
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.3rem;
  color: var(--text-main);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
  position: relative;
}

.nav-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.nav-btn:active {
  transform: scale(0.9);
}

.cart-count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 900;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-dark);
  box-shadow: var(--glow-box-accent);
}

/* === MAIN === */
.main {
  min-height: calc(100vh - var(--header-height) - 200px);
  padding: var(--space-8) 0;
}

/* === FOOTER === */
.footer {
  padding: 60px 20px 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  background: rgba(10, 6, 8, 0.95);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), 0.4), transparent);
}

.footer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, rgba(var(--primary-rgb), 0.06), transparent);
  pointer-events: none;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.footer-link {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.footer-link:hover {
  color: var(--primary);
  text-shadow: var(--neon-primary-soft);
  transform: translateY(-2px);
}

.copyright {
  color: var(--text-muted);
  font-size: 0.8rem;
  opacity: 0.6;
}

.footer-contact {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.footer-contact a:hover {
  color: var(--primary);
}

/* === FLASH MESSAGES === */
.flash-messages {
  position: fixed;
  top: calc(var(--header-height) + var(--space-4));
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.flash {
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  box-shadow: var(--shadow-lg);
  animation: slideIn var(--transition-normal);
}

.flash-success { background-color: var(--color-success); color: white; }
.flash-error { background-color: var(--color-error); color: white; }
.flash-warning { background-color: var(--color-warning); color: white; }
.flash-info { background-color: var(--color-info); color: white; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.header-logo img {
  height: 50px;
  width: auto;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.35);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .header-logo img {
    height: 44px;
  }
}

/* === MENU OVERLAY (mobile nav) === */
html.nav-open {
  overflow: hidden;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(15, 11, 2, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: stretch;
  justify-content: flex-end;
}

.nav-overlay.is-open {
  display: flex;
}

.nav-overlay[hidden] {
  display: none !important;
}

.nav-drawer {
  width: min(400px, 100%);
  height: 100%;
  background: #faf6ef;
  border-left: 4px solid var(--primary);
  border-radius: 40px 0 0 40px;
  box-shadow: -40px 0 120px rgba(0, 0, 0, 0.45);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: drawerSlideRight 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes drawerSlideRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* Apparition échelonnée des entrées du menu */
.nav-overlay.is-open .nav-drawer__body > * {
  opacity: 0;
  animation: navItemIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.nav-drawer__body > *:nth-child(1) { animation-delay: 0.06s; }
.nav-drawer__body > *:nth-child(2) { animation-delay: 0.12s; }
.nav-drawer__body > *:nth-child(3) { animation-delay: 0.18s; }
.nav-drawer__body > *:nth-child(4) { animation-delay: 0.24s; }
.nav-drawer__body > *:nth-child(5) { animation-delay: 0.32s; }
@keyframes navItemIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .nav-overlay.is-open .nav-drawer__body > * { opacity: 1; animation: none; }
  .nav-drawer { animation: none; }
}

.nav-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 18px;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.12);
}

.nav-drawer__title {
  font-family: var(--font-family-accent);
  text-transform: none;
  letter-spacing: normal;
  font-size: 1.5rem;
  color: var(--primary);
  text-shadow: var(--neon-primary);
}

.nav-drawer__close {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(43, 36, 24, 0.14);
  background: rgba(43, 36, 24, 0.05);
  border-radius: 999px;
  color: #2b2418;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.nav-drawer__close:hover {
  background: rgba(var(--primary-rgb), 0.2);
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(90deg);
}

.nav-drawer__body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: 14px;
  color: #2b2418;
  font-family: var(--font-family-heading);
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: 1.65rem;
  line-height: 1.05;
  transition: color 0.25s ease, transform 0.25s ease;
}

.nav-item::before {
  content: "";
  width: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
  transition: width 0.25s ease;
}

.nav-item:hover {
  background: transparent;
  transform: translateX(8px);
  color: var(--primary);
  box-shadow: none;
}

.nav-item:hover::before { width: 24px; }

.nav-item--highlight {
  color: var(--primary);
  font-style: italic;
}

.nav-item--highlight::before { width: 24px; }

.nav-item--highlight:hover {
  background: transparent;
  color: var(--primary);
}

.nav-divider {
  margin: 24px 16px 8px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent);
  opacity: 0.8;
  font-style: italic;
}

.nav-drawer__footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
}

.nav-drawer__brand {
  margin: 0;
  font-weight: 600;
  font-family: var(--font-family-accent);
  color: var(--primary);
  text-shadow: var(--neon-primary-soft);
}

.nav-drawer__sub {
  margin: 6px 0 0;
  color: var(--accent);
  font-size: 0.85rem;
  opacity: 0.7;
}

/* === Bouton burger (aspect original : barres inégales, coral au survol) === */
.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  width: 20px;
}

.nav-toggle__bars span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: width 0.25s ease, background 0.25s ease;
}

.nav-toggle__bars span:nth-child(2) { width: 60%; }
.nav-toggle__bars span:nth-child(3) { width: 82%; }
.nav-toggle:hover .nav-toggle__bars span { width: 100%; background: var(--primary); }

/* === Nom de l'enseigne (header) === */
.header-logo-text {
  font-family: var(--font-family-heading);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--primary);
}

/* === Sélecteur mode de commande (À emporter / Livraison) dans le menu === */
.nav-mode {
  display: flex;
  gap: 6px;
  margin: 24px 4px 6px;
  padding: 6px;
  background: rgba(43, 36, 24, 0.06);
  border-radius: 999px;
}

.nav-mode form {
  flex: 1;
  display: flex;
  margin: 0;
}

.nav-mode__btn {
  flex: 1;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #2b2418;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-mode__btn:hover { color: var(--primary); }

.nav-mode__btn.is-active {
  background: var(--primary);
  color: #2b2418;
  box-shadow: 0 6px 16px -6px rgba(var(--primary-rgb), 0.6);
}

.nav-mode__btn.is-active:hover { color: #2b2418; }

/* Icônes SVG de mode (livraison / à emporter) */
.mode-ico { display: block; }
.nav-mode__btn .mode-ico { flex-shrink: 0; }
