/* PepLab Co — global styles */
:root {
  --navy-deep: #0B2545;
  --navy-mid: #1E3A6F;
  --navy-soft: #3B5998;
  --champagne: #C9A961;
  --champagne-light: #E8D9A8;
  --cream: #F5F1E8;
  --ivory: #FAF7F0;
  --white: #FFFFFF;
  --graphite: #1A1A1A;
  --gray-text: #4A4A4A;
  --gray-line: #E5E7EB;
  --success: #2D6A4F;
  --whatsapp: #25D366;

  --serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--graphite);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body { overflow-x: hidden; }

img, svg { display: block; max-width: 100%; }

.serif {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.mono {
  font-family: var(--mono);
  font-feature-settings: "ss01", "ss02";
}

.uppercase-eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 768px) {
  .container { padding: 0 20px; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 28px;
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--champagne);
  color: var(--navy-deep);
}
.btn-primary:hover {
  background: #B8985A;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(11, 37, 69, 0.18);
}
.btn-outline-light {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.45);
}
.btn-outline-light:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--white);
}
.btn-outline-dark {
  background: transparent;
  color: var(--navy-deep);
  border: 1.5px solid var(--navy-deep);
}
.btn-outline-dark:hover {
  background: var(--navy-deep);
  color: var(--white);
}
.btn-whatsapp {
  background: var(--whatsapp);
  color: var(--white);
}
.btn-whatsapp:hover {
  background: #1FB957;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.3);
}

.btn-sm { height: 44px; padding: 0 20px; font-size: 14px; }

/* WhatsApp icon */
.wa-icon {
  width: 18px; height: 18px; flex-shrink: 0;
}

/* Reduce motion */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
  transition-duration: 0.01ms !important;
  animation-duration: 0.01ms !important;
}

/* Selection */
::selection { background: var(--champagne); color: var(--navy-deep); }

/* Scrollbar tweak */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ivory); }
::-webkit-scrollbar-thumb { background: var(--navy-soft); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy-mid); }

/* Hairline */
.hairline {
  height: 1px;
  background: var(--champagne);
  width: 48px;
  display: block;
}
.hairline-light { background: rgba(201, 169, 97, 0.5); }

/* Vial placeholder (striped) */
.vial-placeholder {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background:
    repeating-linear-gradient(
      135deg,
      var(--cream) 0 14px,
      var(--ivory) 14px 28px
    );
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Lifestyle placeholder */
.lifestyle-placeholder {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(201, 169, 97, 0.10) 0 18px,
      rgba(245, 241, 232, 0.6) 18px 36px
    ),
    linear-gradient(135deg, #2A4570 0%, #0B2545 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.placeholder-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy-mid);
  background: var(--white);
  padding: 6px 12px;
  border: 1px solid var(--gray-line);
  border-radius: 2px;
  white-space: nowrap;
}
.placeholder-label.dark {
  color: var(--cream);
  background: rgba(11, 37, 69, 0.7);
  border-color: rgba(201, 169, 97, 0.3);
  backdrop-filter: blur(4px);
}

/* Fade up */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up {
  animation: fadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Marquee/ticker */
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Spinner for loading states (e.g. MP checkout creation) */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Cart toast — mobile positioning (avoid colliding with header) */
@media (max-width: 600px) {
  .cart-toast {
    top: 84px !important;
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
  }
}

/* ──────────────────────────────────────────────────────────────────
   RESPONSIVE — mobile-first overrides
   Order: tablet (≤1024) → mobile (≤768) → small mobile (≤480)
   ────────────────────────────────────────────────────────────────── */

/* Header desktop/mobile visibility */
.pl-nav-mobile { display: none !important; }
@media (max-width: 900px) {
  .pl-nav-desktop { display: none !important; }
  .pl-nav-mobile { display: flex !important; }
}

/* Tablet & below ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  /* Reduce vertical padding on big sections */
  section[style*="padding: \"120px 0\""],
  section[style*="120px 0"] { padding-top: 80px !important; padding-bottom: 80px !important; }
  section[style*="140px 0"] { padding-top: 96px !important; padding-bottom: 96px !important; }
  section[style*="96px 0"]  { padding-top: 72px !important; padding-bottom: 72px !important; }

  /* Hero — keep min-height but reduce excessive top padding (76 + 80 was 156) */
  section[style*="minHeight: \"100vh\""],
  section[style*="minHeight: 100vh"] {
    min-height: auto !important;
    padding: 120px 0 80px !important;
  }

  /* Hero meta strip — reduce top margin */
  section[style*="minHeight: 100vh"] .mono { margin-top: 48px !important; }

  /* Editorial absolute citation — disable absolute positioning on tablet */
  section[style*="navy-deep"] div[style*="bottom: -32"],
  section[style*="navy-deep"] div[style*="bottom: -32px"] {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    margin-top: 16px;
    max-width: 100% !important;
  }

  /* Stats grid in Editorial — 1 col */
  section[style*="navy-deep"] [style*="repeat(3, 1fr)"][style*="paddingTop: 40"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
  }

  /* Article hero typography */
  section[style*="navy-deep"][style*="140px 0 80px"] h1 {
    font-size: clamp(32px, 6vw, 56px) !important;
  }
}

/* Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Hero — even tighter */
  section[style*="minHeight: 100vh"] {
    padding: 100px 0 64px !important;
  }
  section[style*="minHeight: 100vh"] [style*="maxWidth: 880"] > div:last-child {
    margin-top: 32px !important;
  }

  /* Section padding tighter */
  section[style*="120px 0"] { padding-top: 64px !important; padding-bottom: 64px !important; }
  section[style*="140px 0"] { padding-top: 64px !important; padding-bottom: 64px !important; }
  section[style*="96px 0"]  { padding-top: 56px !important; padding-bottom: 56px !important; }
  section[style*="80px 0"]  { padding-top: 48px !important; padding-bottom: 48px !important; }

  /* TrustStrip — 2 cols, no border-left */
  section[style*="cream"][style*="56px 0"] [style*="repeat(4, 1fr)"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 28px !important;
  }
  section[style*="cream"][style*="56px 0"] > .container > div > div {
    border-left: none !important;
    padding: 0 !important;
  }

  /* ProductsSection grid 4 cols → 2 cols */
  section#productos [style*="repeat(4, 1fr)"][style*="gap: 24"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 18px !important;
  }

  /* HowToBuy steps grid 4 → 2 */
  section#como-comprar [style*="repeat(4, 1fr)"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 18px !important;
  }
  /* Hide the arrow connectors on tablet/mobile */
  .how-to-buy-arrow { display: none !important; }
  /* Stack the promo banner content */
  .how-to-buy-promo { padding: 24px 24px !important; }
  .how-to-buy-promo > a { width: 100% !important; }

  /* Article featured 1.1fr 1fr → 1 col */
  section#articulos a[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  section#articulos a[style*="grid-template-columns"] > div:first-child {
    aspect-ratio: 16/10 !important;
  }

  /* Article rest grid 4 → 2 */
  section#articulos > .container > div[style*="repeat(4, 1fr)"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }

  /* Article header 1fr 1fr stack */
  section#articulos > .container > div[style*="grid-template-columns: \"1fr 1fr\""],
  section#articulos > .container > div[style*="alignItems: \"end\""] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* FAQ stacked (sidebar above content) */
  section#faq > .container > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
  section#faq [style*="position: sticky"] {
    position: relative !important;
    top: auto !important;
  }

  /* Footer 4 cols → 2 cols */
  footer [style*="grid-template-columns"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 36px !important;
  }
  footer [style*="justify-content: space-between"][style*="flex-wrap: wrap"] {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* ProductDrawer narrower padding */
  div[style*="height: 100vh"][style*="background: var(--white)"] [style*="padding: \"40px 32px\""],
  div[style*="height: 100vh"][style*="background: var(--white)"] [style*="padding: \"48px 32px\""] {
    padding: 28px 22px !important;
  }
  div[style*="height: 100vh"][style*="background: var(--white)"] [style*="repeat(2, 1fr)"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }

  /* Testimonials grid */
  section[style*="cream"][style*="120px 0"] [style*="repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  /* Editorial content gap */
  section[style*="navy-deep"][style*="140px 0"] [style*="grid-template-columns: \"1fr 1.1fr\""] {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }

  /* Hide AestheticToggle text label optionally — keep but smaller */
  .aesthetic-toggle-pill {
    bottom: 16px !important;
    left: 16px !important;
  }
  .aesthetic-toggle-pill button {
    padding: 7px 12px !important;
    font-size: 10px !important;
    letter-spacing: 0.1em !important;
  }

  /* Sticky WhatsApp smaller */
  a[aria-label="Conversemos por WhatsApp"][style*="bottom: 28"] {
    bottom: 16px !important;
    right: 16px !important;
    width: 52px !important;
    height: 52px !important;
  }

  /* Buttons full-height in btn-sm shouldn't overflow */
  .btn-sm { padding: 0 14px !important; font-size: 13px !important; }

  /* Article body — TOC stacked */
  .article-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  .article-toc { position: relative !important; top: auto !important; }
  .article-toc nav { padding-left: 12px !important; }

  /* Article hero padding */
  section[style*="navy-deep"][style*="140px 0 80px"] {
    padding: 110px 0 60px !important;
  }
  section[style*="navy-deep"][style*="140px 0 80px"] h1 {
    font-size: clamp(28px, 7vw, 44px) !important;
    line-height: 1.1 !important;
  }
  section[style*="navy-deep"][style*="140px 0 80px"] p[style*="fontSize: 20"] {
    font-size: 16px !important;
  }

  /* Article image overlap negative margin reduce */
  div.container[style*="marginTop: -40"] { margin-top: -24px !important; }

  /* Article TOC eyebrow margin tighter */
  .article-toc > div { margin-bottom: 12px !important; }

  /* AgeGate modal padding */
  div[style*="position: fixed"][style*="zIndex: 100"] > div {
    padding: 36px 24px !important;
  }
}

/* Small mobile ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* TrustStrip — 1 col */
  section[style*="cream"][style*="56px 0"] [style*="repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* ProductsSection — 1 col */
  section#productos [style*="repeat(4, 1fr)"][style*="gap: 24"] {
    grid-template-columns: 1fr !important;
  }

  /* HowToBuy — 1 col */
  section#como-comprar [style*="repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Article rest grid 1 col */
  section#articulos > .container > div[style*="repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* PaymentOptions — stack */
  .payment-options-grid {
    flex-direction: column !important;
  }

  /* Footer 1 col */
  footer [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  /* Hero typography tighter */
  section[style*="minHeight: 100vh"] h1 {
    line-height: 1.05 !important;
  }
  section[style*="minHeight: 100vh"] [style*="fontSize: 19"] {
    font-size: 16px !important;
  }
  section[style*="minHeight: 100vh"] .mono {
    gap: 16px !important;
    font-size: 10px !important;
  }

  /* CTA Final inner buttons stack */
  section[style*="navy-deep"][style*="120px 0"] [style*="display: \"inline-flex\""][style*="gap: 14"] {
    flex-direction: column !important;
    width: 100% !important;
  }
  section[style*="navy-deep"][style*="120px 0"] [style*="display: \"inline-flex\""][style*="gap: 14"] > a {
    width: 100% !important;
  }

  /* Stats grid 2 → 1 */
  section[style*="navy-deep"] [style*="repeat(3, 1fr)"][style*="paddingTop: 40"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* ProductDrawer — even tighter */
  div[style*="height: 100vh"][style*="background: var(--white)"] h2[class*="serif"] {
    font-size: 36px !important;
  }
  div[style*="height: 100vh"][style*="background: var(--white)"] [style*="repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* AestheticToggle even smaller */
  .aesthetic-toggle-pill button {
    padding: 6px 10px !important;
    font-size: 9px !important;
  }
}
