/* Phone layout for the public pages.
   Loaded after the identity sheet. Every layout rule sits inside a phone
   breakpoint, so the desktop design stays exactly as it is. */

.nav-overlay-extras,
.viv-mobile-bar,
.viv-gallery-count {
    display: none;
}

/* ==================== MENU ==================== */
@media (max-width: 860px) {
    .nav-overlay {
        padding: 22px 24px calc(28px + env(safe-area-inset-bottom));
    }
    .nav-close {
        top: 26px;
        right: 24px;
    }
    .nav-overlay-title {
        margin: 0 0 34px;
        font-size: 22px;
    }
    .nav-overlay > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 0;
        padding: 15px 0;
        border-bottom: 1px solid #d9d3c71f;
        font-size: 23px;
        line-height: 1.2;
    }
    .nav-overlay > a::after {
        content: '\2192';
        font-family: var(--body);
        font-size: 16px;
        color: var(--brand-warm-grey);
    }
    .nav-overlay-extras {
        display: block;
        margin-top: auto;
        padding-top: 32px;
    }
    .nav-overlay-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .nav-overlay .nav-overlay-action {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        margin: 0;
        border: 1px solid var(--brand-beige);
        background: var(--brand-beige);
        color: var(--brand-anthracite);
        font-family: var(--body);
        font-size: 11px;
        font-weight: 400;
        letter-spacing: .14em;
        text-transform: uppercase;
    }
    .nav-overlay .nav-overlay-action--outline {
        border-color: #d9d3c766;
        background: transparent;
        color: var(--brand-beige);
    }
    .nav-overlay-contact {
        display: flex;
        flex-wrap: wrap;
        gap: 10px 20px;
        margin-top: 22px;
    }
    .nav-overlay .nav-overlay-contact a {
        margin: 0;
        font-family: var(--body);
        font-size: 13px;
        color: var(--brand-warm-grey);
    }
}

@media (max-width: 768px) {
    /* ==================== FLOATING BUTTONS ====================
       Chat, Instagram and WhatsApp in one row along the bottom instead of
       four stacked circles covering the content. Telegram stays reachable
       from the contact section and the channel card. */
    .bv-widget {
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    .bv-widget-btn {
        width: 48px;
        height: 48px;
    }
    .bv-widget-btn svg {
        width: 24px;
        height: 24px;
    }
    .bv-widget-btn--telegram {
        display: none !important;
    }
    .blv-public-chat {
        right: 132px;
        bottom: calc(16px + env(safe-area-inset-bottom));
    }
    body.nav-open .bv-widget,
    body.nav-open .blv-public-chat {
        display: none;
    }

    /* ==================== HOME · HERO ==================== */
    .home-page .cards-hero {
        min-height: 100vh;
        min-height: 100svh;
        align-items: stretch;
        /* Bottom room keeps the floating buttons clear of the cards. */
        padding: 108px 16px 80px;
    }
    .home-page .cards-hero-inner {
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - 188px);
        min-height: calc(100svh - 188px);
    }
    .home-page .cards-hero-title {
        margin-bottom: 14px;
        padding-bottom: 18px;
        font-size: 34px;
        line-height: 1.12;
    }
    .home-page .cards-hero-subtitle {
        margin: 0 0 28px;
        font-size: 12px;
        letter-spacing: .2em;
    }
    .home-page .cards-grid {
        width: 100%;
        margin-top: auto;
        gap: 10px;
    }
    .home-page .card-item {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        column-gap: 16px;
        align-items: center;
        min-height: 0;
        padding: 18px 16px 18px 20px;
        box-shadow: 0 14px 34px #2323231a;
    }
    .home-page .card-item:hover {
        transform: none;
    }
    .home-page .card-icon {
        display: none;
    }
    .home-page .card-title {
        grid-column: 1;
        margin: 0 0 6px;
        font-size: 20px;
    }
    .home-page .card-desc {
        grid-column: 1;
        margin: 0;
        font-size: 13px;
        line-height: 1.55;
    }
    /* The arrow keeps the link's text for screen readers and stretches
       its tap area over the whole card. */
    .home-page .card-btn {
        grid-column: 2;
        grid-row: 1 / span 2;
        position: static;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 50%;
        font-size: 0;
        letter-spacing: 0;
        color: var(--brand-anthracite);
    }
    .home-page .card-btn::before {
        content: '\2192';
        font-size: 18px;
        line-height: 1;
    }
    .home-page .card-btn::after {
        content: '';
        position: absolute;
        inset: 0;
    }

    /* ==================== HOME · QUIÉNES SOMOS ==================== */
    .home-page .tagline-section {
        gap: 28px;
        padding: 56px 20px;
    }
    .home-page .tagline-text .eyebrow {
        margin-bottom: 10px;
    }
    .home-page .tagline-text .logo-inline {
        margin-bottom: 16px;
    }
    .home-page .tagline-text p {
        color: #4f4c47;
        font-size: 15px;
        line-height: 1.75;
    }
    .home-page .tagline-images {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .home-page .tagline-img {
        height: auto;
        min-height: 0;
        aspect-ratio: 1;
    }
    .home-page .tagline-img.tall {
        grid-column: 1 / -1;
        grid-row: auto;
        min-height: 0;
        aspect-ratio: 16 / 10;
    }

    /* ==================== HOME · EQUIPO ==================== */
    .home-page .nosotros-section {
        padding: 56px 16px;
    }
    .home-page .nosotros-eyebrow {
        margin-bottom: 12px;
    }
    .home-page .nosotros-heading {
        margin-bottom: 26px;
        font-size: 32px;
    }
    .home-page .nosotros-cards {
        flex-direction: row;
        align-items: stretch;
        gap: 10px;
        max-width: none;
        padding: 0;
        border-top: 0;
    }
    .home-page .nosotros-card {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        max-width: none;
        aspect-ratio: 3 / 4.4;
    }
    .home-page .nosotros-card-img {
        height: 100%;
    }
    .home-page .nosotros-card-info {
        left: 12px;
        right: 12px;
        bottom: 14px;
    }
    .home-page .nosotros-card-name {
        margin-bottom: 4px;
        font-size: 16px;
        line-height: 1.2;
    }
    .home-page .nosotros-card-role {
        font-size: 8.5px;
        letter-spacing: .1em;
        line-height: 1.45;
    }
    .home-page .nosotros-card-info .nosotros-card-btn {
        display: none;
    }
    .home-page .nosotros-team-action {
        margin-top: 16px;
    }
    .home-page .nosotros-team-link {
        width: 100%;
        min-height: 48px;
    }

    /* ==================== HOME · PREGUNTAS ==================== */
    .home-page .faq-section {
        padding: 56px 16px;
    }
    .home-page .faq-intro {
        margin-bottom: 22px;
    }
    .home-page .faq-heading {
        font-size: 28px;
    }
    .home-page .faq-subtitle {
        font-size: 14px;
        line-height: 1.65;
    }
    .home-page .faq-panel-toggle {
        padding: 18px 20px;
    }
    .home-page .faq-panel-toggle span:first-child {
        font-size: 18px;
    }
    .home-page .faq-question {
        gap: 14px;
        padding: 16px 18px;
    }
    .home-page .faq-question span:first-child {
        font-size: 15px;
        line-height: 1.45;
    }

    /* ==================== HOME · CANAL ==================== */
    .home-page .telegram-cta-section {
        padding: 0 16px 56px;
    }
    .home-page .telegram-cta-shell {
        gap: 0;
    }
    .home-page .telegram-cta-copy {
        padding: 28px 22px 24px;
    }
    .home-page .telegram-cta-heading {
        font-size: 25px;
    }
    .home-page .telegram-cta-text {
        margin-top: 12px;
        font-size: 14px;
        line-height: 1.65;
    }
    .home-page .telegram-cta-channels {
        display: none;
    }
    .home-page .telegram-cta-button {
        padding: 22px;
    }
    .home-page .telegram-cta-button:hover {
        transform: none;
    }
    .home-page .telegram-cta-button-top,
    .home-page .telegram-cta-button-foot {
        flex-direction: row;
        align-items: center;
    }
    .home-page .telegram-cta-button-title {
        margin: 34px 0 14px;
        font-size: 26px;
    }

    /* ==================== HOME · EN MARCHA ==================== */
    .home-page .galeria-section {
        padding: 56px 0 48px;
    }
    .home-page .galeria-header .eyebrow {
        margin-bottom: 10px !important;
    }
    .home-page .galeria-header h2 {
        margin-bottom: 24px !important;
        font-size: 28px !important;
    }
    .home-page .galeria-track {
        gap: 10px;
        padding: 0 16px 4px;
        scroll-padding-left: 16px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .home-page .galeria-track::-webkit-scrollbar {
        display: none;
    }
    .home-page .galeria-item,
    .home-page .galeria-placeholder {
        width: 74vw !important;
        max-width: 300px;
        aspect-ratio: 4 / 5 !important;
    }
    .home-page .galeria-scroll-hint {
        margin-top: 16px;
    }

    /* ==================== HOME · MAPA ==================== */
    .home-page .map-preview-section {
        padding: 0 16px 56px;
    }
    .home-page .map-preview-copy {
        flex-wrap: nowrap;
        margin-bottom: 14px;
    }
    .home-page .map-preview-heading {
        font-size: 22px;
        white-space: nowrap;
    }
    .home-page .map-preview-frame {
        height: 220px;
    }

    /* ==================== HOME · CONTACTO ====================
       A single dark list instead of five tall tiles. */
    .home-page .contacto-directo {
        padding: 56px 16px calc(96px + env(safe-area-inset-bottom));
    }
    .home-page .contacto-eyebrow {
        margin-bottom: 10px;
    }
    .home-page .contacto-heading {
        margin-bottom: 24px;
        font-size: 30px;
    }
    .home-page .contacto-cards {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 0;
        background: var(--brand-anthracite);
    }
    .home-page .contacto-card {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr) 16px;
        grid-template-rows: auto auto;
        column-gap: 16px;
        row-gap: 3px;
        align-items: center;
        height: auto;
        min-height: 72px;
        padding: 14px 20px;
        border: 0;
        border-bottom: 1px solid #d9d3c71f;
        text-align: left;
    }
    .home-page .contacto-card:last-child {
        border-bottom: 0;
    }
    .home-page .contacto-card:hover {
        transform: none;
    }
    .home-page .contacto-card-icon {
        grid-row: 1 / span 2;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin: 0;
        border: 1px solid #d9d3c740;
        border-radius: 50%;
    }
    .home-page .contacto-card-icon svg {
        width: 18px;
        height: 18px;
    }
    .home-page .contacto-card-label {
        grid-column: 2;
        align-self: end;
        font-size: 9px;
        letter-spacing: .16em;
        opacity: .65;
    }
    .home-page .contacto-card-value {
        grid-column: 2;
        align-self: start;
        font-size: 15px;
        letter-spacing: 0;
    }
    .home-page .contacto-card::after {
        content: '\2192';
        grid-column: 3;
        grid-row: 1 / span 2;
        font-size: 15px;
        opacity: .55;
    }
}

/* ==================== CATÁLOGO · FICHA ==================== */
@media (max-width: 768px) {
    /* The brand's bold subset has no digits or accents, so figures mix two
       fonts. Regular covers digits; the euro and ² come from the fallback. */
    .viv-card-price,
    .viv-stat-value,
    .viv-mobile-bar-info strong {
        font-weight: 400;
    }

    /* ---- Catálogo ---- */
    .viv-header {
        padding: 40px 16px 18px;
    }
    .viv-header .viv-title {
        font-size: 30px;
    }
    .viv-header .viv-sub {
        font-size: 14px;
        line-height: 1.65;
    }
    .viv-filter-tabs {
        display: flex;
        width: 100%;
        gap: 4px;
        padding: 4px;
        margin-top: 22px;
    }
    .viv-filter-btn {
        flex: 1 1 0;
        min-height: 44px;
        padding: 0 6px;
        font-size: 9.5px;
        letter-spacing: .08em;
    }
    .viv-sort-tools {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 10px;
        padding: 0;
    }
    .viv-sort-control,
    .viv-availability,
    .viv-availability-trigger {
        width: 100%;
        min-width: 0;
    }
    .viv-availability-menu {
        left: auto;
        right: 0;
        width: min(286px, calc(100vw - 32px));
    }
    .viv-grid {
        gap: 16px;
        padding: 0 16px calc(96px + env(safe-area-inset-bottom));
    }
    .viv-card-media {
        aspect-ratio: 4 / 3.4;
    }
    .viv-card-body {
        padding: 16px 16px 18px;
    }
    .viv-card-badge {
        margin-bottom: 10px;
        font-size: 9px;
    }
    .viv-card-name {
        font-size: 18px;
        line-height: 1.3;
    }
    .viv-card-price {
        font-size: 18px;
    }

    /* ---- Ficha: photo first, then the facts, actions after. ---- */
    .viv-page--detail {
        display: flex;
        flex-direction: column;
    }
    .viv-page--detail > .viv-info {
        order: 1;
    }
    .viv-page--detail > .viv-actions,
    .viv-page--detail > .inv-actions {
        order: 2;
        width: 100%;
        margin-bottom: 28px !important;
        padding: 0 16px !important;
    }
    .viv-page--detail .viv-gallery-wrap {
        padding: 0 0 18px;
    }
    .viv-page--detail .viv-gallery-top {
        position: absolute;
        z-index: 3;
        top: 14px;
        left: 14px;
        right: 14px;
        flex-direction: row;
        align-items: flex-start;
        margin: 0;
        pointer-events: none;
    }
    .viv-page--detail .viv-gallery-top > * {
        pointer-events: auto;
    }
    .viv-page--detail .viv-gallery-wrap {
        position: relative;
    }
    .viv-page--detail .viv-gallery-badge {
        margin: 0;
        padding: 6px 10px;
        font-size: 9px;
    }
    .viv-page--detail .viv-gallery-tabs {
        padding: 3px;
        gap: 2px;
    }
    .viv-page--detail .viv-gallery-tabs:not(:has(.viv-gallery-tab + .viv-gallery-tab)) {
        display: none;
    }
    .viv-page--detail .viv-gallery-tab {
        padding: 8px 12px;
        font-size: 9px;
    }
    .viv-page--detail .viv-gallery-main {
        max-width: none;
        aspect-ratio: 4 / 3.6;
        border: 0;
    }
    .viv-page--detail:not(.viv-page--gallery-contain) .viv-slide {
        object-fit: cover;
    }
    .viv-page--detail .gallery-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
        background: rgba(35, 35, 35, .45);
    }
    .viv-page--detail .viv-gallery-count {
        display: block;
        position: absolute;
        z-index: 2;
        right: 12px;
        bottom: 12px;
        padding: 5px 10px;
        border-radius: 999px;
        background: rgba(35, 35, 35, .62);
        color: var(--brand-paper);
        font-size: 11px;
        letter-spacing: .06em;
    }
    .viv-page--detail .gallery-dots {
        display: none;
    }
    .viv-page--detail .viv-info {
        padding: 6px 16px 36px;
    }
    .viv-page--detail .viv-info-head {
        text-align: left;
    }
    .viv-page--detail .viv-eyebrow {
        margin-bottom: 8px;
        font-size: 10px;
    }
    .viv-page--detail .viv-title {
        margin-bottom: 8px;
        font-size: 30px;
        line-height: 1.12;
    }
    .viv-page--detail .viv-subtitle {
        margin: 0 0 6px;
        font-size: 15px;
        line-height: 1.6;
    }
    .viv-page--detail .viv-addr {
        margin-bottom: 22px;
        font-size: 13px;
    }
    .viv-page--detail .viv-stats {
        gap: 8px;
        margin-bottom: 20px;
    }
    .viv-page--detail .viv-stat {
        padding: 14px 14px 12px;
        text-align: left;
    }
    .viv-page--detail .viv-stat-value {
        margin-bottom: 4px;
        font-size: 19px;
    }
    .viv-page--detail .viv-stat-label {
        font-size: 9px;
    }
    .viv-page--detail .viv-panels {
        gap: 12px;
        margin-top: 0;
    }
    .viv-page--detail .viv-panel {
        padding: 20px 18px;
    }
    .viv-page--detail .viv-panel-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px 16px;
    }
    .viv-page--detail .viv-desc {
        font-size: 15px;
        line-height: 1.7;
    }
    .viv-page--detail .viv-actions,
    .viv-page--detail .inv-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .viv-page--detail .viv-action-btn,
    .viv-page--detail .inv-action-btn {
        width: 100%;
        background: transparent;
        color: var(--brand-anthracite);
    }

    /* The visit request moves into the fixed bar below. */
    body:has(.viv-mobile-bar) .viv-page--detail .viv-action-btn--visit,
    body:has(.viv-mobile-bar) .viv-page--detail .inv-action-btn--visit {
        display: none;
    }
    .viv-mobile-bar {
        position: fixed;
        z-index: 100000;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--brand-beige);
        background: rgba(244, 241, 235, .97);
        box-shadow: 0 -10px 30px rgba(35, 35, 35, .08);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }
    .viv-mobile-bar-info {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    .viv-mobile-bar-info strong {
        color: var(--brand-anthracite);
        font-size: 19px;
        line-height: 1.2;
    }
    .viv-mobile-bar-info span {
        overflow: hidden;
        color: var(--grey);
        font-size: 12px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .viv-mobile-bar-btn {
        display: inline-flex;
        flex: none;
        align-items: center;
        justify-content: center;
        width: 156px;
        min-height: 48px;
        padding: 0;
        background: var(--brand-anthracite);
        color: var(--brand-paper);
        font-size: 11px;
        font-weight: 400;
        letter-spacing: .1em;
        text-transform: uppercase;
    }
    body:has(.viv-mobile-bar) {
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }
    body:has(.viv-mobile-bar) .bv-widget {
        display: none;
    }
    /* The chat sits inside the bar, next to the visit button. */
    .viv-mobile-bar-info {
        margin-right: 58px;
    }
    body:has(.viv-mobile-bar) .blv-public-chat {
        right: 182px;
        bottom: calc(10px + env(safe-area-inset-bottom));
    }
    body:has(.viv-mobile-bar) .blv-public-chat-toggle {
        box-shadow: none;
    }
}
