/*
 * LAYOUT STYLES — MC-EDEN
 * Navbar (fixed, transparent → solid), mobile menu, footer
 */

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

/* === NAVBAR === */
.header,
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-sticky);
  transition: background 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
#navbar.scrolled {
  background: rgba(14, 14, 14, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ash);
}

.nav-inner {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-family-heading);
  font-size: 1.3rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ghost);
  white-space: nowrap;
}
.nav-logo:hover { color: var(--ghost); }
.nav-logo svg { color: var(--gold); flex-shrink: 0; }
.nav-logo-img { height: 38px; width: auto; }

.nav-mode-toggle {
  display: flex;
  align-items: center;
  background: var(--carbon);
  border: 1px solid var(--ash);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
  flex-shrink: 0;
}
.mode-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: none;
  cursor: pointer;
  font-family: var(--font-family-heading);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 3px;
  transition: all var(--transition-normal);
  background: transparent;
  color: rgba(244, 244, 244, 0.45);
  min-height: 36px;
}
.mode-btn svg { flex-shrink: 0; }
.mode-btn.active,
.mode-btn.is-active { background: var(--gold); color: var(--obsidian); }
.mode-btn:not(.active):not(.is-active):hover { color: var(--gold); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
}
.nav-links a {
  font-family: var(--font-family);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--transition-normal);
}
.nav-links a:hover { color: var(--gold); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nav-cta { white-space: nowrap; }

/* Cart icon (spécifique à l'app) */
.nav-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  color: var(--ghost);
  border: 1px solid var(--ash);
  background: var(--carbon);
  transition: all var(--transition-normal);
}
.nav-cart:hover { color: var(--gold); border-color: var(--gold); }
.nav-cart svg { width: 20px; height: 20px; }
.cart-count-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--gold);
  color: var(--obsidian);
  font-family: var(--font-family-heading);
  font-size: 11px;
  font-weight: 800;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--obsidian);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
  min-height: 44px; min-width: 44px;
  align-items: center; justify-content: center;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--ghost); border-radius: 2px;
  transition: all 0.3s;
}

/* Mobile menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1.5rem var(--container-padding) 2rem;
  background: rgba(14, 14, 14, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--ash);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}
.mobile-menu.open { display: flex; max-height: 640px; }
.mobile-menu a {
  font-family: var(--font-family-heading);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(244, 244, 244, 0.8);
  transition: color var(--transition-normal);
}
.mobile-menu a:hover { color: var(--gold); }
.mobile-mode-toggle {
  display: flex;
  align-items: center;
  background: var(--carbon);
  border: 1px solid var(--ash);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
  margin-bottom: 0.5rem;
}
.mobile-mode-toggle .mode-btn { flex: 1; justify-content: center; }

/* Modale de mode de commande (centrée, thème navbar) */
.mode-modal[hidden] { display: none; }
.mode-modal {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.mode-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.mode-modal-card {
  position: relative;
  width: min(440px, 100%);
  max-height: 90vh; overflow-y: auto;
  background: var(--carbon);
  border: 1px solid var(--ash);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  animation: modePop 0.25s ease both;
}
@keyframes modePop { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.mode-modal-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  color: var(--text-muted); border: 1px solid var(--ash); background: transparent;
  display: flex; align-items: center; justify-content: center;
}
.mode-modal-close:hover { color: var(--gold); border-color: var(--gold); }
.mode-modal-title {
  font-family: var(--font-family-heading);
  text-transform: uppercase; color: var(--ghost);
  font-size: 1.6rem; margin: 0;
}
.mode-modal-sub { color: var(--text-muted); font-size: 0.9rem; margin: 0.3rem 0 1.5rem; }

.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 1.2rem; }
.mode-option {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  padding: 1.3rem 1rem; text-align: center;
  background: var(--obsidian);
  border: 1px solid var(--ash);
  border-radius: var(--radius-md);
  color: var(--ghost);
  transition: border-color var(--transition-normal), background var(--transition-normal);
}
.mode-option svg { color: var(--gold); }
.mode-option:hover { border-color: rgba(229, 184, 11, 0.5); }
.mode-option.active { border-color: var(--gold); background: rgba(229, 184, 11, 0.08); }
.mode-option-name { font-family: var(--font-family-heading); text-transform: uppercase; font-weight: 800; font-size: 1rem; }
.mode-option-desc { font-size: 0.75rem; color: var(--text-muted); }

.mode-delivery[hidden] { display: none; }
.mode-delivery { margin-bottom: 1.2rem; }
.mode-delivery label { color: var(--text-muted); }

.mode-addr-wrap { position: relative; margin-bottom: 0.8rem; }
.mode-suggestions {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--obsidian);
  border: 1px solid var(--ash); border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 200px; overflow-y: auto; z-index: 5; display: none;
}
.mode-suggestions.open { display: block; }
.mode-sug { padding: 10px 12px; cursor: pointer; font-size: 0.9rem; border-bottom: 1px solid var(--ash); }
.mode-sug:last-child { border-bottom: none; }
.mode-sug:hover { background: rgba(229, 184, 11, 0.1); color: var(--gold); }
.mode-msg { font-size: 0.85rem; margin: 0 0 0.6rem; }
.mode-msg[hidden] { display: none; }
.mode-msg--info { color: var(--ghost); }
.mode-msg--info strong { color: var(--gold); }
.mode-msg--load { color: var(--text-muted); font-style: italic; }
.mode-msg--err { color: var(--color-error); }

@media (max-width: 480px) {
  .mode-modal { align-items: flex-end; padding: 0; }
  .mode-modal-card {
    width: 100%; border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  }
}

/* === SPACER / MAIN === */
.header-spacer { height: var(--header-height); }
.main {
  min-height: calc(100vh - var(--header-height) - 300px);
  padding: 2rem 0 4rem;
}

/* === 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);
  max-width: 360px;
}
.flash {
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  border-left: 3px solid;
  background: var(--carbon);
  color: var(--ghost);
  animation: slideIn var(--transition-normal);
}
.flash-success { border-left-color: var(--color-success); }
.flash-error   { border-left-color: var(--color-error); }
.flash-warning { border-left-color: var(--gold); }
.flash-info    { border-left-color: var(--color-info); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* === FOOTER === */
.footer { background: #0A0A0A; border-top: 1px solid var(--ash); }

.footer-cta { background: var(--gold); }
.footer-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-top: 3rem;
  padding-bottom: 3rem;
}
.footer-cta h2 {
  font-family: var(--font-family-heading);
  font-size: 2rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--obsidian);
  margin: 0;
}
.footer-cta p { color: rgba(14, 14, 14, 0.65); font-size: 0.9rem; margin: 0.2rem 0 0; }

.footer-main { padding: 4rem 0 0; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}
.footer-brand .nav-logo { color: var(--ghost); margin-bottom: 1rem; }
.footer-brand p { color: rgba(244, 244, 244, 0.45); font-size: 0.85rem; line-height: 1.7; }
.footer-col h4 {
  font-family: var(--font-family-heading);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 1rem;
}
.footer-col p {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: rgba(244, 244, 244, 0.45);
  font-size: 0.85rem;
  line-height: 1.65;
  margin-bottom: 0.6rem;
}
.footer-col p svg { color: var(--gold); flex-shrink: 0; margin-top: 2px; }
.footer-col a { color: rgba(244, 244, 244, 0.45); transition: color var(--transition-normal); }
.footer-col a:hover { color: var(--gold); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem var(--container-padding);
  border-top: 1px solid var(--ash);
}
.footer-bottom p { color: rgba(244, 244, 244, 0.2); font-size: 0.75rem; margin: 0; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: rgba(244, 244, 244, 0.2); font-size: 0.75rem; transition: color var(--transition-normal); }
.footer-links a:hover { color: var(--gold); }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .nav-links,
  .nav-cta,
  .nav-mode-toggle { display: none !important; }
  .nav-hamburger { display: flex; }
  .nav-actions { margin-left: auto; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-cta-inner { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
