/* ============================================
   QUOVET - DISEÑO ESTILO BOOKING/AIRBNB
   ============================================ */

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

:root {
  --primary: #1D9E75;
  --primary-dark: #0F6E56;
  --primary-darker: #085041;
  --primary-light: #E1F5EE;
  --primary-light2: #9FE1CB;
  --danger: #E24B4A;
  --danger-light: #FCEBEB;
  --warning: #EF9F27;
  --amber-light: #FAEEDA;
  --pink-light: #FBEAF0;
  --text: #1a1a1a;
  --text-secondary: #5F5E5A;
  --text-tertiary: #888780;
  --bg: #fff;
  --bg-secondary: #f7f7f5;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-logo i {
  color: var(--primary);
  font-size: 22px;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 999px;
  transition: all 0.2s;
}

.nav-link:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

.nav-link.active {
  color: var(--text);
  font-weight: 500;
  background: var(--bg-secondary);
}

.nav-cta {
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--primary);
  color: var(--primary-dark);
  background: transparent;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-cta:hover {
  background: var(--primary-light);
}

/* HERO */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-light2) 100%);
  padding: 5rem 1.5rem 4rem;
  overflow: hidden;
}

.hero-decorations {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.paw {
  position: absolute;
  color: var(--primary-darker);
  opacity: 0.1;
}

.paw-1 { top: 8%; right: 8%; font-size: 80px; transform: rotate(-15deg); }
.paw-2 { bottom: 12%; left: 6%; font-size: 100px; transform: rotate(20deg); }
.paw-3 { top: 25%; left: 15%; font-size: 50px; transform: rotate(45deg); }
.paw-4 { bottom: 30%; right: 18%; font-size: 60px; transform: rotate(-30deg); }
.paw-5 { top: 60%; left: 35%; font-size: 40px; transform: rotate(10deg); opacity: 0.07; }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--primary-darker);
  margin-bottom: 12px;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--primary-dark);
  margin-bottom: 2.5rem;
  font-weight: 500;
}

/* SEARCH BOX */
.search-box {
  background: white;
  border-radius: 999px;
  padding: 8px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 10px 18px;
  min-width: 0;
}

.search-field i {
  color: var(--primary-dark);
  font-size: 18px;
  margin-right: 10px;
  flex-shrink: 0;
}

.search-field input {
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  width: 100%;
  background: transparent;
  color: var(--text);
}

.search-field input::placeholder {
  color: var(--text-tertiary);
}

.search-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

.search-btn {
  height: 48px;
  width: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.search-btn i {
  font-size: 20px;
}

.search-btn:hover {
  background: var(--primary-dark);
}

/* PET FILTERS */
.pet-filters {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.pet-chip {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 110, 86, 0.15);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
}

.pet-chip i {
  font-size: 16px;
}

.pet-chip:hover {
  background: white;
  border-color: var(--primary);
}

.pet-chip.active {
  background: var(--primary-dark);
  color: white;
  border-color: var(--primary-dark);
}

/* URGENCY BANNER */
.urgency-banner {
  margin: 2rem 0;
  background: var(--danger-light);
  border: 1px solid #F09595;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.urg-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.urg-icon i {
  font-size: 22px;
}

.urg-text {
  flex: 1;
  min-width: 200px;
}

.urg-text strong {
  display: block;
  font-size: 15px;
  color: #791F1F;
  font-weight: 700;
  margin-bottom: 2px;
}

.urg-text span {
  font-size: 13px;
  color: #A32D2D;
}

.urg-btn {
  font-size: 13px;
  padding: 10px 18px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.2s;
}

.urg-btn:hover {
  background: #A32D2D;
}

/* SECTIONS */
.section {
  padding: 2.5rem 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h2 {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.section-sub {
  font-size: 14px;
  color: var(--text-secondary);
}

.see-all {
  font-size: 14px;
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}

.see-all:hover {
  color: var(--primary-darker);
}

.btn-location {
  font-size: 13px;
  padding: 10px 16px;
  background: white;
  color: var(--primary-dark);
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-location:hover {
  background: var(--primary-light);
}

.btn-location i {
  font-size: 16px;
}

/* CARDS GRID */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.clinic-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}

.clinic-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.clinic-image {
  height: 200px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-light2));
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clinic-image.alt-1 { background: linear-gradient(135deg, var(--pink-light), #F4C0D1); }
.clinic-image.alt-2 { background: linear-gradient(135deg, var(--amber-light), #FAC775); }
.clinic-image.alt-3 { background: linear-gradient(135deg, #EEEDFE, #CECBF6); }

.clinic-image-icon {
  font-size: 64px;
  color: var(--primary-darker);
  opacity: 0.4;
}

.clinic-image.alt-1 .clinic-image-icon { color: #993556; }
.clinic-image.alt-2 .clinic-image-icon { color: #854F0B; }
.clinic-image.alt-3 .clinic-image-icon { color: #3C3489; }

.heart-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s;
}

.heart-btn:hover {
  transform: scale(1.1);
}

.heart-btn i {
  font-size: 18px;
  color: var(--text-tertiary);
}

.heart-btn.active i {
  color: var(--danger);
}

.clinic-body {
  padding: 14px 16px;
}

.clinic-row-1 {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.clinic-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
}

.clinic-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 14px;
  flex-shrink: 0;
}

.clinic-rating i {
  color: var(--warning);
  font-size: 14px;
}

.clinic-rating .rating-num {
  font-weight: 700;
}

.clinic-address {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.clinic-address i {
  font-size: 14px;
  color: var(--text-tertiary);
}

.clinic-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.clinic-price {
  font-size: 13px;
  color: var(--text-secondary);
}

.clinic-price strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.clinic-distance {
  font-size: 11px;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

.clinic-distance i {
  font-size: 12px;
}

.loading,
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 14px;
}

.empty a {
  color: var(--primary-dark);
  font-weight: 600;
}

/* FEATURES SECTION */
.features-section {
  background: var(--bg-secondary);
  margin-top: 2rem;
}

.features-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  text-align: center;
  margin-bottom: 2rem;
  letter-spacing: -0.5px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.feature {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.75rem 1.25rem;
  text-align: center;
}

.feature-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon i {
  font-size: 26px;
  color: var(--primary-dark);
}

.feature h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.feature p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* FOOTER */
.footer {
  background: var(--text);
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer h4 i {
  color: var(--primary);
}

.footer p,
.footer a {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  margin-bottom: 8px;
  line-height: 1.5;
}

.footer a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

/* BOTTOM NAV MÓVIL */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  color: var(--text-tertiary);
  font-size: 11px;
  text-decoration: none;
  font-weight: 500;
}

.bottom-nav-item i {
  font-size: 22px;
}

.bottom-nav-item.active {
  color: var(--primary);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding: 3rem 1rem 2.5rem;
  }

  .search-box {
    flex-direction: column;
    border-radius: var(--radius-md);
    padding: 12px;
    gap: 4px;
  }

  .search-field {
    padding: 8px 12px;
    width: 100%;
  }

  .search-divider {
    width: 100%;
    height: 1px;
  }

  .search-btn {
    width: 100%;
    border-radius: var(--radius-sm);
    height: 44px;
  }

  .urgency-banner {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .urg-btn {
    width: 100%;
    justify-content: center;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer {
    margin-bottom: 70px;
  }
}

@media (max-width: 600px) {
  .bottom-nav {
    display: flex;
  }

  .pet-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 0 4px;
    -webkit-overflow-scrolling: touch;
  }

  .pet-filters::-webkit-scrollbar {
    display: none;
  }

  .pet-chip {
    flex-shrink: 0;
  }
}

/* HERO PATAS ANIMACIÓN SUTIL */
@keyframes pawFloat {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-8px) rotate(var(--rot, 0deg)); }
}

.paw-1 { --rot: -15deg; animation: pawFloat 6s ease-in-out infinite; }
.paw-2 { --rot: 20deg; animation: pawFloat 7s ease-in-out infinite 0.5s; }
.paw-3 { --rot: 45deg; animation: pawFloat 5s ease-in-out infinite 1s; }
.paw-4 { --rot: -30deg; animation: pawFloat 8s ease-in-out infinite 1.5s; }
.paw-5 { --rot: 10deg; animation: pawFloat 6.5s ease-in-out infinite 2s; }

@media (prefers-reduced-motion: reduce) {
  .paw { animation: none !important; }
}

/* HOVER MEJORADO TARJETAS */
.clinic-card:hover .heart-btn {
  background: white;
}

/* ============================================
   LOADING SKELETONS (item #45)
   Sistema reusable de placeholders animados.
   Sustituyen a los textos "Cargando..." para
   transmitir estructura antes de que llegue el dato.
   ============================================ */

/* Animación base — un único keyframes para todas las variantes */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* Bloque base. Cualquier elemento con .skeleton hereda el shimmer. */
.skeleton {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: var(--radius-sm);
  color: transparent;          /* oculta texto si lo hubiera */
  user-select: none;
  pointer-events: none;
}

/* Variantes de tamaño para líneas de texto */
.skeleton-text     { height: 14px; width: 100%; margin: 6px 0; }
.skeleton-text--sm { height: 12px; width: 60%;  }
.skeleton-text--md { height: 16px; width: 80%;  }
.skeleton-text--lg { height: 22px; width: 70%;  }
.skeleton-text--xl { height: 32px; width: 65%;  }

/* Círculo (avatar, badge, etc.) */
.skeleton-circle {
  border-radius: 50%;
  width: 40px;
  height: 40px;
}

/* Bloque genérico (imagen, mapa, hero) */
.skeleton-block { width: 100%; height: 100%; border-radius: var(--radius-md); }

/* ───── Skeleton de tarjeta de clínica (la más usada) ─────
   Réplica esquemática de .clinic-card para que el layout no
   "salte" cuando llegan los datos. */
.skeleton-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.skeleton-card .skeleton-img {
  width: 100%;
  aspect-ratio: 4 / 3;
}

.skeleton-card .skeleton-body {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Grid de skeletons; reusa el mismo wrap que las tarjetas reales. */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  width: 100%;
}

/* Fila de checkbox skeleton — para el filtro de ciudades. */
.skeleton-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.skeleton-checkbox .skeleton-box {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.skeleton-checkbox .skeleton-line {
  height: 14px;
  flex: 1;
  max-width: 180px;
}

/* Contador inline (ej. "Cargando..." en results-count) */
.skeleton-inline {
  display: inline-block;
  vertical-align: middle;
  height: 14px;
  width: 110px;
}

/* Respetar prefers-reduced-motion: detener animación, mantener color base */
@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .skeleton-text,
  .skeleton-text--sm,
  .skeleton-text--md,
  .skeleton-text--lg,
  .skeleton-text--xl,
  .skeleton-circle,
  .skeleton-block,
  .skeleton-card .skeleton-img,
  .skeleton-card .skeleton-body > *,
  .skeleton-checkbox .skeleton-box,
  .skeleton-checkbox .skeleton-line,
  .skeleton-inline {
    animation: none;
    background: #f0f0f0;
  }
}

/* AUTOCOMPLETE DROPDOWN */
.search-field {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 240px;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  z-index: 200;
}

.autocomplete-dropdown::-webkit-scrollbar { width: 4px; }
.autocomplete-dropdown::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

.ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: background 0.1s;
}

.ac-item:first-child {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.ac-item:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.ac-item:hover,
.ac-item.active {
  background: var(--primary-light);
}

.ac-item i {
  font-size: 16px;
  color: var(--primary-dark);
  flex-shrink: 0;
}

.ac-item-text {
  flex: 1;
}

.ac-item-name {
  font-weight: 600;
  font-size: 14px;
}

.ac-item-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

.ac-item-count {
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  padding: 2px 7px;
  border-radius: 999px;
}

.ac-header {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-tertiary);
}

.ac-empty {
  padding: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

.card-h-tag.tag-insurance {
  background: #E6F1FB;
  color: #185FA5;
}

/* COOKIE BANNER */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--text);
  color: white;
  padding: 1.25rem 1.5rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}

.cookie-banner p {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
  flex: 1;
  min-width: 250px;
}

.cookie-banner a {
  color: var(--primary-light2);
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-btn-accept {
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.cookie-btn-accept:hover { background: var(--primary-dark); }

.cookie-btn-reject {
  padding: 10px 20px;
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.cookie-btn-reject:hover { border-color: rgba(255,255,255,0.6); color: white; }

/* =========================================================
   Tags de la tarjeta compacta (portada)
   =========================================================
   Sustituyen a los badges flotantes sobre la imagen que se solapaban.
   Mismo estilo visual que .card-h-tag del listado para coherencia.
   El orden lo decide JS: 24h siempre primero. */

.clinic-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 6px 0 4px;
}

.clinic-tag {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-secondary);
  border-radius: 999px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.clinic-tag.tag-24h {
  background: var(--danger);
  color: white;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  box-shadow: 0 1px 3px rgba(226, 75, 74, 0.35);
}
.clinic-tag.tag-24h i { font-size: 12px; }
.clinic-tag.tag-financing  { background: #E6F1FB; color: #185FA5; }
.clinic-tag.tag-insurance  { background: #DBEAF8; color: #0F4A89; }

/* Paleta rotativa para tags de SERVICIOS — color asignado deterministically
   por hash del nombre en cards.js > getServiceColorClass(). Mismo servicio,
   mismo color, en todas las tarjetas y entre vistas (portada y listado). */
.clinic-tag.tag-svc-1 { background: #E1F5EE; color: #0F6E56; }
.clinic-tag.tag-svc-2 { background: #EEEDFE; color: #3C3489; }
.clinic-tag.tag-svc-3 { background: #FAEEDA; color: #854F0B; }
.clinic-tag.tag-svc-4 { background: #FBEAF0; color: #993556; }

/* ============================================================
   SPRINT #13 · CSP sin 'unsafe-inline' en style-src
   ------------------------------------------------------------
   Utilidades introducidas para eliminar todos los style="..."
   inline (HTML y string concatenado en JS) y los <style> en
   <head>. Cualquier nuevo trozo de UI debe vivir aquí o en su
   CSS de página — NUNCA como inline. Si reintroduces inline,
   la página dejará de pintar bajo el CSP estricto.
   ============================================================ */

/* Accesibilidad: contenido oculto visualmente, presente para SR
   (sustituye al patrón position:absolute;clip:rect... inline). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Imagen-foto que rellena un contenedor (clinic-image / card-h-image).
   Antes vivía como style="width:100%;height:100%;object-fit:cover;
   position:absolute;inset:0;" en cards.js. */
.card-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

/* Variante del icono "building-hospital" del card horizontal cuando
   NO hay foto: tono más oscuro. Antes era inline color:var(--primary-darker). */
.card-h-image-icon--dark {
  color: var(--primary-darker);
}

/* Footer flex de la card horizontal (CTA + distancia alineados a la
   derecha). Antes inline display:flex;gap:8px;align-items:center;
   margin-left:auto. */
.card-h-footer-cluster {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

/* Botón "Mi ubicación" en estado activo (portada y mapa).
   Antes: btn.style.background = 'var(--primary-light)' en JS, que es
   CSSOM (no bloqueado por CSP) pero ensucia el modelo. */
.btn-my-location.is-active,
#btn-location.is-active {
  background: var(--primary-light);
}

/* Skeleton para el <h1> de la ficha de clínica.
   Antes: style="display:inline-block;min-width:280px" en clinica.html. */
.skeleton-hero-name {
  display: inline-block;
  min-width: 280px;
}

/* Variante de ancho fijo del skeleton inline (90px). Sustituye al
   style="width:90px" del contador de clínicas del mapa. */
.skeleton-inline--sm { width: 90px; }

/* Aviso de truncado en results-count (listado.html). Antes inline
   color:var(--danger). */
.results-count-truncated {
  color: var(--danger, #E24B4A);
}

/* Input de archivo oculto visualmente (admin, contacto-clínicas).
   No usamos `hidden` porque algunos navegadores no permiten click()
   programático sobre un input[hidden]. */
.hidden-file-input {
  display: none;
}

/* ============================================================
   MAP PIN — divIcons de Leaflet sin inline style
   ------------------------------------------------------------
   El divIcon de Leaflet inserta el HTML que le pasamos. Antes
   ese HTML llevaba style="..." con color, tamaño, sombra. Con
   CSP estricto eso es un violation. La clase se aplica al
   contenedor que crea Leaflet (className: 'map-pin ...'), y el
   contenido HTML queda vacío.
   ============================================================ */

.map-pin {
  width: 20px;
  height: 20px;
  border-radius: 50% 50% 50% 0;
  border: 2px solid white;
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  /* Por defecto verde (clínica general). */
  background: #1D9E75;
  /* Compensar el margen que Leaflet añadiría al <div> interno. */
  box-sizing: border-box;
}

.map-pin--urgent {
  background: #E24B4A;
}

/* Variante usada en la ficha de clínica (pin más grande). */
.map-pin--detail {
  width: 22px;
  height: 22px;
  border-width: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Pin de "tu ubicación": círculo azul con halo. */
.map-pin-user {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #378ADD;
  border: 3px solid white;
  box-shadow: 0 0 0 3px rgba(55,138,221,0.3);
  box-sizing: border-box;
}

/* Popup "Tu ubicación" del mapa.html. */
.popup-user-location {
  font-size: 13px;
  font-weight: 600;
}

/* ============================================================
   PÁGINA 404 — antes <style> inline en 404.html
   ------------------------------------------------------------
   Namespacing bajo .error-page para no colisionar con .btn-back
   de clinica.css (que es absoluto y oscuro, semántica distinta).
   ============================================================ */

.error-page {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  gap: 1rem;
}
.error-page .error-code {
  font-size: 80px;
  font-weight: 800;
  color: var(--primary-light2);
  line-height: 1;
  letter-spacing: -4px;
}
.error-page .error-icon {
  font-size: 48px;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}
.error-page .error-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.error-page .error-desc {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 400px;
  line-height: 1.6;
}
.error-page .error-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
}
.error-page .error-actions .btn-home {
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.error-page .error-actions .btn-back {
  padding: 12px 24px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}
