/* ==========================================================================
   ARCHIVO DE LUGARES — CAPA DE DESCUBRIMIENTO

   Código cromático reutilizable por archivo, tarjetas y futuros marcadores:
   - principal: #2E6B3A (idéntico a assets/img/map-pins/lugar.svg)
   - profundo:  #1F4E29
   - superficie:#E4EEE6

   La gramática visual es fotográfica y cartográfica. No replica las tarjetas
   comerciales de Negocios: usa mosaico, contenido superpuesto y navegación
   subrayada de guía.
   ========================================================================== */

.os-places {
    --os-type-color: #2E6B3A;
    --os-type-color-deep: #1F4E29;
    --os-type-surface: #E4EEE6;
    --os-type-line: #A8C3AE;
    --os-places-width: 1500px;
    --os-places-gutter: clamp(20px, 4vw, 64px);
    --os-places-radius: 22px 22px 22px 6px;
    overflow-x: clip;
    background: var(--color-blanco);
    color: var(--color-antracita);
}

.os-places *,
.os-places *::before,
.os-places *::after {
    box-sizing: border-box;
}

.os-places__wrap {
    width: min(100%, var(--os-places-width));
    margin-inline: auto;
    padding-inline: var(--os-places-gutter);
}

/* --- Identidad de capa ------------------------------------------------- */

.os-places__hero {
    position: relative;
    background:
        linear-gradient(
            90deg,
            var(--os-type-surface) 0,
            var(--os-type-surface) 36%,
            var(--color-crema) 36%,
            var(--color-crema) 100%
        );
    border-bottom: 1px solid var(--os-type-line);
}

.os-places__identity {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-height: 112px;
    padding-block: 18px 14px;
}

.os-places__marker {
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    background: var(--color-blanco);
    border: 1px solid var(--os-type-line);
    border-radius: 50% 50% 50% 14px;
    box-shadow: 0 10px 26px rgba(31, 78, 41, 0.1);
}

.os-places__marker img {
    display: block;
    width: 38px;
    height: auto;
}

.os-places__intro {
    min-width: 0;
}

.os-places__eyebrow {
    margin: 0 0 3px;
    padding: 0;
    color: var(--os-type-color-deep);
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
}

.os-places h1 {
    margin: 0;
    padding: 0;
    color: var(--color-antracita);
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: clamp(2.45rem, 3.7vw, 3.7rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 0.95;
}

.os-places__layer {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 0;
    color: var(--os-type-color-deep);
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.os-places__layer span {
    width: 10px;
    height: 10px;
    background: var(--os-type-color);
    border: 3px solid var(--color-blanco);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--os-type-color);
}

/* --- Navegación editorial, no pills ----------------------------------- */

.os-places__shortcuts {
    display: flex;
    align-items: stretch;
    gap: clamp(18px, 2.4vw, 34px);
    min-width: 0;
    border-top: 1px solid rgba(46, 107, 58, 0.18);
}

.os-places__shortcuts a {
    position: relative;
    display: inline-flex;
    min-height: 52px;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 3px 0 0;
    border-bottom: 3px solid transparent;
    color: var(--color-antracita);
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 0.88rem;
    font-weight: 720;
    line-height: 1.15;
    text-decoration: none;
    transition: border-color 160ms ease, color 160ms ease, transform 140ms cubic-bezier(0.23, 1, 0.32, 1);
}

.os-places__shortcuts a::before {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    background: transparent;
    border: 1px solid var(--os-type-color);
    border-radius: 50%;
    content: '';
}

.os-places__shortcuts a.is-current {
    border-bottom-color: var(--os-type-color);
    color: var(--os-type-color-deep);
}

.os-places__shortcuts a.is-current::before {
    background: var(--os-type-color);
}

/* --- Franja cartográfica de búsqueda y filtros ------------------------ */

.os-places__results {
    padding-bottom: clamp(60px, 7vw, 100px);
}

.os-places .os-listado {
    max-width: none;
    margin: 0;
    padding: 0;
}

.os-places .os-listado__layout {
    display: block;
}

.os-places .os-listado__sidebar {
    position: static;
    max-height: none;
    margin-top: 18px;
    padding: 0 18px;
    overflow: visible;
    background: var(--os-type-surface);
    border-left: 4px solid var(--os-type-color);
    border-radius: 0 12px 12px 0;
}

.os-places .os-filters-drawer__head,
.os-places .os-filters-open {
    display: none;
}

.os-places .os-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1.35fr) repeat(auto-fit, minmax(190px, 1fr));
    align-items: center;
    margin: 0;
    padding: 8px 0;
    background: transparent;
    border: 0;
}

.os-places .os-filters__search {
    min-width: 0;
}

.os-places .os-filters__search > label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.os-places .os-filters__search-control {
    display: flex;
    min-width: 0;
    height: 46px;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid var(--os-type-line);
    background: transparent;
}

.os-places .os-filters__search-control:focus-within {
    border-bottom-color: var(--os-type-color);
    box-shadow: inset 0 -1px 0 var(--os-type-color);
}

.os-places .os-filters__search input {
    min-width: 0;
    height: 100%;
    flex: 1 1 auto;
    padding: 0 12px 0 4px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--color-antracita);
    font: 650 0.95rem/1 'Bricolage Grotesque', system-ui, sans-serif;
}

.os-places .os-filters__search input::placeholder {
    color: var(--color-gris-calido);
    opacity: 0.9;
}

.os-places .os-filters__search button {
    min-width: 72px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: var(--os-type-color-deep);
    cursor: pointer;
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 0.86rem;
    font-weight: 800;
}

.os-places .os-filters__group {
    position: relative;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--os-type-line);
}

.os-places .os-filters__legend {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    float: none;
}

.os-places .os-filters__toggle {
    display: flex;
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--color-antracita);
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 750;
}

.os-places .os-filters__toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.62);
}

.os-places .os-filters__count {
    background: var(--os-type-color);
}

.os-places .os-filters__chevron {
    width: 8px;
    height: 8px;
    margin-right: 2px;
    border-right-color: currentColor;
    border-bottom-color: currentColor;
}

.os-places .os-filters__region {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 40;
    display: grid;
    width: max(100%, 300px);
    gap: 3px;
    padding: 10px;
    background: var(--color-blanco);
    border: 1px solid var(--os-type-line);
    border-radius: 14px;
    box-shadow: 0 18px 46px rgba(31, 78, 41, 0.17);
    transform-origin: top left;
}

.os-places .os-filters__region[hidden] {
    display: none;
}

.os-places .os-filters__opt {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border-radius: 8px;
    color: var(--color-antracita);
    cursor: pointer;
    font: 520 0.88rem/1.25 'Bricolage Grotesque', system-ui, sans-serif;
}

.os-places .os-filters__opt input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--os-type-color);
}

.os-places .os-filters__opt-total {
    color: var(--color-gris-calido);
    font-size: 0.76rem;
    font-variant-numeric: tabular-nums;
}

/* --- Estado del atlas -------------------------------------------------- */

.os-places .os-listado__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin: clamp(20px, 2.6vw, 30px) 0 16px;
}

.os-places .os-listado__count {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--os-type-color-deep);
    font: 800 0.96rem/1.2 'Bricolage Grotesque', system-ui, sans-serif;
}

.os-places .os-listado__count::before {
    width: 9px;
    height: 9px;
    background: var(--os-type-color);
    border-radius: 50%;
    content: '';
}

.os-places .os-active-filters {
    display: flex;
    flex: 1 1 520px;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.os-places .os-chip {
    min-height: 36px;
    padding: 5px 5px 5px 13px;
    background: var(--os-type-surface);
    border: 1px solid var(--os-type-line);
    font: 650 0.82rem/1.2 'Bricolage Grotesque', system-ui, sans-serif;
}

.os-places .os-chip__remove {
    width: 26px;
    height: 26px;
}

.os-places .os-active-filters__clear {
    min-height: 36px;
    color: var(--os-type-color-deep);
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
}

/* --- Mosaico fotográfico ---------------------------------------------- */

.os-places .os-listado__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: clamp(14px, 1.5vw, 22px);
    transition: opacity 160ms ease;
}

.os-places .os-listado.is-loading .os-listado__grid {
    opacity: 0.58;
    pointer-events: none;
}

.os-places .os-card {
    position: relative;
    display: block;
    min-width: 0;
    min-height: 360px;
    grid-column: span 4;
    overflow: hidden;
    background: var(--os-type-color-deep);
    border: 0;
    border-radius: var(--os-places-radius);
    box-shadow: none;
    isolation: isolate;
    transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 180ms ease;
}

.os-places .os-card:nth-child(7n + 1) {
    min-height: 440px;
    grid-column: span 8;
}

.os-places .os-card__media {
    position: absolute;
    inset: 0;
    display: flex;
    min-height: 100%;
    flex-direction: column;
    overflow: hidden;
    background: var(--os-type-color-deep);
}

.os-places .os-card__media::before {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(
            180deg,
            rgba(20, 32, 23, 0.05) 22%,
            rgba(20, 32, 23, 0.22) 48%,
            rgba(20, 32, 23, 0.9) 100%
        );
    content: '';
    pointer-events: none;
}

.os-places .os-card__media::after {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    width: 5px;
    background: var(--os-type-color);
    content: '';
}

.os-places .os-card__image-link,
.os-places .os-card__image {
    position: absolute;
    inset: 0;
    display: block;
}

.os-places .os-card__image {
    aspect-ratio: auto;
    overflow: hidden;
}

.os-places .os-card__image img,
.os-places .os-card__image-ph {
    display: block;
    width: 100%;
    height: 100%;
}

.os-places .os-card__image img {
    object-fit: cover;
    transform: scale(1.001);
    transition: transform 240ms cubic-bezier(0.23, 1, 0.32, 1);
}

.os-places .os-card__image-ph {
    background-color: var(--os-type-color-deep);
    background-size: 62px;
}

.os-places .os-card__favorite {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
}

.os-places .os-favorito--card {
    top: 0;
    right: 0;
    color: var(--color-antracita);
    background: var(--color-blanco);
}

.os-places .os-card__body {
    position: relative;
    z-index: 3;
    display: flex;
    min-height: 100%;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    margin-top: auto;
    padding: clamp(20px, 2vw, 28px);
    color: var(--color-blanco);
}

.os-places .os-card__kind {
    display: inline-flex;
    min-height: 28px;
    width: fit-content;
    max-width: calc(100% - 54px);
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 5px 10px;
    overflow: hidden;
    background: var(--os-type-surface);
    border-radius: 3px 12px 12px 3px;
    color: var(--os-type-color-deep);
    font: 800 0.68rem/1.2 'Bricolage Grotesque', system-ui, sans-serif;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.os-places .os-card__kind span {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    background: var(--os-type-color);
    border-radius: 50%;
}

.os-places .os-card__title {
    max-width: 94%;
    margin: 0;
    padding: 0;
    color: var(--color-blanco);
    font: 780 clamp(1.35rem, 1.8vw, 1.8rem)/1.06 'Bricolage Grotesque', system-ui, sans-serif;
    letter-spacing: -0.018em;
    text-wrap: balance;
}

.os-places .os-card:nth-child(7n + 1) .os-card__title {
    max-width: 76%;
    font-size: clamp(2rem, 3vw, 3.2rem);
    line-height: 0.98;
}

.os-places .os-card__title a {
    color: inherit;
    text-decoration: none;
}

.os-places .os-card__footer {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.32);
}

.os-places .os-card__location,
.os-places .os-card__map-code {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.9);
    font: 650 0.84rem/1.2 'Bricolage Grotesque', system-ui, sans-serif;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.os-places .os-card__location svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--os-type-surface);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.os-places .os-card__cta {
    display: inline-flex;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    margin-left: auto;
    color: var(--color-blanco);
    font: 800 0.86rem/1.2 'Bricolage Grotesque', system-ui, sans-serif;
    text-decoration: none;
}

.os-places .os-card__cta > span {
    border-bottom: 1px solid rgba(255, 255, 255, 0.68);
}

.os-places .os-card__cta svg {
    width: 34px;
    height: 34px;
    padding: 8px;
    fill: none;
    stroke: var(--color-blanco);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    background: var(--os-type-color);
    border-radius: 50%;
    transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

.os-places .os-listado__vacio,
.os-places .os-listado__error {
    grid-column: 1 / -1;
    margin: 0;
    padding: 50px 24px;
    background: var(--os-type-surface);
    border-left: 4px solid var(--os-type-color);
    color: var(--color-gris-calido);
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
}

.os-places .os-listado__footer {
    display: flex;
    justify-content: center;
    padding-top: clamp(28px, 4vw, 46px);
}

.os-places .os-listado__more {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: 1px solid var(--os-type-color);
    border-radius: 4px 14px 14px 4px;
    color: var(--os-type-color-deep);
    font: 800 0.92rem/1.2 'Bricolage Grotesque', system-ui, sans-serif;
    text-decoration: none;
}

.os-places .os-listado__more[hidden] {
    display: none;
}

/* --- Estados de interacción ------------------------------------------- */

.os-places a:focus-visible,
.os-places button:focus-visible,
.os-places input:focus-visible {
    outline: 3px solid var(--os-type-color);
    outline-offset: 3px;
}

.os-places .os-card a:focus-visible,
.os-places .os-card button:focus-visible {
    outline-color: var(--color-blanco);
}

.os-places .os-filters__search input:focus-visible {
    outline: 0;
}

.os-places__shortcuts a:active,
.os-places .os-filters__toggle:active,
.os-places .os-filters__search button:active,
.os-places .os-card__cta:active,
.os-places .os-listado__more:active {
    transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
    .os-places__shortcuts a:hover {
        border-bottom-color: var(--os-type-line);
        color: var(--os-type-color-deep);
    }

    .os-places .os-filters__search button:hover {
        color: var(--color-negro);
    }

    .os-places .os-filters__toggle:hover,
    .os-places .os-filters__opt:hover {
        background: rgba(255, 255, 255, 0.72);
    }

    .os-places .os-card:hover {
        box-shadow: 0 18px 44px rgba(31, 78, 41, 0.19);
        transform: translateY(-3px);
    }

    .os-places .os-card:hover .os-card__image img {
        transform: scale(1.035);
    }

    .os-places .os-card__title a:hover {
        text-decoration: underline;
        text-decoration-thickness: 1px;
        text-underline-offset: 4px;
    }

    .os-places .os-card__cta:hover svg {
        transform: translateX(3px);
    }

    .os-places .os-listado__more:hover {
        background: var(--os-type-color);
        color: var(--color-blanco);
    }
}

/* --- Responsive -------------------------------------------------------- */

@media (max-width: 1100px) {
    .os-places .os-card {
        min-height: 380px;
        grid-column: span 6;
    }

    .os-places .os-card:nth-child(7n + 1) {
        min-height: 430px;
        grid-column: span 12;
    }

    .os-places .os-card:nth-child(7n + 1) .os-card__title {
        max-width: 82%;
    }
}

@media (max-width: 900px) {
    .os-places__hero {
        background: var(--os-type-surface);
    }

    .os-places .os-filters {
        grid-template-columns: 1fr 1fr;
    }

    .os-places .os-filters__search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    .os-places__identity {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 14px;
        min-height: 102px;
        padding-block: 14px 10px;
    }

    .os-places__marker {
        width: 62px;
        height: 62px;
    }

    .os-places__marker img {
        width: 33px;
    }

    .os-places h1 {
        font-size: clamp(2.35rem, 11vw, 3.2rem);
    }

    .os-places__layer {
        display: none;
    }

    .os-places__shortcuts {
        width: calc(100% + var(--os-places-gutter));
        gap: 24px;
        padding-right: var(--os-places-gutter);
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
    }

    .os-places__shortcuts::-webkit-scrollbar {
        display: none;
    }

    .os-places__shortcuts a {
        min-height: 50px;
    }

    .os-places .os-listado__sidebar {
        margin-top: 14px;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
    }

    .os-places .os-listado.os-has-js .os-filters-open {
        display: inline-flex;
        width: 100%;
        min-height: 48px;
        justify-content: center;
        margin: 0 0 16px;
        border: 0;
        border-radius: 4px 14px 14px 4px;
        background: var(--os-type-color);
        font-family: 'Bricolage Grotesque', system-ui, sans-serif;
        font-weight: 800;
    }

    .os-places .os-listado.os-has-js .os-listado__sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        z-index: 99990;
        width: min(390px, 92vw);
        max-height: none;
        margin: 0;
        padding: 12px 18px 28px;
        overflow-y: auto;
        background: var(--color-blanco);
        box-shadow: -10px 0 34px rgba(26, 26, 26, 0.2);
        transform: translateX(100%);
        transition: transform 240ms cubic-bezier(0.32, 0.72, 0, 1);
    }

    .os-places .os-listado.os-has-js.os-drawer-open .os-listado__sidebar {
        transform: translateX(0);
    }

    .os-places .os-listado.os-has-js .os-filters-drawer__head {
        position: sticky;
        top: -12px;
        z-index: 3;
        display: flex;
        padding: 16px 0 12px;
        background: var(--color-blanco);
    }

    .os-places .os-filters {
        display: block;
        padding-top: 4px;
    }

    .os-places .os-filters__search {
        margin-bottom: 16px;
    }

    .os-places .os-filters__group {
        border-left: 0;
        border-bottom: 1px solid var(--color-arena);
    }

    .os-places .os-filters__toggle {
        min-height: 52px;
        padding-inline: 4px;
        background: transparent;
    }

    .os-places .os-filters__toggle[aria-expanded="true"] {
        background: transparent;
    }

    .os-places .os-filters__region {
        position: static;
        display: grid;
        width: 100%;
        grid-template-columns: 1fr;
        padding: 0 0 12px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .os-places .os-filters__region[hidden] {
        display: none;
    }

    .os-places .os-listado__toolbar {
        margin-top: 0;
    }
}

@media (max-width: 640px) {
    .os-places__wrap {
        padding-inline: 16px;
    }

    .os-places .os-listado__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .os-places .os-card,
    .os-places .os-card:nth-child(7n + 1) {
        min-height: 400px;
        grid-column: 1;
    }

    .os-places .os-card__title,
    .os-places .os-card:nth-child(7n + 1) .os-card__title {
        max-width: 100%;
        font-size: clamp(1.55rem, 7vw, 2rem);
        line-height: 1.04;
    }

    .os-places .os-card__body {
        padding: 18px;
    }

    .os-places .os-card__footer {
        gap: 8px;
    }

    .os-places .os-card__location,
    .os-places .os-card__map-code {
        flex: 1 1 0;
    }

    .os-places .os-card__cta {
        font-size: 0.82rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .os-places *,
    .os-places *::before,
    .os-places *::after {
        scroll-behavior: auto !important;
    }

    .os-places__shortcuts a,
    .os-places .os-listado__grid,
    .os-places .os-card,
    .os-places .os-card__image img,
    .os-places .os-card__cta svg,
    .os-places .os-listado__sidebar {
        transition-duration: 0.01ms;
    }

    .os-places .os-card:hover,
    .os-places .os-card:hover .os-card__image img,
    .os-places .os-card__cta:hover svg {
        transform: none;
    }
}
