/* ============================================================
   header-footer.css
   ============================================================ */

/* ---------- HEADER ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background: var(--color-navy-950);
  box-shadow: var(--shadow-sm);
}

.site-header__topbar {
  height: 64px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.site-header__burger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.site-header__burger span {
  width: 20px; height: 2px;
  background: var(--color-white);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header__logo {
  min-width: 0;
  flex: 1;
  display: flex;
}

.site-header__logo img { display: block; max-width: 140px; height: auto; }

.site-header__topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.site-header__circle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.5);
  color: var(--color-white);
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease;
}

.site-header__circle-btn:hover { border-color: var(--color-white); }

.site-header__circle-btn--filled {
  background: var(--color-white);
  color: var(--color-navy-950);
  border-color: var(--color-white);
}

.site-header__cart-count {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--color-accent-500);
  color: var(--color-white);
  font-size: 11px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--color-navy-950);
}

.site-header__searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-4) var(--space-3);
  color: var(--color-steel-500);
}

.site-header__searchbar svg { flex-shrink: 0; }

.site-header__searchbar input {
  width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--color-white);
  color: var(--color-navy-900);
}

.site-header__searchbar input::placeholder { color: var(--color-steel-500); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-family: var(--font-body);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn--primary {
  background: var(--color-accent-500);
  color: var(--color-white);
}

.btn--primary:hover {
  background: var(--color-accent-600);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.site-header__account-menu { position: relative; }

.site-header__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--color-white);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  min-width: 200px;
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
}

.site-header__dropdown[hidden] { display: none; }

.site-header__dropdown-admin {
  color: var(--color-accent-600) !important;
  font-weight: 700;
  border-top: 1px solid var(--color-steel-100);
  margin-top: 4px;
  padding-top: 10px !important;
}

.site-header__dropdown a,
.site-header__dropdown button {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-navy-900);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}

.site-header__dropdown #logout-btn { color: var(--color-danger); font-weight: 600; }

.site-header__dropdown a:hover,
.site-header__dropdown button:hover { background: var(--color-steel-100); }

.site-header__dropdown #logout-btn:hover { background: #fdecea; }

.site-header__mobile-menu {
  background: var(--color-white);
  border-top: 1px solid var(--color-steel-100);
  padding: var(--space-3) var(--space-4);
  max-width: 1280px;
  margin: 0 auto;
}

.site-header__mobile-menu ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
}

.site-header__mobile-menu-title {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-steel-500);
}

.site-header__mobile-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  text-decoration: none;
  color: var(--color-navy-900);
  font-weight: 500;
  border-bottom: 1px solid var(--color-steel-100);
}

.site-header__mobile-menu-chevron {
  color: var(--color-steel-300);
  font-weight: 400;
}

.site-header__mobile-menu--secondary {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
}

.site-header__mobile-menu--secondary a {
  font-weight: 400;
  color: var(--color-steel-500);
}

@media (max-width: 420px) {
  .site-header__topbar { gap: 8px; padding: 0 var(--space-3); }
  .site-header__logo img { max-width: 110px; }
  .site-header__circle-btn { width: 34px; height: 34px; }
}


/* ---------- TIROIR PANIER ---------- */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 26, 0.5);
  z-index: 300;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cart-drawer-overlay.is-open { opacity: 1; }

.cart-drawer {
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: var(--color-white);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.cart-drawer-overlay.is-open .cart-drawer { transform: translateX(0); }

.cart-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-steel-100);
}

.cart-drawer__header h2 { margin: 0; font-size: 18px; }

.cart-drawer__close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--color-steel-500);
}

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
}

.cart-drawer__loading { text-align: center; color: var(--color-steel-500); padding: var(--space-6) 0; }

.cart-drawer__empty { text-align: center; padding: var(--space-6) 0; display: flex; flex-direction: column; gap: var(--space-3); align-items: center; }

.cart-drawer__line {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-steel-100);
}

.cart-drawer__line-media { width: 72px; height: 56px; border-radius: var(--radius-sm); overflow: hidden; display: block; }
.cart-drawer__line-media img { width: 100%; height: 100%; object-fit: cover; }

.cart-drawer__line-name { font-size: 14px; font-weight: 600; color: var(--color-navy-950); text-decoration: none; display: block; margin-bottom: 2px; }
.cart-drawer__line-options { font-size: 12px; color: var(--color-steel-500); margin: 0 0 4px; }
.cart-drawer__line-price { font-size: 14px; font-weight: 700; margin: 0 0 6px; }

.cart-drawer__line-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }

.quantity-stepper--sm { transform: scale(0.9); transform-origin: left center; }

.cart-drawer__remove {
  background: none;
  border: none;
  color: var(--color-steel-500);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}
.cart-drawer__remove:hover { color: var(--color-danger); }

.cart-drawer__footer {
  padding: var(--space-4);
  border-top: 1px solid var(--color-steel-100);
}

.cart-drawer__total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}

.cart-drawer__note { font-size: 12px; color: var(--color-steel-500); margin-bottom: var(--space-3); }

.cart-drawer__view-cart, .cart-drawer__checkout { width: 100%; justify-content: center; margin-bottom: 8px; }

@media (max-width: 480px) { .cart-drawer { max-width: 100%; } }


/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--color-navy-950);
  color: var(--color-steel-300);
  margin-top: var(--space-8);
}

.site-footer__reassurance {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  border-bottom: 1px solid var(--color-navy-700);
}

.reassurance-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-white);
  font-size: 14px;
  font-weight: 500;
}

.reassurance-item svg { color: var(--color-accent-500); flex-shrink: 0; }

.site-footer__main {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-4);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.site-footer__col h4 {
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 15px;
  margin-bottom: var(--space-3);
}

.site-footer__col ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: var(--space-2);
}

.site-footer__col a {
  color: var(--color-steel-300);
  text-decoration: none;
  font-size: 14px;
}

.site-footer__col a:hover { color: var(--color-white); }

.site-footer__socials {
  display: flex; gap: var(--space-2);
  margin-top: var(--space-3);
}

.site-footer__socials a {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--color-navy-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: var(--color-steel-300);
}

.site-footer__bottom {
  border-top: 1px solid var(--color-navy-700);
  padding: var(--space-3) var(--space-4);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 900px) {
  .site-footer__reassurance,
  .site-footer__main { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .site-footer__reassurance,
  .site-footer__main { grid-template-columns: 1fr; }
}
