/* ═══════════════════════════════════════════════════════════════
   Daniela Lopez Academy — CSS Global
   Variables + Reset + Tipografía + Utilidades base
   ═══════════════════════════════════════════════════════════════ */

/* ── Google Fonts ─────────────────────────────────────────────
   Se importan desde header.php via <link> para mejor performance
   @import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Outfit:wght@300;400;500;600;700&display=swap');
   ─────────────────────────────────────────────────────────────── */

/* ── Variables CSS ────────────────────────────────────────────── */
:root {
  /* Paleta principal */
  --verde:          #2D4C47;
  --verde-dark:     #1C3330;
  --verde-light:    #3d6b64;
  --mauve:          #BD9A96;
  --mauve-light:    #D4B5B1;
  --mauve-dark:     #9e7773;
  --beige:          #DACBBD;
  --beige-light:    #EDE5DC;
  --cream:          #F8F4F0;
  --dark:           #0d1f1c;
  --white:          #ffffff;

  /* Texto */
  --text-dark:      #1a2e2a;
  --text-body:      #3d4f4a;
  --text-muted:     #7a8c88;
  --text-light:     #b0bfbc;

  /* Fuentes */
  --font-display:   'Cormorant Garamond', Georgia, serif;
  --font-body:      'Outfit', system-ui, -apple-system, sans-serif;

  /* Espaciados */
  --space-xs:       4px;
  --space-sm:       8px;
  --space-md:       16px;
  --space-lg:       24px;
  --space-xl:       40px;
  --space-2xl:      64px;
  --space-3xl:      96px;

  /* Border radius */
  --radius-sm:      8px;
  --radius-md:      16px;
  --radius-lg:      24px;
  --radius-xl:      32px;
  --radius-full:    9999px;

  /* Sombras */
  --shadow-sm:      0 2px 8px rgba(45, 76, 71, 0.06);
  --shadow-md:      0 4px 20px rgba(45, 76, 71, 0.10);
  --shadow-lg:      0 8px 40px rgba(45, 76, 71, 0.14);
  --shadow-xl:      0 16px 60px rgba(45, 76, 71, 0.18);
  --shadow-mauve:   0 8px 32px rgba(189, 154, 150, 0.25);
  --shadow-verde:   0 8px 32px rgba(45, 76, 71, 0.25);

  /* Transiciones */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
  --transition-bounce: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Header */
  --header-height:  88px;

  /* Z-index */
  --z-base:       1;
  --z-dropdown:   100;
  --z-sticky:     200;
  --z-fixed:      300;
  --z-overlay:    400;
  --z-modal:      500;
  --z-toast:      600;
}

/* ── Reset ────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-body);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--verde);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--verde-dark);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-dark);
  line-height: 1.2;
  font-weight: 600;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
h4 { font-size: 1.3rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 0; }

/* ── Scrollbar personalizado ─────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--beige-light);
}

::-webkit-scrollbar-thumb {
  background: var(--mauve);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--mauve-dark);
}

/* ── Selección de texto ─────────────────────────────────────── */
::selection {
  background-color: var(--mauve-light);
  color: var(--verde-dark);
}

/* ── Layout base ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.container-sm  { max-width: 640px;  margin-inline: auto; padding-inline: var(--space-lg); }
.container-md  { max-width: 800px;  margin-inline: auto; padding-inline: var(--space-lg); }
.container-xl  { max-width: 1400px; margin-inline: auto; padding-inline: var(--space-lg); }

/* ── Secciones ───────────────────────────────────────────────── */
.section {
  padding-block: var(--space-3xl);
}

.section-sm {
  padding-block: var(--space-2xl);
}

.section-inner {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.s-eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--mauve);
  display: block;
  margin-bottom: var(--space-sm);
}

.s-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: var(--space-md);
}

.s-title em {
  font-style: italic;
  color: var(--mauve);
}

.s-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.7;
}

.s-center {
  text-align: center;
}

.s-center .s-subtitle {
  margin-inline: auto;
}

/* ── Grid helpers ────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

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

/* ── Flex helpers ────────────────────────────────────────────── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-gap-sm { gap: var(--space-sm); }
.flex-gap-md { gap: var(--space-md); }
.flex-gap-lg { gap: var(--space-lg); }
.flex-wrap   { flex-wrap: wrap; }
.flex-col    { flex-direction: column; }

/* ── Tipografía utilitaria ───────────────────────────────────── */
.font-display  { font-family: var(--font-display); }
.font-body     { font-family: var(--font-body); }
.text-sm       { font-size: 0.875rem; }
.text-xs       { font-size: 0.75rem; }
.text-lg       { font-size: 1.125rem; }
.text-xl       { font-size: 1.25rem; }
.text-muted    { color: var(--text-muted); }
.text-mauve    { color: var(--mauve); }
.text-verde    { color: var(--verde); }
.text-white    { color: var(--white); }
.text-center   { text-align: center; }
.text-bold     { font-weight: 700; }
.italic        { font-style: italic; }
.uppercase     { text-transform: uppercase; letter-spacing: 1px; }

/* ── Colores de fondo ────────────────────────────────────────── */
.bg-verde       { background-color: var(--verde); }
.bg-verde-dark  { background-color: var(--verde-dark); }
.bg-mauve       { background-color: var(--mauve); }
.bg-beige       { background-color: var(--beige); }
.bg-beige-light { background-color: var(--beige-light); }
.bg-cream       { background-color: var(--cream); }
.bg-dark        { background-color: var(--dark); }
.bg-white       { background-color: var(--white); }

/* ── Utilidades de espaciado ─────────────────────────────────── */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* ── Animaciones de reveal ────────────────────────────────────
   DOBLE seguro:
   1) JS agrega .revealed inmediatamente → transición suave
   2) Si JS falla, la animation CSS de 0.4s lo muestra igual
   ─────────────────────────────────────────────────────────── */
@keyframes revealUp    { to { opacity:1; transform:translateY(0); } }
@keyframes revealLeft  { to { opacity:1; transform:translateX(0); } }
@keyframes revealRight { to { opacity:1; transform:translateX(0); } }

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  animation: revealUp 0.45s ease 0.4s forwards;
}
.reveal.revealed {
  opacity: 1 !important;
  transform: none !important;
  animation: none;
}

.reveal-left {
  opacity: 0;
  transform: translateX(-28px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  animation: revealLeft 0.45s ease 0.4s forwards;
}
.reveal-left.revealed {
  opacity: 1 !important;
  transform: none !important;
  animation: none;
}

.reveal-right {
  opacity: 0;
  transform: translateX(28px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  animation: revealRight 0.45s ease 0.4s forwards;
}
.reveal-right.revealed {
  opacity: 1 !important;
  transform: none !important;
  animation: none;
}

/* Delays de cascada */
.reveal-delay-1 { animation-delay: 0.5s;  transition-delay: 0.06s; }
.reveal-delay-2 { animation-delay: 0.6s;  transition-delay: 0.12s; }
.reveal-delay-3 { animation-delay: 0.7s;  transition-delay: 0.18s; }
.reveal-delay-4 { animation-delay: 0.8s;  transition-delay: 0.24s; }

/* ── Spinner de carga ────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-verde {
  border-color: rgba(45,76,71,0.2);
  border-top-color: var(--verde);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Overlay ─────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 31, 28, 0.6);
  backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  display: none;
}

.overlay.active {
  display: block;
}

/* ── Scroll band (marquee continuo) ─────────────────────────── */
.scroll-band {
  overflow: hidden;
  padding-block: 18px;
  white-space: nowrap;
}

.scroll-band-track {
  display: inline-flex;
  gap: 0;
  animation: marquee 30s linear infinite;
}

.scroll-band-track:hover {
  animation-play-state: paused;
}

.scroll-band-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-inline: 28px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.scroll-band-item::after {
  content: '·';
  font-size: 1.4em;
  opacity: 0.4;
}

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

/* ── Barra de progreso ───────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--beige);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--verde), var(--mauve));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* ── Divider ──────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--beige);
  margin-block: var(--space-lg);
}

/* ── Glassmorphism ────────────────────────────────────────────── */
.glass {
  background: rgba(248, 244, 240, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(248, 244, 240, 0.2);
}

.glass-dark {
  background: rgba(28, 51, 48, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(248, 244, 240, 0.1);
}

/* ── Avatar ───────────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--beige);
}

.avatar-sm { width: 32px;  height: 32px; }
.avatar-md { width: 48px;  height: 48px; }
.avatar-lg { width: 72px;  height: 72px; }
.avatar-xl { width: 100px; height: 100px; }

/* ── Empty state ──────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  color: var(--text-muted);
}

/* ── Toast / Notificación flotante ────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--verde);
  font-size: 0.9rem;
  line-height: 1.5;
  animation: slideInRight 0.3s ease;
}

.toast.toast-error   { border-left-color: #e74c3c; }
.toast.toast-warning { border-left-color: #f39c12; }
.toast.toast-info    { border-left-color: var(--mauve); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Responsive utilidades ───────────────────────────────────── */
.hidden-mobile  { display: block; }
.visible-mobile { display: none; }

@media (max-width: 768px) {
  .hidden-mobile  { display: none !important; }
  .visible-mobile { display: block !important; }
  .container, .section-inner { padding-inline: var(--space-md); }
  .section  { padding-block: var(--space-2xl); }
}
