/* =========================================================================
   Directorios de Obra Social: Cartilla médica (Prestadores/) y Farmacias (farmacia/)
   Hoja compartida. Se apoya en ../home.css (mismo sistema que el inicio).
   Color: turquesa de Obra Social (#0d83a0, el mismo de header.js). Prefijo d-.
   ========================================================================= */

:root {
    --os-950: #04222b;
    --os-900: #06303b;
    --os-800: #075c73;
    --os-700: #0d83a0;
    --os-600: #129eba;
    --os-100: #cfe9f0;
    --os-50: #e9f5f8;
    --os-light: #7fd6ea;

    --icon-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s6-5.6 6-11a6 6 0 1 0-12 0c0 5.4 6 11 6 11Z'/%3E%3Ccircle cx='12' cy='10' r='2.3'/%3E%3C/svg%3E");
    --icon-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 16.2v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 1.1 3.5a2 2 0 0 1 2-2.2h3a2 2 0 0 1 2 1.7c.1.9.3 1.8.6 2.6a2 2 0 0 1-.4 2.1L7 9a16 16 0 0 0 8 8l1.3-1.3a2 2 0 0 1 2.1-.4c.8.3 1.7.5 2.6.6a2 2 0 0 1 1.7 2Z'/%3E%3C/svg%3E");
    --icon-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.7v4.8l3.2 1.8'/%3E%3C/svg%3E");
}

:focus-visible {
    outline-color: rgba(13, 131, 160, 0.5);
}

/* <body class="os-theme">: las piezas de home.css (panel de accesos, eyebrows,
   botones, ventanas) pasan a turquesa. nav.css y footer.css no usan estas variables. */
.os-theme {
    --green-950: var(--os-950);
    --green-900: var(--os-900);
    --green-800: var(--os-800);
    --green-700: var(--os-700);
    --green-600: #0a7590;
    --green-500: var(--os-600);
    --green-100: var(--os-100);
    --green-50: var(--os-50);
}

.os-theme .document-modal {
    background: rgba(4, 34, 43, 0.72);
}

.ico {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Icono por máscara: toma el color del texto. */
.d-mask {
    display: inline-block;
    flex: none;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

/* =========================================================================
   HERO
   ========================================================================= */
.d-hero {
    position: relative;
    margin-top: var(--nav-h);
    padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(6.5rem, 11vw, 8.5rem);
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(900px 400px at 85% -10%, rgba(18, 158, 186, 0.55), transparent 70%),
        radial-gradient(600px 300px at 0% 110%, rgba(127, 214, 234, 0.18), transparent 70%),
        linear-gradient(135deg, var(--os-950) 0%, var(--os-900) 45%, var(--os-800) 100%);
    isolation: isolate;
}

/* Icono grande decorativo a la derecha. */
.d-hero-art {
    position: absolute;
    right: max(1.25rem, calc((100% - 1240px) / 2));
    top: 50%;
    z-index: -1;
    width: clamp(220px, 30vw, 380px);
    height: auto;
    color: rgba(127, 214, 234, 0.14);
    transform: translateY(-46%) rotate(-8deg);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.d-hero > .container > * {
    animation: d-rise 0.8s var(--ease) both;
}

.d-hero > .container > :nth-child(2) { animation-delay: 0.06s; }
.d-hero > .container > :nth-child(3) { animation-delay: 0.12s; }
.d-hero > .container > :nth-child(4) { animation-delay: 0.2s; }

@keyframes d-rise {
    from { opacity: 0; transform: translateY(18px); }
}

.d-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.6rem;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.88rem;
    list-style: none;
}

.d-crumbs li + li::before {
    content: "/";
    margin-right: 0.5rem;
    color: rgba(255, 255, 255, 0.35);
}

.d-crumbs a {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.d-crumbs a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.d-hero .eyebrow {
    color: var(--os-light);
}

.d-hero h1 {
    font-size: clamp(2.7rem, 6.2vw, 4.9rem);
    font-weight: 900;
    line-height: 0.94;
    letter-spacing: -0.045em;
    font-kerning: normal;
}

.d-hero h1 span {
    display: block;
}

.d-hero-lead {
    position: relative;
    max-width: 36ch;
    margin-top: clamp(1.1rem, 2.2vw, 1.6rem);
    padding-top: clamp(1rem, 2vw, 1.4rem);
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 300;
    line-height: 1.32;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.d-hero-lead::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0.06em;
    width: 3.2rem;
    height: 3px;
    border-radius: 3px;
    background: var(--os-600);
}

/* =========================================================================
   PANEL SUPERPUESTO: buscador + filtro por localidad
   ========================================================================= */
.d-panel-wrap {
    position: relative;
    z-index: 5;
    margin-top: calc(-1 * clamp(4rem, 8vw, 5.5rem));
}

.d-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
    padding: clamp(1.1rem, 2.4vw, 1.75rem);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.d-search-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.d-search {
    position: relative;
    display: block;
    flex: 1;
    min-width: 0;
}

.d-search input {
    min-width: 0;
}

.d-search .ico {
    position: absolute;
    top: 50%;
    left: 1.15rem;
    width: 22px;
    height: 22px;
    color: var(--os-700);
    transform: translateY(-50%);
    pointer-events: none;
}

.d-search input {
    width: 100%;
    min-height: 58px;
    padding: 0.85rem 1.1rem 0.85rem 3.3rem;
    border: 1.5px solid var(--line);
    border-radius: 16px;
    background: var(--surface-2);
    color: var(--ink);
    font: inherit;
    font-size: 1.02rem;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.d-search input::placeholder {
    color: #7b8a84;
}

.d-search input:focus {
    outline: none;
    border-color: var(--os-700);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(13, 131, 160, 0.14);
}

.d-count {
    flex: none;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: var(--os-50);
    color: var(--os-800);
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
}

.d-chips-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.d-chips-label {
    flex: none;
    padding-top: 0.55rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.d-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    min-width: 0;
}

.d-chip {
    padding: 0.45rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-2);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.d-chip:hover {
    border-color: var(--os-100);
    background: var(--os-50);
}

.d-chip[aria-pressed="true"] {
    border-color: var(--os-700);
    background: var(--os-700);
    color: #fff;
}

/* =========================================================================
   LISTADO
   ========================================================================= */
.d-list {
    padding-block: clamp(2rem, 4vw, 3rem) clamp(3.5rem, 7vw, 5.5rem);
}

.is-hidden {
    display: none !important;
}

.d-empty {
    display: grid;
    justify-items: center;
    gap: 0.4rem;
    padding: 3rem 1rem;
    border: 1.5px dashed var(--os-100);
    border-radius: var(--radius-lg);
    color: var(--muted);
    text-align: center;
}

.d-empty strong {
    color: var(--ink);
    font-size: 1.1rem;
}

.d-empty[hidden] {
    display: none;
}

/* ---------- Cartilla: tabla en PC ---------- */
.providers-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.55rem;
    margin-top: -0.55rem;
}

.providers-table thead th {
    padding: 0.4rem 1.2rem;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-align: left;
    text-transform: uppercase;
}

.providers-table tbody tr {
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.providers-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.providers-table td {
    padding: 1rem 1.2rem;
    border-block: 1px solid var(--line);
    color: var(--ink-2);
    font-size: 0.95rem;
    vertical-align: middle;
}

.providers-table td:first-child {
    width: 15%;
    border-left: 1px solid var(--line);
    border-radius: 16px 0 0 16px;
}

.providers-table td:nth-child(2) {
    width: 26%;
    color: var(--ink);
    font-weight: 700;
}

.providers-table td:nth-child(3) {
    width: 22%;
}

.providers-table td:last-child {
    border-right: 1px solid var(--line);
    border-radius: 0 16px 16px 0;
}

.locality-pill,
.specialty-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

.locality-pill {
    gap: 0.35rem;
    background: var(--os-50);
    color: var(--os-800);
}

.specialty-pill {
    border: 1px solid var(--os-100);
    color: var(--os-800);
}

/* ---------- Farmacias: tarjetas ---------- */
.pharmacy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 0.9rem;
}

.pharmacy-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.2rem 1.25rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}

.pharmacy-card:hover {
    transform: translateY(-3px);
    border-color: var(--os-100);
    box-shadow: var(--shadow-md);
}

.pharmacy-card-title {
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

.pharmacy-card-row {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.pharmacy-card-row + .pharmacy-card-row {
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

.pharmacy-card-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--os-50);
    color: var(--os-700);
}

.pharmacy-card-icon::before {
    content: "";
    width: 17px;
    height: 17px;
    background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.pharmacy-card-icon-pin { --icon: var(--icon-pin); }
.pharmacy-card-icon-phone { --icon: var(--icon-phone); }

.pharmacy-card-address {
    display: grid;
    gap: 0.05rem;
    min-width: 0;
    line-height: 1.35;
}

.pharmacy-card-address strong {
    color: var(--ink);
    font-size: 0.96rem;
    font-weight: 600;
}

.pharmacy-card-address span {
    color: var(--muted);
    font-size: 0.86rem;
}

.pharmacy-card-phone {
    align-self: center;
    color: var(--os-800);
    font-size: 0.98rem;
    font-weight: 700;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

.pharmacy-card-phone:hover {
    color: var(--os-700);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* =========================================================================
   SEDE CENTRAL (Farmacias)
   ========================================================================= */
.d-contact {
    padding-bottom: clamp(3.5rem, 7vw, 5.5rem);
}

.d-contact-card {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 2fr);
    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: center;
    padding: clamp(1.5rem, 3vw, 2.4rem);
    border-radius: var(--radius-lg);
    color: #fff;
    background:
        radial-gradient(500px 260px at 100% 0%, rgba(18, 158, 186, 0.45), transparent 70%),
        linear-gradient(135deg, var(--os-900), var(--os-800));
}

.d-contact-card .eyebrow {
    color: var(--os-light);
}

.d-contact-card h2 {
    font-size: clamp(1.6rem, 2.8vw, 2.1rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.d-contact-card > div > p {
    margin-top: 0.6rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
}

.d-contact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.d-contact-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
    transition: background 0.25s, border-color 0.25s;
}

a.d-contact-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.24);
}

.d-contact-item .d-mask {
    width: 20px;
    height: 20px;
    color: var(--os-light);
}

.d-contact-item span:last-child {
    display: grid;
    min-width: 0;
}

.d-contact-item small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.d-contact-item strong {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

/* =========================================================================
   TAMBIÉN EN OBRA SOCIAL
   ========================================================================= */
.d-more {
    padding-block: clamp(3rem, 6vw, 4.5rem);
    background: var(--surface-2);
}

.d-more .section-head h2 {
    font-size: clamp(1.5rem, 2.6vw, 1.9rem);
}

.d-more .eyebrow {
    color: var(--os-700);
}

.d-more-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.d-more-card {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    padding: 1.1rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}

.d-more-card:hover {
    transform: translateY(-3px);
    border-color: var(--os-100);
    box-shadow: var(--shadow-md);
}

.d-more-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--os-50);
    color: var(--os-700);
    transition: background 0.25s, color 0.25s, transform 0.35s var(--ease);
}

.d-more-icon .ico {
    width: 23px;
    height: 23px;
    stroke-width: 1.8;
}

.d-more-card:hover .d-more-icon {
    background: var(--os-700);
    color: #fff;
    transform: rotate(-6deg) scale(1.04);
}

.d-more-copy {
    display: grid;
    flex: 1;
    gap: 0.1rem;
    min-width: 0;
}

.d-more-copy strong {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.d-more-copy span {
    color: var(--muted);
    font-size: 0.87rem;
    line-height: 1.4;
}

.d-more-go {
    color: var(--os-700);
    font-weight: 700;
    transition: transform 0.25s var(--ease);
}

.d-more-card:hover .d-more-go {
    transform: translateX(3px);
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
    .d-contact-card {
        grid-template-columns: 1fr;
    }

    .d-more-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .d-hero-art {
        right: -2.5rem;
        top: auto;
        bottom: 2.5rem;
        width: 220px;
        transform: rotate(-8deg);
    }

    .d-chips-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
        min-width: 0;
    }

    .d-chips-label {
        padding-top: 0;
    }

    /* En celular las localidades se deslizan con el dedo. */
    .d-chips {
        flex-wrap: nowrap;
        max-width: none;
        width: calc(100% + 1.1rem);
        margin-right: -1.1rem;
        padding-right: 1.1rem;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .d-chips::-webkit-scrollbar {
        display: none;
    }

    .d-contact-grid {
        grid-template-columns: 1fr;
    }
}

/* Cartilla en celular: cada fila es una tarjeta (Prestador, Localidad, Especialidad, Horario).
   Los nth-child siguen el orden fijo de columnas de createProviderRow(). */
@media (max-width: 720px) {
    .providers-table,
    .providers-table tbody {
        display: block;
        margin-top: 0;
    }

    .providers-table thead {
        display: none;
    }

    .providers-table tbody {
        display: grid;
        gap: 0.75rem;
    }

    .providers-table tbody tr {
        display: grid;
        gap: 0.55rem;
        padding: 1.1rem 1.15rem;
        border: 1px solid var(--line);
        border-radius: var(--radius);
    }

    .providers-table tbody tr:hover {
        transform: none;
    }

    .providers-table td,
    .providers-table td:first-child,
    .providers-table td:last-child {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        width: auto;
        padding: 0;
        border: 0;
        border-radius: 0;
        font-size: 0.93rem;
    }

    .providers-table td:nth-child(2),
    .providers-table td:nth-child(3) {
        width: auto;
    }

    .providers-table td:nth-child(2) {
        order: -1;
        color: var(--ink);
        font-size: 1.08rem;
        font-weight: 800;
        letter-spacing: -0.015em;
    }

    .providers-table td:first-child .locality-pill {
        padding: 0;
        background: none;
        color: var(--ink-2);
        font-size: 0.93rem;
        font-weight: 500;
    }

    .providers-table td:first-child::before,
    .providers-table td:last-child::before {
        content: "";
        flex: none;
        width: 17px;
        height: 17px;
        background: var(--os-700);
        -webkit-mask: var(--icon) center / contain no-repeat;
        mask: var(--icon) center / contain no-repeat;
    }

    .providers-table td:first-child::before { --icon: var(--icon-pin); }
    .providers-table td:last-child::before { --icon: var(--icon-clock); }

    .providers-table td:nth-child(3) {
        order: 1;
    }

    .providers-table td:last-child {
        order: 2;
        align-items: flex-start;
        margin-top: 0.2rem;
        padding-top: 0.65rem;
        border-top: 1px solid var(--line);
        color: var(--ink-2);
    }

    .providers-table td:last-child::before {
        margin-top: 0.15rem;
    }
}

@media (max-width: 540px) {
    .d-panel {
        padding: 0.9rem;
        border-radius: 20px;
    }

    .d-search-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }

    .d-search input {
        min-height: 54px;
        font-size: 1rem;
    }

    .d-count {
        align-self: flex-start;
        padding: 0.35rem 0.8rem;
        font-size: 0.85rem;
    }

    .d-chips {
        width: calc(100% + 0.9rem);
        margin-right: -0.9rem;
        padding-right: 0.9rem;
    }

    .pharmacy-grid {
        grid-template-columns: 1fr;
    }
}
