/* ================================================
   UMMIDI DESIGN SYSTEM — CSS
   Versión: 1.0  |  Base unit: 8px
   ================================================ */

/* Inter — Google Font*/
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ── 1. CUSTOM PROPERTIES ── */
:root {
  --ummidi-black: #000000;
  --ummidi-white: #ffffff;
  --ummidi-green: #006342;
  --hover-gray: #e2e2e2;
  --hover-light: #f3f3f3;
  --chip-gray: #efefef;
  --body-gray: #4b4b4b;
  --muted-gray: #afafaf;

  --shadow-flat: none;
  --shadow-subtle: rgba(0, 0, 0, 0.12) 0px 4px 16px 0px;
  --shadow-medium: rgba(0, 0, 0, 0.16) 0px 4px 16px 0px;
  --shadow-floating: rgba(0, 0, 0, 0.16) 0px 2px 8px 0px;
  --shadow-pressed: rgba(0, 0, 0, 0.08);

  /* Legacy aliases to prevent breaking existing code */
  --shadow-card: var(--shadow-subtle);
  --shadow-float: var(--shadow-floating);

  --radius-input: 8px;
  --radius-card: 12px;
  --radius-card-lg: 16px;
  --radius-pill: 999px;
  --radius-circle: 50%;

  --font-headline: 'Inter', system-ui, 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', system-ui, 'Helvetica Neue', Arial, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  --container-max: 1280px;
}

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

span,
svg {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ummidi-black);
  background: var(--ummidi-white);
}

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

/* FIX LEAFLET: Evitar que el reset global rompa los mapas */
.leaflet-container img {
  max-width: none !important;
  display: inline !important;
}

/* FIX LEAFLET: Evitar que el reset global rompa los mapas */
.leaflet-container img {
  max-width: none !important;
  display: inline !important;
}

a {
  color: inherit;
}

/* ── 3. TIPOGRAFÍA ── */

.u-heading {
  font-family: var(--font-headline);
  font-size: 1.25rem; /* 20px */
  font-weight: 700;
  line-height: 1.40;
}

.u-heading-1 {
  font-family: var(--font-headline);
  font-size: 3.25rem; /* 52px */
  font-weight: 700;
  line-height: 1.23;
}

.u-heading-2 {
  font-family: var(--font-headline);
  font-size: 2.25rem; /* 36px */
  font-weight: 700;
  line-height: 1.22;
}

.u-heading-3 {
  font-family: var(--font-headline);
  font-size: 2rem; /* 32px */
  font-weight: 700;
  line-height: 1.25;
}

.u-heading-4 {
  font-family: var(--font-headline);
  font-size: 1.5rem; /* 24px */
  font-weight: 700;
  line-height: 1.33;
}

.u-heading-5 {
  font-family: var(--font-headline);
  font-size: 1.25rem; /* 20px */
  font-weight: 700;
  line-height: 1.40;
}

.u-heading-6 {
  font-family: var(--font-headline);
  font-size: 1.125rem; /* 18px */
  font-weight: 700;
  line-height: 1.44;
}

.u-nav-text {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.33;
}

.u-body {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.50;
}

.u-paragraph {
  color: var(--body-gray);
  font-size: 20px;
  line-height: 1.50;
  font-family: var(--font-body);
  font-weight: 400;
}

.u-caption {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.43;
}

.u-micro {
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 400;
  line-height: 1.67;
}

.u-showcase-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #afafaf;
  margin-bottom: 4px;
}

.u-section-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #afafaf;
  margin-bottom: 8px;
}

.u-text-primary {
  color: var(--ummidi-black);
}

.u-text-secondary {
  color: var(--body-gray);
}

.u-text-muted {
  color: var(--muted-gray);
}

.u-text-inverse {
  color: var(--ummidi-white);
}

/* ── 4. BOTONES ── */
.u-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s ease, box-shadow .15s ease;
  outline: none;
  white-space: nowrap;
  min-height: 44px;
  min-width: 44px;
}

.u-btn-primary {
  background: var(--ummidi-black);
  color: var(--ummidi-white);
  padding: 14px 28px;
}

.u-btn-primary:hover {
  background: #222;
}

.u-btn-primary:focus-visible {
  box-shadow: inset rgb(255, 255, 255) 0px 0px 0px 2px;
}

.u-btn-primary:active {
  background: #111;
}

.u-btn-secondary {
  background: var(--ummidi-white);
  color: var(--ummidi-black);
  padding: 14px 28px;
  border: 1px solid var(--ummidi-black);
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
}

.u-btn-secondary:hover,
.u-btn-secondary:focus-visible {
  background: var(--hover-gray);
}

.u-btn-secondary:active {
  box-shadow: inset var(--shadow-pressed) 0px 0px 0px 999px;
}

.u-btn-white {
  background: var(--ummidi-white);
  color: var(--ummidi-black);
  padding: 14px 28px;
}

.u-btn-nav {
  background: transparent;
  font-size: 0.875rem;
  padding: 10px 16px;
}

.u-btn-nav:hover {
  box-shadow: inset 999px 999px 0px rgba(255, 255, 255, 0.1);
}

.u-btn-nav-alt {
  background-color: var(--ummidi-black);
  color: var(--ummidi-white);
  font-size: 0.875rem;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
}

.u-btn-nav-alt:hover {
  background: #222;
}

.u-btn-chip {
  background: var(--chip-gray);
  color: var(--ummidi-black);
  padding: 14px 16px;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

/* Estado activo para radios ocultos dentro de etiquetas con .u-btn-chip */
label.u-btn-chip:has(input:checked) {
  background: var(--ummidi-black) !important;
  color: var(--ummidi-white) !important;
}

.u-btn-chip:hover {
  background: var(--hover-gray);
}

.u-btn-fab {
  background: var(--ummidi-white);
  color: var(--ummidi-black);
  padding: 14px;
  box-shadow: var(--shadow-float);
  transform: translateY(0);
  transition: background .15s, box-shadow .15s, transform .15s;
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.u-btn-fab:hover {
  background: var(--hover-light);
  transform: translateY(-2px);
}

/* Contenedor de Mapa */
.u-map-wrapper {
  position: relative;
  height: 450px;
  width: 100%;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--ummidi-black);
}

/* ── 5. CARDS ── */
.u-card {
  background: var(--ummidi-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.u-card-featured {
  background: var(--ummidi-white);
  border-radius: var(--radius-card-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.u-card-body {
  padding: var(--space-6);
}

.u-card-btn {
  background: var(--ummidi-black);
  color: var(--ummidi-white);
  padding: 10px 20px;
  border: none;
  font-size: 14px;
  display: inline-block;
}

/* ── 6. INPUTS ── */
.u-input {
  width: 100%;
  background: var(--ummidi-white);
  color: var(--ummidi-black);
  border: 1px solid var(--ummidi-black);
  border-radius: var(--radius-input);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  outline: none;
  transition: box-shadow .15s;
}

.u-input::placeholder {
  color: var(--muted-gray);
}

.u-input:focus {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .2);
}

/* ── 7. LAYOUT ── */
.u-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.u-section {
  padding: var(--space-16) 0;
}

.u-section-lg {
  padding: var(--space-24) 0;
}

.u-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.u-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.u-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
  min-height: 500px;
}

.u-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ummidi-white);
  display: flex;
  align-items: center;
  padding: 0;
  height: 64px;
}

.u-chip-nav {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.u-chip-nav::-webkit-scrollbar {
  display: none;
}

.u-grid { display: grid; }
.u-grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.u-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.u-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

.u-gap-8  { gap: var(--space-1); }
.u-gap-16 { gap: var(--space-4); }
.u-gap-24 { gap: var(--space-6); }
.u-gap-32 { gap: var(--space-8); }
.u-gap-48 { gap: var(--space-12); }

@media (min-width: 768px) {
  .md\:u-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:u-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1120px) {
  .lg\:u-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:u-col-span-2 { grid-column: span 2 / span 2; }
}

/* ── 8. FOOTER ── */
.u-footer {
  background: var(--ummidi-black);
  color: var(--ummidi-white);
  padding: var(--space-16) 0;
}

.u-footer-link {
  color: var(--muted-gray);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: .875rem;
  transition: color .15s;
}

.u-footer-link:hover {
  color: var(--ummidi-white);
}

/* ── 9. UTILIDADES ── */
.u-text-center { text-align: center; }
.u-max-w-580 { max-width: 580px; }
.u-mx-auto { margin-left: auto; margin-right: auto; }

/* Margin Top */
.u-mt-4  { margin-top: 0.25rem; } /* 4px */
.u-mt-8  { margin-top: 0.50rem; } /* 8px */
.u-mt-12 { margin-top: 0.75rem; } /* 12px */
.u-mt-16 { margin-top: 1.00rem; } /* 16px */
.u-mt-20 { margin-top: 1.25rem; } /* 20px */
.u-mt-24 { margin-top: 1.50rem; } /* 24px */
.u-mt-32 { margin-top: 2.00rem; } /* 32px */
.u-mt-48 { margin-top: 3.00rem; } /* 48px */
.u-mt-64 { margin-top: 4.00rem; } /* 64px */

/* Margin Bottom */
.u-mb-4  { margin-bottom: 0.25rem; } /* 4px */
.u-mb-8  { margin-bottom: 0.50rem; } /* 8px */
.u-mb-12 { margin-bottom: 0.75rem; } /* 12px */
.u-mb-16 { margin-bottom: 1.00rem; } /* 16px */
.u-mb-20 { margin-bottom: 1.25rem; } /* 20px */
.u-mb-24 { margin-bottom: 1.50rem; } /* 24px */
.u-mb-32 { margin-bottom: 2.00rem; } /* 32px */
.u-mb-48 { margin-bottom: 3.00rem; } /* 48px */
.u-mb-64 { margin-bottom: 4.00rem; } /* 64px */

.u-flex-gap-3 { display: flex; gap: var(--space-3); }
.u-flex-justify-center { justify-content: center; }
.u-flex-wrap { flex-wrap: wrap; }

.u-flex { display: flex; }
.u-flex-column { flex-direction: column; }
.u-items-center { align-items: center; }
.u-items-start { align-items: flex-start; }
.u-justify-between { justify-content: space-between; }
.u-justify-center { justify-content: center; }
.u-justify-end { justify-content: flex-end; }
.u-w-full { width: 100%; }
.u-flex-shrink-0 { flex-shrink: 0; }

.u-gap-1 { gap: var(--space-1); }
.u-gap-2 { gap: var(--space-2); }
.u-gap-3 { gap: var(--space-3); }
.u-gap-4 { gap: var(--space-4); }

.u-shadow-0 {
  box-shadow: var(--shadow-flat);
  border: 1px solid var(--chip-gray);
}

.u-shadow-1 {
  box-shadow: var(--shadow-subtle);
}

.u-shadow-2 {
  box-shadow: var(--shadow-medium);
}

.u-shadow-3 {
  box-shadow: var(--shadow-floating);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.u-shadow-3:hover {
  transform: translateY(-4px);
  box-shadow: rgba(0, 0, 0, 0.2) 0px 8px 24px 0px;
}

.u-shadow-pressed {
  box-shadow: var(--shadow-pressed) inset;
}

.u-surface-dark {
  background: var(--ummidi-black);
  color: var(--ummidi-white);
}

.u-surface-light {
  background: var(--ummidi-white);
  color: var(--ummidi-black);
}

.u-divider {
  border: none;
  border-top: 1px solid var(--chip-gray);
  margin: var(--space-4) 0;
}

/* ── 10. RESPONSIVE ── */
.u-mobile-only { display: none; }

@media (max-width:1119px) {
  .u-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width:768px) {
  .u-desktop-only { display: none !important; }
  .u-mobile-only { display: block !important; }

  .u-grid-2,
  .u-grid-3 {
    grid-template-columns: 1fr;
  }

  .u-heading-1 {
    font-size: 2.75rem;
  }

  .u-heading-2 {
    font-size: 2rem;
  }

  .u-section {
    padding: var(--space-8) 0;
  }

  .u-item {
    grid-template-columns: auto 1fr auto;
    padding: var(--space-4);
  }
}

@media (max-width:600px) {
  .u-heading-1 {
    font-size: 2.25rem;
  }

  .u-heading-2 {
    font-size: 1.75rem;
  }

  .u-heading-3 {
    font-size: 1.25rem;
  }

  .u-paragraph {
    font-size: 18px;
  }
}

/* ── 11. COMPONENTES ── */

/* Badges */
.u-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.u-badge-success {
  background: #ecfdf5;
  color: #065f46;
  border-color: #10b981;
}

.u-badge-muted {
  background: var(--hover-light);
  color: var(--body-gray);
  border-color: var(--hover-gray);
}

/* Material Item */
.u-item-list {
  background: var(--ummidi-white);
  border: 1px solid var(--chip-gray);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.u-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--chip-gray);
  transition: background-color 0.2s;
}

.u-item:last-child {
  border-bottom: none;
}

.u-item:hover {
  background-color: var(--hover-light);
}

.u-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.u-item-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Componente Split (Texto/Imagen) */
.u-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8); /* Use gap for spacing */
  align-items: center;
}

/* Modificador para invertir el orden de los hijos en desktop */
.u-split--reverse > :first-child { /* text */
  grid-column-start: 2;
}
.u-split--reverse > :last-child { /* image */
  grid-column-start: 1;
  grid-row-start: 1;
}

.u-split__media {
  border-radius: var(--radius-card-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.u-split__media--ratio {
  position: relative;
  aspect-ratio: 3 / 2;
}

.u-split__media--ratio img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* -- Responsive para u-split -- */
@media (max-width: 768px) {
  .u-split {
    grid-template-columns: 1fr;
    gap: var(--space-6); /* Vertical gap on mobile */
  }

  /* Universal rule: Image first on mobile */
  .u-split > :first-child { /* The text block */
    order: 2;
  }
  .u-split > :last-child { /* The image block */
    order: 1;
  }

  /* Reset desktop grid positioning for the reverse version */
  .u-split--reverse > :first-child,
  .u-split--reverse > :last-child {
      grid-column-start: auto;
      grid-row-start: auto;
  }
}
