/* ============================================================
   DIRECTORIO — Hoja de estilos principal
   Estilo limpio tipo app: fondo claro, tipografía grande,
   tarjetas compactas y controles en forma de píldora.
   ============================================================ */

:root {
    --fm-bg: #f5f5f7;
    --fm-ink: #1d1d1f;
    --fm-ink-2: #6e6e73;
    --fm-ink-3: #86868b;
    --fm-line: #e5e5ea;
    --fm-line-soft: #e8e8ed;
    --fm-blue: #0071e3;
    --fm-blue-hover: #0077ed;
}

html { scrollbar-gutter: stable; }

body {
    background: var(--fm-bg);
    color: var(--fm-ink);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- CABECERA ---------- */
.site-header {
    background: rgba(255, 255, 255, 0.78);
    color: var(--fm-ink);
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
}
.header-brand { display: flex; align-items: center; height: 52px; text-align: left; flex-shrink: 0; }
.header-brand-name {
    color: var(--fm-ink);
    font-size: 17px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
}
.header-search { flex: 1; max-width: 420px; margin: 0 auto; }
.header-search input {
    height: 36px;
    padding-left: 16px;
    background: #f5f5f7;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 13px;
    color: var(--fm-ink);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.header-search input:focus {
    background: #fff;
    border-color: #d2d2d7;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
    outline: none;
}
.subscribe-soft {
    display: inline-flex;
    align-items: center;
    padding: 6px 0;
    background: transparent;
    border: 0;
    color: var(--fm-blue);
    font-size: 13px;
    font-weight: 600;
}
.subscribe-soft:hover { background: transparent; text-decoration: underline; }
#mobileSearch input {
    background: #fff;
    border-color: var(--fm-line);
    border-radius: 999px;
    font-size: 13px;
}
#mobileSearch input:focus {
    border-color: #d2d2d7;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
    outline: none;
}

/* ---------- CONTENIDO ---------- */
.fm-main {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px 64px;
    flex: 1;
}

.fm-eyebrow {
    margin: 0 0 10px;
    color: var(--fm-ink-3);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---------- CATEGORÍAS ---------- */
.category-strip { background: transparent; border-bottom: 0; margin-top: 18px; }
#categoryList {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0 14px;
}
#categoryList::-webkit-scrollbar { display: none; }
.category-option {
    flex: none;
    padding: 7px 14px;
    border: 1px solid var(--fm-line);
    border-radius: 999px;
    background: #fff;
    color: var(--fm-ink);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.category-option:hover { background: #fafafa; border-color: #d2d2d7; }
.category-option[aria-pressed="true"] {
    background: var(--fm-ink);
    border-color: var(--fm-ink);
    color: #fff;
}

/* ---------- BARRA DE RESULTADOS ---------- */
.results-toolbar { margin: 8px 0 14px; }
.results-count { color: var(--fm-ink-2); font-size: 13px; font-weight: 500; }
.filter-toggle,
.results-sort {
    height: 34px;
    background: #fff;
    border: 1px solid var(--fm-line);
    border-radius: 999px;
    box-shadow: none;
    color: var(--fm-ink);
    font-size: 13px;
    font-weight: 500;
}
.filter-toggle:hover,
.results-sort:hover { background: #fafafa; }
.filter-toggle:focus-visible,
.results-sort:focus-visible {
    outline: none;
    border-color: #d2d2d7;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

/* ---------- GRILLA ---------- */
#providerGrid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

/* ---------- ESTADO VACÍO ---------- */
#emptyState {
    padding: 56px 20px;
    background: #fff;
    border: 1px solid var(--fm-line-soft);
    border-radius: 20px;
    box-shadow: none;
}
#resetFiltersEmpty {
    background: #f5f5f7;
    color: var(--fm-ink);
    border-radius: 999px;
}
#resetFiltersEmpty:hover { background: #e8e8ed; }

/* ---------- INVITACIÓN FINAL ---------- */
.fm-cta { margin-top: 40px; scroll-margin-top: 68px; }
.fm-cta-inner {
    padding: 36px 28px;
    background: #fff;
    border: 1px solid var(--fm-line-soft);
    border-radius: 24px;
    text-align: center;
}
.fm-cta h2 {
    margin: 4px 0 8px;
    color: var(--fm-ink);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.fm-cta p:not(.fm-eyebrow) {
    max-width: 460px;
    margin: 0 auto;
    color: var(--fm-ink-2);
    font-size: 14px;
    line-height: 1.5;
}
.fm-cta a {
    display: inline-flex;
    align-items: center;
    margin-top: 18px;
    padding: 10px 22px;
    background: var(--fm-ink);
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
}
.fm-cta a:hover { background: #333336; }

/* ---------- PANEL DE FILTROS ---------- */
#moreFilters {
    border-radius: 0 20px 20px 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
    will-change: transform;
    backface-visibility: hidden;
}
#filterDrawerBackdrop { will-change: opacity; }
#moreFilters > div:first-child { background: #fff; }
#moreFilters > div:first-child svg { color: var(--fm-ink-2); }
#moreFilters select {
    background: #f5f5f7;
    border-color: transparent;
    border-radius: 12px;
}
#moreFilters select:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}
#resetFilters { background: #f5f5f7; border-radius: 999px; }
#resetFilters:hover { background: #e8e8ed; }
#applyFilterDrawer { background: var(--fm-ink); border-radius: 999px; }
#applyFilterDrawer:hover { background: #333336; }

/* ---------- FICHA ---------- */
#modalDetail {
    background: rgba(0, 0, 0, 0.32);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
#modalDetailContent {
    max-width: 600px;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}
#modalTitle { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.detail-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    padding: 14px 16px;
    background: #f5f5f7;
    border: 0;
    border-radius: 16px;
    font-size: 13px;
}
.detail-info dt {
    color: var(--fm-ink-3);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 3px;
}
.detail-info dd { color: var(--fm-ink); font-weight: 600; }
#modalDetailContent > div:last-child {
    background: #fff;
    border-top: 1px solid #f2f2f4;
}
#modalCallBtn { background: var(--fm-ink); border-radius: 999px; font-weight: 600; }
#modalCallBtn:hover { background: #333336; }
#modalWhatsappBtn { background: var(--fm-blue); border-radius: 999px; font-weight: 600; }
#modalWhatsappBtn:hover { background: var(--fm-blue-hover); }

/* ---------- PIE ---------- */
.site-footer {
    margin-top: auto;
    background: transparent;
    border-top: 1px solid var(--fm-line);
    color: var(--fm-ink-2);
}
.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a {
    display: inline-flex;
    align-items: center;
    padding: 4px 0;
    background: transparent;
    border: 0;
    color: var(--fm-blue);
    font-size: 12px;
    font-weight: 500;
    transition: color 0.15s;
}
.footer-links a:hover { background: transparent; text-decoration: underline; }
.footer-legal { border-top: 1px solid var(--fm-line); }
.footer-legal p {
    max-width: 1120px;
    margin: 0 auto;
    padding: 14px 20px 24px;
    color: var(--fm-ink-3);
    font-size: 11px;
    line-height: 1.55;
    text-align: center;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1199px) {
    #providerGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
    #providerGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
    #providerGrid { grid-template-columns: minmax(0, 1fr); }
    .fm-main { padding: 0 16px 48px; }
    .fm-cta-inner { padding: 28px 20px; }
    .footer-inner { gap: 14px; }
}
