/* ==========================================================================
   PeptixHouse — Header compartido (idéntico al de index.html)
   Usado por páginas internas como /carrito.html que no cargan el CSS
   inline completo de la home. Mantener en sync con el <style> de index.html
   si el header cambia ahí.
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 2px solid #ADDBCA;
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* === HEADER === */
.header {
  --header-mint-old: #94e1d4;
  --header-bg-old: #252a2a;
  --header-silver-old: #b0b0b0;
  /* El resto de la página puede usar Inter (checkout, carrito), pero el
     header debe verse idéntico al de index.html, que usa Montserrat. */
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: color-mix(in srgb, var(--header-bg-old) 88%, transparent);
  border-bottom: 2px solid var(--header-mint-old);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, backdrop-filter 0.3s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 64px;
  padding-block: 0.5rem;
}

.logo {
  display: flex;
  align-items: center;
  line-height: 1;
}

.logo img {
  display: block;
  height: clamp(28px, 3vw, 34px);
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
}

.nav-link {
  color: var(--header-silver-old);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  padding-block: 0.5rem;
}

.nav-link::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--header-mint-old);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.nav-link:hover {
  color: var(--header-mint-old);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-link--pro {
  color: var(--header-mint-old);
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--header-mint-old) 55%, transparent);
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nav-link--pro::after {
  display: none;
}

.nav-link--pro:hover {
  background: color-mix(in srgb, var(--header-mint-old) 16%, transparent);
  border-color: var(--header-mint-old);
  color: var(--header-mint-old);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #FFFFFF;
  border: 1px solid color-mix(in srgb, var(--header-mint-old) 35%, transparent);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.icon-btn:hover {
  background: color-mix(in srgb, var(--header-mint-old) 18%, transparent);
  border-color: var(--header-mint-old);
  color: var(--header-mint-old);
}

/* Badge del carrito sobre el icon-btn */
.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  background: #ADDBCA;
  color: #3F5450;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  line-height: 1;
}

/* Badge de "Mis pedidos" (historial en localStorage): inline, junto al texto */
.mis-pedidos-badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  width: fit-content;
  height: 16px;
  padding: 0 4px;
  margin-left: 2px;
  border-radius: 999px;
  background: #B8DDD1;
  color: #1A2332;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.hamburger {
  display: none;
  width: 36px;
  height: 36px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  z-index: 1100;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: #FFFFFF;
  border-radius: 2px;
  transition: transform 0.35s ease, opacity 0.35s ease;
  transform-origin: center;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* === MENÚ MÓVIL === */
.mobile-menu {
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1.75rem 1.5rem calc(1.75rem + env(safe-area-inset-bottom, 0px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.mobile-menu.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu .nav-link.mm-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: min(360px, 88vw);
  padding: 0.85rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(90, 154, 135, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #f7faf9 100%);
  box-shadow:
    0 1px 2px rgba(47, 65, 62, 0.04),
    0 6px 18px rgba(47, 65, 62, 0.05);
  color: #2f413e;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.45s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.mobile-menu .nav-link.mm-card::after {
  display: none;
}

.mobile-menu.active .nav-link.mm-card {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu .nav-link.mm-card:hover,
.mobile-menu .nav-link.mm-card:focus-visible {
  border-color: rgba(90, 154, 135, 0.4);
  box-shadow:
    0 2px 4px rgba(47, 65, 62, 0.05),
    0 12px 28px rgba(47, 65, 62, 0.09);
  transform: translateY(-2px);
  outline: none;
}

.mobile-menu .nav-link.mm-card:active {
  transform: translateY(0) scale(0.99);
}

.mm-card__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: #ffffff;
  border: 1px solid rgba(90, 154, 135, 0.16);
  box-shadow: 0 1px 3px rgba(47, 65, 62, 0.05);
  color: #5a9a87;
}

.mm-card__icon svg {
  width: 21px;
  height: 21px;
}

.mm-card__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.mm-card__sub {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: #8aa39c;
}

.mm-card__chev {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: rgba(90, 154, 135, 0.55);
  transition: transform 0.25s ease, color 0.25s ease;
}

.mm-card__chev svg {
  width: 18px;
  height: 18px;
}

.mobile-menu .nav-link.mm-card:hover .mm-card__chev {
  transform: translateX(3px);
  color: #5a9a87;
}

.mobile-menu .nav-link.mm-card--pro {
  border-color: rgba(90, 154, 135, 0.4);
  background: linear-gradient(180deg, #f2faf7 0%, #e9f5f0 100%);
  box-shadow:
    0 1px 2px rgba(47, 65, 62, 0.05),
    0 10px 26px rgba(90, 154, 135, 0.14);
  font-weight: 600;
}

.mobile-menu .nav-link.mm-card--pro .mm-card__icon {
  background: linear-gradient(180deg, #7ec8ae 0%, #5a9a87 100%);
  color: #ffffff;
}

.mobile-menu .nav-link.mm-card--pro .mm-card__label {
  color: #3f5450;
}

.mobile-menu.active .nav-link.mm-card:nth-child(1) { transition-delay: 0.08s; }
.mobile-menu.active .nav-link.mm-card:nth-child(2) { transition-delay: 0.14s; }
.mobile-menu.active .nav-link.mm-card:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.active .nav-link.mm-card:nth-child(4) { transition-delay: 0.26s; }
.mobile-menu.active .nav-link.mm-card:nth-child(5) { transition-delay: 0.32s; }

.mobile-menu-exit {
  margin-top: 0.6rem;
  min-height: 46px;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  border: 1px solid rgba(63, 84, 80, 0.18);
  background: rgba(255, 255, 255, 0.7);
  color: #6a827c;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.mobile-menu.active .mobile-menu-exit {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.4s;
}

.mobile-menu-exit:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(90, 154, 135, 0.4);
  color: #5a9a87;
}

@media (max-width: 1024px) {
  .nav { gap: 1rem; }
  .nav-link { font-size: 14px; }
}

@media (max-width: 768px) {
  .header-inner { gap: 1rem; }
  .nav { display: none; }
  .hamburger { display: flex; }
  .logo img {
    height: 30px;
    min-height: 30px;
  }
}
