/* ============================================================
   MOTO STORE — Client (pages publiques)
   Styles de page spécifiques au-dessus du design system
   ============================================================ */

/* ---------- Boutons WhatsApp (vert de la marque WhatsApp, texte sombre pour le contraste) ---------- */
a.btn-whatsapp,
.btn-whatsapp {
  background: #25d366;
  color: #050505;
  border: 2px solid #25d366;
}
a.btn-whatsapp:hover,
.btn-whatsapp:hover {
  background: #1ebe5a;
  border-color: #1ebe5a;
  color: #050505;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.375rem;
  font-weight: 900;
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand-mark {
  width: 2.5rem; height: 2.5rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-accent), var(--color-danger));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 900;
  box-shadow: var(--shadow-accent);
  flex-shrink: 0;
}
.brand-text { font-family: var(--font-display); white-space: nowrap; }
.brand-logo {
  width: auto;
  height: 2.75rem;
  max-width: 150px;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
  display: block;
}

@media (min-width: 768px) {
  .brand-logo { height: 4rem; }
}

/* Search dans le header — masquée sur mobile, affichée dans la nav */
.header-search {
  display: none;
  flex: 1;
  max-width: 420px;
  margin: 0 1.5rem;
}

/* Actions header */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.header-action-btn {
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  background: var(--color-black-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all var(--transition);
}
.header-action-btn:hover {
  background: var(--color-card);
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.cart-badge {
  position: absolute;
  top: -0.25rem; right: -0.25rem;
  background: var(--color-accent);
  color: #000;
  font-size: 0.65rem;
  font-weight: 900;
  min-width: 1.25rem; height: 1.25rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-black);
}
.cart-badge.visible { display: flex; }

/* Navigation principale */
.site-nav {
  background: var(--color-black-soft);
  border-top: 1px solid var(--color-border);
}
.site-nav .container {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: 0.75rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.site-nav .container::-webkit-scrollbar { display: none; }
.site-nav a {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.site-nav a:hover { color: var(--color-accent); }
.nav-cart {
  color: var(--color-accent);
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.nav-cart-count {
  background: var(--color-accent);
  color: #000;
  font-size: 0.7rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-weight: 900;
}

/* Barre de recherche mobile dans la nav */
.mobile-search {
  display: block;
  padding: 0.75rem 0;
}
.mobile-search input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-black-soft);
  color: var(--color-white);
  font-size: 0.95rem;
}
.mobile-search input:focus { outline: none; border-color: var(--color-accent); }

@media (min-width: 768px) {
  .header-search { display: flex; }
  .header-inner { padding: 1rem 0; }
  .brand { font-size: 1.5rem; }
  .brand-mark { width: 3rem; height: 3rem; }
  .mobile-search { display: none; }
}

/* ---------- Mobile Menu (moderne) ---------- */
.menu-btn { display: grid; place-items: center; }
.menu-btn-lines {
  width: 22px; height: 16px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.menu-btn-lines span {
  display: block; height: 2px; width: 100%;
  background: currentColor; border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}
body.menu-open .menu-btn-lines span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .menu-btn-lines span:nth-child(2) { opacity: 0; }
body.menu-open .menu-btn-lines span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 40;
  display: none;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mobile-menu-overlay.open { display: block; opacity: 1; }

/* Le menu s'ouvre depuis la GAUCHE (côté opposé au bouton hamburger) */
.mobile-menu {
  position: fixed;
  top: 0; left: 0;
  width: min(320px, 86vw); height: 100vh;
  background: var(--color-card);
  border-right: 1px solid var(--color-border);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 10px 0 30px rgba(0,0,0,0.4);
}
.mobile-menu.open { transform: translateX(0); }

.mobile-menu-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.mobile-menu-head .brand-text { font-size: 1.15rem; font-weight: 900; }
.mobile-menu-close {
  margin-left: auto;
  background: var(--color-black-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  cursor: pointer;
}
.mobile-menu-close:hover { border-color: var(--color-accent); color: var(--color-accent); }

.mobile-menu-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--color-text-soft);
  transition: all var(--transition);
}
.menu-link:hover, .menu-link:focus {
  background: var(--color-black-soft);
  color: var(--color-accent);
}
.menu-link-sub {
  padding-left: 1.25rem;
  font-weight: 700;
  font-size: 0.9rem;
}
.menu-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}
.menu-cart-count {
  margin-left: auto;
  background: var(--color-accent);
  color: #000;
  font-size: 0.7rem;
  font-weight: 900;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.375rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-menu-section {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-muted);
  padding: 1.25rem 0.875rem 0.5rem;
}
.whatsapp-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #25d366;
  color: #000;
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 900;
  text-align: center;
  margin: 0.75rem;
  flex-shrink: 0;
}
.whatsapp-mobile:hover { color: #000; background: #1ebe5a; }

/* ---------- Footer ---------- */
/* Pied de page compact : 2 colonnes sur mobile, 4 sur grand écran */
.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-black-soft);
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  padding: 1.25rem 16px 1rem;
}
@media (max-width: 639px) {
  a.floating-whatsapp { width: 2.75rem; height: 2.75rem; bottom: 1rem; right: 1rem; }
  .footer-col h4 { display: none; }
  .footer-inner { padding: 1rem 16px 0.75rem; gap: 0.75rem 1rem; }
}
@media (min-width: 1024px) {
  .footer-inner { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; padding: 2rem 0 1.5rem; }
}
.footer-col h3 {
  font-size: 1rem;
  margin-bottom: 0.375rem;
}
.footer-col h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin-bottom: 0.375rem;
}
.footer-col p {
  font-size: 0.85rem;
  color: var(--color-text-soft);
  margin: 0.125rem 0;
  overflow-wrap: anywhere;
}
.footer-col a { color: var(--color-text-soft); }
.footer-col a:hover { color: var(--color-accent); }
.footer-bottom {
  padding: 0.75rem 16px;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-muted);
}
@media (min-width: 1024px) {
  .footer-bottom { padding: 1rem 0; }
}

/* ---------- Floating WhatsApp ---------- */
.floating-whatsapp {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  width: 3.25rem; height: 3.25rem;
  background: #25d366;
  color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: var(--shadow-accent);
  z-index: 100;
  border: 3px solid #000;
  animation: pulse 2s infinite;
}
.floating-whatsapp:hover { transform: scale(1.1); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); }
  70% { box-shadow: 0 0 0 14px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  font-size: 0.7rem;
  color: var(--color-muted);
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  line-height: 1.6;
}
.breadcrumb a { color: var(--color-accent); white-space: nowrap; }
.breadcrumb a:hover { color: var(--color-accent-hover); }
.breadcrumb .sep { color: var(--color-muted-soft); flex-shrink: 0; }
.breadcrumb .current {
  color: var(--color-white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* ---------- Page spacing ---------- */
.site-main { padding-top: 1.25rem; padding-bottom: 2rem; }
.product-page { padding-bottom: 2rem; }

@media (min-width: 768px) {
  .site-main { padding-top: 1.75rem; }
  .breadcrumb { font-size: 0.78rem; }
}

/* ---------- Prevent horizontal overflow ---------- */
html, body { overflow-x: hidden; max-width: 100%; }
