/* ============================================
   BuscaMedico.es — Main Stylesheet
   Directory of doctors and specialists in Spain
   ============================================ */

/* ----- 1. Reset & CSS Variables ----- */

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

:root {
  --accent: #1e40af;
  --accent-light: #3b82f6;
  --accent-hover: #1e3a8a;
  --accent-soft: rgba(59, 130, 246, 0.08);
  --green: #059669;
  --green-light: #10b981;
  --amber: #f59e0b;
  --text: #1e293b;
  --text-muted: #64748b;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
a { text-decoration: none; color: var(--accent-light); transition: color var(--transition); }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; border: none; outline: none; background: none; }
table { border-collapse: collapse; width: 100%; }

/* ----- 2. Base ----- */

body {
  background: var(--bg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4, h5, h6 { line-height: 1.25; font-weight: 700; color: var(--text); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
p + p { margin-top: 1rem; }

/* ----- 3. Header ----- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1.25rem;
  color: var(--accent); text-decoration: none;
  white-space: nowrap; min-width: 0; flex-shrink: 1; overflow: hidden;
}
.logo svg, .logo img { width: 32px; height: 32px; flex-shrink: 0; }
.logo:hover { color: var(--accent-hover); }

.main-nav ul { display: flex; align-items: center; gap: 1.5rem; }
.main-nav a {
  font-size: 0.9375rem; font-weight: 500; color: var(--text-muted);
  transition: color var(--transition); padding: 0.25rem 0;
}
.main-nav a:hover, .main-nav a.active { color: var(--accent); }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center;
  align-items: center; gap: 5px; width: 40px; height: 40px; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px; background: var(--text);
  border-radius: 2px; transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ----- 4. Hero ----- */

.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e40af 100%);
  color: #fff; text-align: center; padding: 4.5rem 1rem 4rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; right: -20%; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(59,130,246,.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 { font-size: 2.75rem; color: #fff; margin-bottom: 0.75rem; font-weight: 800; line-height: 1.15; position: relative; }
.hero__subtitle {
  font-size: 1.15rem; color: rgba(255, 255, 255, 0.8);
  max-width: 640px; margin: 0 auto 2rem; line-height: 1.6; position: relative;
}
.hero__trust {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 1.5rem;
  margin-top: 1.5rem; position: relative;
}
.hero__trust span {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .85rem; color: rgba(255,255,255,.7); font-weight: 500;
}
.hero__trust svg { opacity: .7; }

/* ----- 5. Search Box ----- */

.search-section { padding: 1.5rem 0; }

.search-box {
  background: var(--card); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow-lg);
  max-width: 900px; margin: 0 auto; position: relative;
}
.search-form { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.search-form input[type="text"],
.search-form input[type="search"],
.search-form input[list] {
  flex: 1 1 180px; padding: 0.75rem 1rem;
  border: 1px solid var(--border); border-radius: calc(var(--radius) - 4px);
  font-size: 1rem; color: var(--text); background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-form input:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.search-form select {
  flex: 0 1 200px; padding: 0.75rem 1rem;
  border: 1px solid var(--border); border-radius: calc(var(--radius) - 4px);
  font-size: 1rem; color: var(--text); background: var(--bg);
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center;
  padding-right: 2.25rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-form select:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.search-form .btn-search {
  flex-shrink: 0; padding: 0.75rem 1.5rem;
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 1rem;
  border-radius: calc(var(--radius) - 4px); cursor: pointer;
  transition: background var(--transition);
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.search-form .btn-search:hover { background: var(--accent-hover); }
.search-form input[list] { flex: 0 1 160px; }
.search-form input[disabled] { opacity: .5; cursor: not-allowed; }

/* ----- 6. Stats Grid ----- */

.stats-section { padding: 3.5rem 0; }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card__number {
  display: block; font-size: 2.25rem; font-weight: 800;
  color: var(--accent); line-height: 1.2;
}
.stat-card__label {
  display: block; font-size: 0.875rem; color: var(--text-muted); margin-top: 0.25rem;
}

/* ----- 7. Homepage sections ----- */

/* Steps */
.hp-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 1.5rem;
}
.hp-step { text-align: center; }
.hp-step__icon {
  width: 64px; height: 64px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.hp-step h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.hp-step p { font-size: .9rem; color: var(--text-muted); line-height: 1.5; }

/* Top cards */
.hp-top-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem;
}
.hp-top-card {
  display: flex; align-items: center; gap: .75rem;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .85rem 1rem; text-decoration: none; color: var(--text);
  transition: all var(--transition);
}
.hp-top-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--accent-light); color: var(--text); }
.hp-top-card__rank {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff; font-weight: 800; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
}
.hp-top-card__info { display: flex; flex-direction: column; }
.hp-top-card__info strong { font-size: .95rem; }
.hp-top-card__info small { font-size: .8rem; color: var(--text-muted); }

/* A-Z Grid */
.hp-alpha-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem;
}
.hp-alpha-group__letter {
  font-size: 1.25rem; font-weight: 800; color: var(--accent);
  padding-bottom: .35rem; margin-bottom: .5rem;
  border-bottom: 2px solid var(--accent-soft);
}
.hp-alpha-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: .3rem .5rem; font-size: .875rem; color: var(--text);
  border-radius: 6px; transition: all var(--transition); text-decoration: none;
}
.hp-alpha-link:hover { background: var(--accent-soft); color: var(--accent); }
.hp-alpha-link span { font-size: .75rem; color: var(--text-muted); font-weight: 600; }

/* CTA sections */
.hp-cta {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #fff; padding: 3.5rem 1rem; text-align: center;
}
.hp-cta h2 { color: #fff; font-size: 1.75rem; margin-bottom: .75rem; }
.hp-cta p { color: rgba(255,255,255,.85); max-width: 560px; margin: 0 auto 1.5rem; font-size: 1.05rem; }
.hp-cta--dark { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }

/* Blog cards */
.hp-blog-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem;
}
.hp-blog-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; text-decoration: none; color: var(--text);
  transition: all var(--transition); display: flex; flex-direction: column;
}
.hp-blog-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--accent-light); color: var(--text); }
.hp-blog-card__cat {
  display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--accent-light); margin-bottom: .75rem;
}
.hp-blog-card h3 { font-size: 1.1rem; margin-bottom: .5rem; line-height: 1.35; }
.hp-blog-card p { font-size: .875rem; color: var(--text-muted); line-height: 1.5; flex: 1; }
.hp-blog-card__link { font-size: .85rem; font-weight: 600; color: var(--accent-light); margin-top: 1rem; }

/* ----- 8. Province/Specialty Grid ----- */

.province-section { padding: 3rem 0; }
.province-section h2 { margin-bottom: 1.5rem; }

.province-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.province-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  text-decoration: none; color: var(--text);
  transition: box-shadow var(--transition), transform var(--transition);
}
.province-card:hover {
  box-shadow: var(--shadow-md); transform: translateY(-2px); color: var(--accent);
}
.province-card__name { font-weight: 600; font-size: 1rem; }
.province-card__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; height: 1.75rem; padding: 0 0.5rem;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.8125rem; font-weight: 600; border-radius: 9999px;
}

/* ----- 9. Directorio Grid ----- */

.directorio-section { padding: 3rem 0; }
.directorio-section h2 { margin-bottom: 1.5rem; }

.directorio-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.medico-card {
  background: var(--card); border: 1px solid var(--border);
  border-left: 4px solid var(--accent-light);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.medico-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.medico-card__name { font-weight: 700; font-size: 1.0625rem; margin-bottom: 0.5rem; }
.medico-card__name a { color: var(--text); }
.medico-card__name a:hover { color: var(--accent); }

.medico-card__specialty {
  display: inline-block; background: var(--accent-soft);
  color: var(--accent); font-size: 0.8125rem; font-weight: 600;
  padding: 0.2rem 0.6rem; border-radius: 9999px; margin-bottom: 0.75rem;
}
.medico-card__mutua {
  display: inline-block; background: rgba(139, 92, 246, 0.1);
  color: #7c3aed; font-size: 0.75rem; font-weight: 600;
  padding: 0.15rem 0.5rem; border-radius: 9999px; margin-left: 0.25rem;
}

/* -- Card header with avatar -- */
.medico-card__header { display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem; }
.medico-card__header-text { flex: 1; min-width: 0; }
.medico-card__header-text .medico-card__name { margin-bottom: .25rem; }
.medico-card__header-text .medico-card__specialty { margin-bottom: 0; }
.medico-card__avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-light)); flex-shrink: 0;
  text-transform: uppercase;
}
.medico-card__avatar--premium { background: linear-gradient(135deg, #f59e0b, #d97706); }
.medico-card__avatar--foto {
  object-fit: cover; border: 2px solid #f59e0b;
  box-shadow: 0 2px 8px rgba(245,158,11,.2);
}

.medico-card__meta { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }
.medico-card__meta dt { display: inline; font-weight: 600; color: var(--text); }
.medico-card__meta dt::after { content: ": "; }
.medico-card__meta dd { display: inline; margin: 0; }
.medico-card__meta dd::after { content: ""; display: block; }

.medico-card__link {
  display: inline-block; margin-top: 0.5rem;
  font-size: 0.8125rem; font-weight: 600;
  color: var(--accent-light); text-decoration: none;
}
.medico-card__link:hover { text-decoration: underline; color: var(--accent); }

/* -- Premium card -- */
.medico-card--premium {
  border-left-color: #f59e0b;
  box-shadow: 0 2px 12px rgba(245, 158, 11, .12);
  position: relative;
}
.medico-card--premium:hover {
  box-shadow: 0 4px 20px rgba(245, 158, 11, .18);
}
.medico-card__premium-badge {
  position: absolute;
  top: .65rem; right: .75rem;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #fff; font-size: .7rem; font-weight: 700;
  padding: .15rem .55rem; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .04em;
  box-shadow: 0 1px 4px rgba(245, 158, 11, .3);
}

/* -- Presupuesto page layout -- */
.presupuesto-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start;
}
@media (max-width: 768px) {
  .presupuesto-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* -- Mutua badges con logos -- */
.mutua-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 6px; font-weight: 600; vertical-align: middle;
  transition: box-shadow .2s ease;
}
.mutua-badge:hover { box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.mutua-badge img { flex-shrink: 0; height: 14px; width: auto; display: inline-block; }
.mutua-badge--sm { padding: .2rem .5rem; font-size: .72rem; }
.mutua-badge--sm img { height: 14px; }
.mutua-badge--lg { padding: .35rem .7rem; font-size: .85rem; }
.mutua-badge--lg img { height: 20px; }
.mutua-badges-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }

/* -- Mutua quick-filter chips -- */
.mutua-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  margin-top: 1rem; padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.mutua-filters__label { font-size: .8rem; color: var(--text-muted); font-weight: 500; }
.mutua-filter-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .75rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
  text-decoration: none; transition: all .2s ease; cursor: pointer;
}
.mutua-filter-chip img { height: 18px; width: auto; flex-shrink: 0; display: inline-block; }
.mutua-filter-chip:hover { border-color: var(--accent-light); color: var(--accent); background: var(--accent-soft); box-shadow: 0 1px 4px rgba(59,130,246,.1); }
.mutua-filter-chip--active { background: var(--accent); color: #fff; border-color: var(--accent); }
.mutua-filter-chip--active:hover { background: var(--accent-hover); color: #fff; }
.mutua-filter-chip--active img { filter: brightness(10); }
.mutua-filter-chip--clear { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.mutua-filter-chip--clear:hover { background: #fee2e2; border-color: #dc2626; color: #dc2626; }

/* ----- 10. Ficha ----- */

.ficha-header { padding: 2.5rem 0 1.5rem; }
.ficha-header h1 { font-size: 2rem; margin-bottom: 0.75rem; }

.ficha-body { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding-bottom: 3rem; }

.ficha-data {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.ficha-data h2 {
  font-size: 1.125rem; margin-bottom: 1rem;
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--border);
}
.ficha-data table { width: 100%; border-collapse: collapse; }
.ficha-data th, .ficha-data td {
  padding: 0.55rem 0.5rem; font-size: 0.9rem;
  text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.ficha-data th { font-weight: 600; color: var(--text-muted); width: 35%; white-space: nowrap; }
.ficha-data td { color: var(--text); }
.ficha-data tr:last-child th, .ficha-data tr:last-child td { border-bottom: none; }

.ficha-map {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.ficha-map h2 { font-size: 1.125rem; padding: 1.25rem 1.5rem 1rem; }
.ficha-map__container { position: relative; width: 100%; height: 300px; }
.ficha-map__container iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}

/* ----- 11. Breadcrumb ----- */

.breadcrumb { padding: 1rem 0; font-size: 0.875rem; color: var(--text-muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0; }
.breadcrumb li { display: inline-flex; align-items: center; }
.breadcrumb li + li::before { content: "/"; margin: 0 0.5rem; color: var(--border); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb li:last-child { color: var(--text); font-weight: 500; }

/* ----- 12. Pagination ----- */

.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 0.375rem; padding: 2rem 0; flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.5rem; height: 2.5rem; padding: 0 0.75rem;
  font-size: 0.875rem; font-weight: 500;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.pagination a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .current, .pagination .active {
  background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700;
}
.pagination .dots { border: none; background: transparent; color: var(--text-muted); min-width: auto; padding: 0 0.25rem; }

/* ----- 13. Footer ----- */

.site-footer { background: #0f172a; color: rgba(255,255,255,0.7); padding: 3rem 0 0; margin-top: 3rem; }
.footer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
  max-width: 1200px; margin: 0 auto; padding: 0 1rem 2rem;
}
.footer-grid h3, .footer-grid h4 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.footer-grid ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-grid a { color: rgba(255,255,255,0.6); font-size: 0.875rem; transition: color var(--transition); }
.footer-grid a:hover { color: #fff; }
.footer-grid p { font-size: 0.875rem; line-height: 1.6; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  max-width: 1200px; margin: 0 auto;
  padding: 1.25rem 1rem; font-size: 0.8125rem; color: rgba(255,255,255,0.45);
}

/* ----- 14. Utilities ----- */

.badge {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  padding: 0.2rem 0.6rem; border-radius: 9999px;
  background: var(--accent-soft); color: var(--accent); line-height: 1.4;
}
.badge--warning { background: rgba(234,179,8,0.1); color: #a16207; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 0.625rem 1.25rem;
  font-size: 0.9375rem; font-weight: 600;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  cursor: pointer; text-decoration: none; line-height: 1.4;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn:hover { background: var(--bg); border-color: var(--text-muted); color: var(--text); }

.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-lg { padding: 0.875rem 1.75rem; font-size: 1.0625rem; }

.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }

.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }

.results-count { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.5rem; }

/* -- Results bar (count + sort) -- */
.results-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.results-sort { display: flex; align-items: center; gap: .4rem; }
.results-sort label { font-size: .85rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.results-sort select {
  padding: .4rem .7rem; font-size: .85rem; border: 1px solid var(--border);
  border-radius: 6px; background: var(--card); color: var(--text); cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .5rem center; padding-right: 1.75rem;
}

/* -- Favorite heart -- */
.fav-btn {
  position: absolute; top: .65rem; right: .75rem;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.9); border: 1px solid var(--border);
  cursor: pointer; transition: all .2s ease; z-index: 2;
}
.medico-card--premium .fav-btn { right: 5.5rem; }
.fav-btn:hover { background: #fef2f2; border-color: #fca5a5; }
.fav-btn svg { width: 16px; height: 16px; transition: all .15s ease; }
.fav-btn--active { background: #fef2f2; border-color: #f87171; }
.fav-btn--active svg { fill: #ef4444; stroke: #ef4444; }

.no-results { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }

html, body { overflow-x: hidden; max-width: 100vw; }

.ficha-data td, .medico-card__meta dd { word-break: break-word; overflow-wrap: anywhere; }

/* ----- 15. Responsive ----- */

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--card); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow); z-index: 99;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 0.5rem 0; }
  .main-nav a { display: block; padding: 0.75rem 1.5rem; font-size: 1rem; }
  .main-nav a:hover { background: var(--bg); }

  .hero { padding: 3rem 1rem 2.5rem; }
  .hero h1 { font-size: 1.85rem; }
  .hero__subtitle { font-size: 1rem; margin-bottom: 1.5rem; }
  .hero__trust { gap: .75rem; }

  .search-box { padding: 1rem; }
  .search-form { flex-direction: column; }
  .search-form input[type="text"], .search-form input[type="search"], .search-form select, .search-form input[list] { flex: 1 1 auto; width: 100%; }
  .search-form .btn-search { width: 100%; justify-content: center; }

  .hp-steps { grid-template-columns: 1fr; gap: 1.5rem; }
  .hp-blog-grid { grid-template-columns: 1fr; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .province-grid { grid-template-columns: 1fr; }
  .directorio-grid { grid-template-columns: 1fr; }
  .ficha-body { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }

  .stats-section, .province-section, .directorio-section { padding: 2rem 0; }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.5rem; }
  .header-inner { height: 56px; }
  .main-nav { top: 56px; }
  .container { padding: 0 0.75rem; }
  .hp-alpha-grid { grid-template-columns: repeat(2, 1fr); }
}

@media print {
  .site-header, .site-footer, .nav-toggle, .search-box, .pagination { display: none; }
  body { background: #fff; color: #000; }
  .hero { background: none; color: #000; padding: 1rem 0; }
  .hero h1 { color: #000; }
}
