/* ==========================================================================
   VENEXA PEPTIDES - CORE DESIGN SYSTEM & THEME TOKENS (theme.css)
   Consolidated Base Stylesheet: Variables, Typography, Header, Marquee,
   Buttons, Form Inputs, Modals, Badges, Toasts & Responsive Navigation.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS & SYSTEM VARIABLES (LIGHT / DARK)
   -------------------------------------------------------------------------- */
:root,
[data-theme="light"] {
  /* Brand Core Palette */
  --color-primary: #0284c7;
  --color-primary-hover: #0369a1;
  --color-teal: #0d9488;
  --color-teal-hover: #0f766e;
  --color-teal-subtle: #f0fdfa;
  --color-cyan: #06b6d4;
  --color-mint: #10b981;
  --color-amber: #f59e0b;
  --color-rose: #ef4444;
  --color-purple: #7c3aed;
  --color-navy: #0f172a;

  /* Aliases for compatibility with tienda / admin / styles */
  --brand-primary: #0284c7;
  --brand-hover: #0369a1;
  --brand-teal: #0d9488;
  --brand-cyan: #06b6d4;
  --brand-mint: #10b981;
  --brand-rose: #ef4444;
  --brand-amber: #f59e0b;
  --brand-navy: #0f172a;

  --admin-navy: #0f172a;
  --admin-teal: #0d9488;
  --admin-cyan: #06b6d4;
  --admin-mint: #10b981;
  --admin-rose: #ef4444;
  --admin-amber: #f59e0b;

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
  --grad-hero: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 50%, #f0f9ff 100%);
  --grad-badge: linear-gradient(135deg, #0d9488 0%, #06b6d4 100%);
  --grad-accent: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  --hero-bg-grad: linear-gradient(180deg, rgba(14, 165, 233, 0.06) 0%, rgba(248, 250, 252, 1) 100%);
  --kpi-card-bg: #ffffff;

  /* Surface & Backgrounds (Light Mode) */
  --color-bg-base: #f8fafc;
  --color-bg-card: #ffffff;
  --color-bg-card-subtle: #f1f5f9;
  --color-bg-elevated: #ffffff;

  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-subtle: #f1f5f9;

  --admin-bg-page: #f8fafc;
  --admin-bg-surface: #ffffff;
  --admin-bg-elevated: #f1f5f9;

  /* Borders */
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;
  --color-border-subtle: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --admin-border: #e2e8f0;
  --admin-border-strong: #cbd5e1;

  /* Typography Colors */
  --color-text-main: #0f172a;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;
  --color-text-inverse: #ffffff;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --admin-text: #0f172a;
  --admin-text-muted: #64748b;
  --admin-text-light: #94a3b8;

  /* Form Inputs */
  --color-input-bg: #ffffff;
  --color-input-border: #cbd5e1;
  --color-input-text: #0f172a;
  --color-input-focus: #0284c7;
  --input-focus-ring: rgba(2, 132, 199, 0.15);

  --bg-input: #ffffff;
  --bg-pill: #e2e8f0;
  --bg-pill-hover: #cbd5e1;

  /* Header & Overlays */
  --header-bg: rgba(255, 255, 255, 0.95);
  --header-border: #e2e8f0;
  --overlay-bg: rgba(15, 23, 42, 0.55);
  --dialog-bg: #ffffff;
  --dialog-border: #e2e8f0;
  --dialog-shadow: 0 25px 60px rgba(15, 23, 42, 0.18);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 20px 35px -5px rgba(15, 23, 42, 0.12);
  --card-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  /* Brand Core Palette (Dark Mode adjustments) */
  --color-primary: #38bdf8;
  --color-primary-hover: #0ea5e9;
  --color-teal: #14b8a6;
  --color-teal-hover: #0d9488;
  --color-teal-subtle: #132b35;
  --color-cyan: #22d3ee;
  --color-mint: #34d399;
  --color-amber: #fbbf24;
  --color-rose: #f87171;
  --color-purple: #a78bfa;

  --brand-primary: #38bdf8;
  --brand-hover: #0ea5e9;
  --brand-teal: #14b8a6;
  --brand-cyan: #22d3ee;
  --brand-mint: #34d399;
  --brand-rose: #f87171;
  --brand-amber: #fbbf24;

  --admin-teal: #14b8a6;
  --admin-cyan: #22d3ee;
  --admin-mint: #34d399;
  --admin-rose: #f87171;

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #0ea5e9 0%, #0d9488 100%);
  --grad-hero: radial-gradient(circle at 50% 20%, #132238 0%, #0b1120 70%);
  --grad-badge: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);
  --grad-accent: linear-gradient(135deg, #38bdf8 0%, #2dd4bf 100%);
  --hero-bg-grad: linear-gradient(180deg, rgba(14, 165, 233, 0.08) 0%, rgba(11, 17, 32, 1) 100%);
  --kpi-card-bg: #131c31;

  /* Surface & Backgrounds (Dark Mode) */
  --color-bg-base: #0b1120;
  --color-bg-card: #131c31;
  --color-bg-card-subtle: #1e293b;
  --color-bg-elevated: #1e293b;

  --bg-page: #0b1120;
  --bg-surface: #131c31;
  --bg-surface-elevated: #1e293b;
  --bg-surface-subtle: #1e293b;

  --admin-bg-page: #0b1120;
  --admin-bg-surface: #131c31;
  --admin-bg-elevated: #1e293b;

  /* Borders */
  --color-border: #1e293b;
  --color-border-strong: #334155;
  --color-border-subtle: #162035;
  --border-subtle: #1e293b;
  --border-strong: #334155;
  --admin-border: #1e293b;
  --admin-border-strong: #334155;

  /* Typography Colors */
  --color-text-main: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-text-light: #64748b;
  --color-text-inverse: #0f172a;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --admin-text: #f8fafc;
  --admin-text-muted: #94a3b8;
  --admin-text-light: #64748b;

  /* Form Inputs */
  --color-input-bg: #0b1120;
  --color-input-border: #334155;
  --color-input-text: #f8fafc;
  --color-input-focus: #38bdf8;
  --input-focus-ring: rgba(56, 189, 248, 0.2);

  --bg-input: #0b1120;
  --bg-pill: #1e293b;
  --bg-pill-hover: #334155;

  /* Header & Overlays */
  --header-bg: rgba(11, 17, 32, 0.95);
  --header-border: #1e293b;
  --overlay-bg: rgba(3, 7, 18, 0.85);
  --dialog-bg: #131c31;
  --dialog-border: #1e293b;
  --dialog-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 35px -5px rgba(0, 0, 0, 0.6);
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* --------------------------------------------------------------------------
   2. GLOBAL RESET & BASE TYPOGRAPHY
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg-base);
  color: var(--color-text-main);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

code, kbd, samp, pre, .font-mono {
  font-family: 'JetBrains Mono', monospace;
}

img, svg {
  vertical-align: middle;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   3. MARQUESINA LOGÍSTICA SUPERIOR
   -------------------------------------------------------------------------- */
.announcement-bar {
  background: var(--color-navy);
  color: #f8fafc;
  font-size: 0.78rem;
  font-weight: 600;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: 38px;
  display: flex;
  align-items: center;
}

.announcement-marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 36s linear infinite;
}

.announcement-marquee-track:hover {
  animation-play-state: paused;
}

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.announcement-marquee-group {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-right: 28px;
  white-space: nowrap;
}

.announcement-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.announcement-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(14, 165, 233, 0.25);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.announcement-sep {
  opacity: 0.35;
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   4. CABECERA & NAVEGACIÓN UNIVERSAL
   -------------------------------------------------------------------------- */
.store-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--header-border);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.store-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 20px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--color-primary);
  background: rgba(2, 132, 199, 0.06);
}

.nav-item.active {
  color: var(--color-primary);
  background: rgba(2, 132, 199, 0.1);
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-header-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-header-icon:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.btn-header-login {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(2, 132, 199, 0.35);
  background: rgba(2, 132, 199, 0.08);
  color: var(--color-primary);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-header-login:hover {
  background: rgba(2, 132, 199, 0.16);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   5. BOTONES GLOBALES
   -------------------------------------------------------------------------- */
.btn-primary-action,
.btn-save-primary,
.btn-admin-primary,
.btn-submit-auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary-action:hover,
.btn-save-primary:hover,
.btn-admin-primary:hover,
.btn-submit-auth:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
}

.btn-primary-action:disabled,
.btn-save-primary:disabled,
.btn-admin-primary:disabled,
.btn-submit-auth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ghost-action:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   6. FORMULARIOS & CONTROLES
   -------------------------------------------------------------------------- */
.form-group,
.form-group-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.form-label,
.custom-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.form-input,
.custom-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 9px;
  border: 1px solid var(--color-input-border);
  background: var(--color-input-bg);
  color: var(--color-input-text);
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.custom-input:focus {
  border-color: var(--color-input-focus);
  box-shadow: 0 0 0 3px var(--input-focus-ring);
}

.form-input.is-readonly {
  background: var(--color-bg-card-subtle);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.field-hint {
  font-size: 0.74rem;
  color: var(--color-text-muted);
  line-height: 1.35;
}

/* --------------------------------------------------------------------------
   7. BADGES & STATUS PILLS
   -------------------------------------------------------------------------- */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
  animation: pulseDotAnim 2s infinite;
}

@keyframes pulseDotAnim {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-pill.status-processing {
  background: rgba(245, 158, 11, 0.12);
  color: var(--color-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-pill.status-shipped {
  background: rgba(2, 132, 199, 0.12);
  color: var(--color-primary);
  border: 1px solid rgba(2, 132, 199, 0.25);
}

.status-pill.status-delivered {
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-mint);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-pill.status-cancelled {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-rose);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.priority-shipping-pill,
.cold-chain-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(6, 182, 212, 0.12);
  color: var(--color-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

/* --------------------------------------------------------------------------
   8. MODALES & OVERLAYS
   -------------------------------------------------------------------------- */
.modal-overlay,
.customer-auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active,
.customer-auth-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.product-modal-card,
.auth-dialog-card,
.address-modal-card {
  background: var(--dialog-bg);
  border: 1px solid var(--dialog-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--dialog-shadow);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* --------------------------------------------------------------------------
   9. MENÚ MÓVIL (DRAWER)
   -------------------------------------------------------------------------- */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.mobile-nav-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 85%;
  max-width: 340px;
  background: var(--dialog-bg);
  border-left: 1px solid var(--dialog-border);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

.btn-mobile-trigger {
  display: none;
  background: none;
  border: none;
  color: var(--color-text-main);
  cursor: pointer;
  padding: 6px;
}

@media (max-width: 900px) {
  .main-nav {
    display: none;
  }
  .btn-mobile-trigger {
    display: inline-flex;
  }
}
