/* ===================================
   Vista interna - Estilo Airbnb
   Autocontenido con variables de respaldo
   =================================== */

/* Respaldo de variables por si el tema las pisa */
.sys-property-page.sys-single-airbnb {
    --sys-primary: #FF385C;
    --sys-primary-dark: #E31C5F;
    --sys-primary-glow: rgba(255, 56, 92, 0.2);
    --sys-bg: #FFFFFF;
    --sys-bg-light: #F7F7F7;
    --sys-bg-hover: #EBEBEB;
    --sys-text: #222222;
    --sys-text-light: #717171;
    --sys-border: #DDDDDD;
    --sys-border-light: #EEEEEE;
    --shadow-light: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-hover: 0 12px 32px rgba(0,0,0,0.12);
    --shadow-brutal: 0 20px 48px rgba(0,0,0,0.14);
    --radius-small: 10px;
    --radius-medium: 16px;
    --radius-large: 20px;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sys-property-page.sys-single-airbnb,
.sys-property-page.sys-single-airbnb * {
    box-sizing: border-box;
}

.sys-property-page.sys-single-airbnb {
    width: 100%;
    max-width: 100%;
    background: #fff;
    padding-top: 100px;
    padding-bottom: 60px;
}

/* Evitar que el tema comprima el contenido */
body .sys-property-page.sys-single-airbnb {
    margin-left: 0;
    margin-right: 0;
}

/* ----- Hero: grid de fotos ----- */
.sys-hero-photo-grid {
    display: grid;
    gap: 10px;
    max-width: 1280px;
    margin: 0 auto 40px;
    padding: 0 24px;
    height: 55vh;
    min-height: 360px;
    max-height: 600px;
    border-radius: var(--radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-brutal);
}

/* 1 foto: una columna */
.sys-hero-photo-grid.sys-hero-count-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

/* 2 fotos: dos columnas */
.sys-hero-photo-grid.sys-hero-count-2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

/* 3 y 4 fotos: izquierda grande, derecha 2 celdas */
.sys-hero-photo-grid.sys-hero-count-3,
.sys-hero-photo-grid.sys-hero-count-4 {
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.sys-hero-photo-grid.sys-hero-count-3 .sys-hero-photo-main,
.sys-hero-photo-grid.sys-hero-count-4 .sys-hero-photo-main {
    grid-row: span 2;
}

/* 5 fotos: estilo Airbnb clásico */
.sys-hero-photo-grid.sys-hero-count-5 {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.sys-hero-photo-grid.sys-hero-count-5 .sys-hero-photo-main {
    grid-row: span 2;
}

.sys-hero-photo {
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
    min-height: 0;
}

.sys-hero-photo img.sys-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sys-hero-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #717171;
    font-size: 16px;
}

.sys-hero-placeholder-icon {
    font-size: 48px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.sys-hero-photo .sys-hero-show-all {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    color: #222;
    border: none;
    border-radius: var(--radius-small);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.sys-hero-photo .sys-hero-show-all:hover {
    background: var(--sys-primary);
    color: #fff;
    box-shadow: 0 6px 20px var(--sys-primary-glow);
}

.sys-hero-photo .sys-hero-show-all:focus-visible {
    outline: 2px solid var(--sys-primary);
    outline-offset: 2px;
}

/* ----- Contenedor principal ----- */
.sys-single-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 64px;
    align-items: start;
}

@media (max-width: 1024px) {
    .sys-single-container {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 0 20px;
    }
}

/* ----- Header del contenido ----- */
.sys-single-header {
    padding: 0 0 24px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--sys-border-light);
}

.sys-single-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--sys-text);
    margin: 0 0 8px;
    line-height: 1.3;
}

.sys-single-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    color: var(--sys-text-light);
    margin: 0 0 12px;
}

.sys-single-subtitle {
    font-size: 16px;
    color: var(--sys-text);
    line-height: 1.5;
    margin: 0 0 12px;
}

.sys-single-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--sys-bg-light);
    color: var(--sys-text);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-small);
    border: 1px solid var(--sys-border-light);
}

/* ----- Secciones ----- */
.sys-single-content .sys-section {
    padding: 28px 0;
    border-bottom: 1px solid var(--sys-border-light);
}

@media (prefers-reduced-motion: no-preference) {
    .sys-single-content .sys-section,
    .sys-single-header {
        opacity: 0.96;
        transform: translateY(12px);
        transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    .sys-single-content .sys-section.sys-in-view,
    .sys-single-header.sys-in-view {
        opacity: 1;
        transform: translateY(0);
    }
}

.sys-single-content .sys-section:last-of-type {
    border-bottom: none;
}

.sys-single-content .sys-section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--sys-text);
    margin: 0 0 24px;
    padding-left: 16px;
    border-left: 4px solid var(--sys-primary);
    letter-spacing: -0.02em;
}

.sys-property-description {
    font-size: 16px;
    line-height: 1.65;
    color: var(--sys-text);
}

.sys-property-description p {
    margin: 0 0 1em;
}

.sys-property-description p:last-child {
    margin-bottom: 0;
}

/* ----- Highlights ----- */
.sys-highlights-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.sys-highlight-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 120px;
}

.sys-highlight-icon {
    font-size: 22px;
    line-height: 1;
}

.sys-highlight-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--sys-text);
}

.sys-highlight-label {
    font-size: 14px;
    color: var(--sys-text-light);
}

/* ----- Amenidades ----- */
.sys-amenities-list-airbnb {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.sys-amenity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: var(--sys-text);
}

.sys-amenity-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    background: var(--sys-text);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
}

/* ----- Tipologías ----- */
.sys-tipologias-grid {
    display: grid;
    gap: 16px;
}

.sys-tipologia-card {
    padding: 20px;
    border: 1px solid var(--sys-border-light);
    border-radius: var(--radius-medium);
    background: var(--sys-bg);
    transition: var(--transition);
}

.sys-tipologia-card:hover {
    border-color: var(--sys-border);
    box-shadow: var(--shadow-light);
}

.sys-tipologia-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--sys-text);
    margin: 0 0 10px;
}

.sys-tipologia-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.sys-tipologia-spec {
    font-size: 14px;
    color: var(--sys-text-light);
}

.sys-tipologia-desc {
    font-size: 14px;
    line-height: 1.5;
    color: var(--sys-text);
    margin: 0;
}

/* ----- Planos ----- */
.sys-planos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.sys-plano-item {
    border: 1px solid var(--sys-border-light);
    border-radius: var(--radius-medium);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    background: var(--sys-bg);
}

.sys-plano-item:hover {
    border-color: var(--sys-primary);
    box-shadow: var(--shadow-hover);
}

.sys-plano-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.sys-plano-title {
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--sys-text);
    border-top: 1px solid var(--sys-border-light);
}

/* ----- Video ----- */
.sys-video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-medium);
    background: var(--sys-bg-light);
}

.sys-video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ----- Mapa ----- */
.sys-location-address {
    font-size: 16px;
    color: var(--sys-text);
    margin: 0 0 12px;
}

.sys-map-wrap {
    margin-top: 12px;
    border-radius: var(--radius-medium);
    overflow: hidden;
    border: 1px solid var(--sys-border-light);
    background: #f5f5f5;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.sys-property-map {
    height: 400px;
    width: 100%;
    min-height: 300px;
    background: #e8e8e8;
}

.sys-property-map.leaflet-container {
    font-family: inherit;
    background: #fff;
    border-radius: inherit;
}

/* Marcador del mapa */
.sys-leaflet-marker .sys-map-marker-pin {
    position: relative;
    width: 36px;
    height: 36px;
}

.sys-leaflet-marker .sys-map-marker-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: var(--sys-primary);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(255, 56, 92, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: sys-marker-pulse 2s ease-in-out infinite;
}

@keyframes sys-marker-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.08); opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
    .sys-leaflet-marker .sys-map-marker-dot {
        animation: none;
    }
}

/* Popup del mapa */
.sys-map-wrap .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--sys-border-light);
    padding: 0;
    overflow: hidden;
}

.sys-map-wrap .leaflet-popup-content {
    margin: 0;
    min-width: 200px;
}

.sys-map-popup-inner {
    padding: 14px 16px;
}

.sys-map-popup-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--sys-text);
    margin-bottom: 4px;
    line-height: 1.3;
}

.sys-map-popup-desc {
    font-size: 13px;
    color: var(--sys-text-light);
}

/* Controles de zoom */
.sys-map-wrap .leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.sys-map-wrap .leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    background: #fff !important;
    color: var(--sys-text) !important;
    border: 1px solid var(--sys-border-light) !important;
    transition: var(--transition);
}

.sys-map-wrap .leaflet-control-zoom a:hover {
    background: var(--sys-bg-light) !important;
    color: var(--sys-primary) !important;
}

.sys-map-wrap .leaflet-control-zoom a:first-child {
    border-bottom: 1px solid var(--sys-border-light) !important;
}

.sys-map-link {
    display: block;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--sys-text);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: var(--transition);
    border-top: 1px solid var(--sys-border-light);
    background: var(--sys-bg);
}

.sys-map-link:hover {
    color: var(--sys-primary);
    background: var(--sys-bg-light);
}

/* ----- Sidebar ----- */
.sys-single-sidebar {
    position: sticky;
    top: 24px;
}

.sys-booking-card {
    border: 1px solid var(--sys-border-light);
    border-radius: var(--radius-medium);
    padding: 26px;
    box-shadow: var(--shadow-hover);
    background: var(--sys-bg);
    transition: var(--transition);
}

.sys-booking-card:hover {
    box-shadow: var(--shadow-brutal);
}

.sys-property-page.sys-single-airbnb .sys-btn:focus-visible {
    outline: 2px solid var(--sys-primary);
    outline-offset: 2px;
}

.sys-booking-price {
    margin-bottom: 20px;
}

.sys-booking-amount {
    font-size: 20px;
    font-weight: 600;
    color: var(--sys-text);
}

.sys-booking-currency {
    font-size: 15px;
    color: var(--sys-text-light);
    margin-left: 4px;
}

.sys-booking-label {
    display: block;
    font-size: 13px;
    color: var(--sys-text-light);
    margin-bottom: 4px;
}

.sys-booking-no-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--sys-text);
}

.sys-booking-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sys-property-page.sys-single-airbnb .sys-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: var(--radius-small);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 15px;
    min-height: 44px;
}

.sys-property-page.sys-single-airbnb .sys-btn-primary {
    background: var(--sys-primary);
    color: #fff;
}

.sys-property-page.sys-single-airbnb .sys-btn-primary:hover {
    background: var(--sys-primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--sys-primary-glow);
}

.sys-btn-block {
    width: 100%;
    justify-content: center;
}

.sys-btn-outline {
    background: transparent;
    color: var(--sys-text);
    border: 1px solid var(--sys-border);
}

.sys-btn-outline:hover {
    background: var(--sys-bg-hover);
    border-color: var(--sys-text);
}

.sys-booking-promotores {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--sys-border-light);
}

.sys-booking-promotores-label {
    font-size: 11px;
    color: var(--sys-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 8px;
}

.sys-promotor-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--sys-text);
    margin-bottom: 6px;
}

.sys-promotor-mini img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
}

.sys-booking-subsidios {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--sys-border-light);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sys-subsidio-tag {
    font-size: 12px;
    padding: 5px 10px;
    background: var(--sys-bg-light);
    color: var(--sys-text);
    border-radius: var(--radius-small);
    border: 1px solid var(--sys-border-light);
}

/* ----- Lightbox ----- */
.sys-gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    padding: 50px 60px;
}

.sys-gallery-lightbox.active {
    display: flex;
}

.sys-gallery-lightbox .sys-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: #fff;
    color: #222;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.sys-gallery-lightbox .sys-lightbox-close:hover {
    background: var(--sys-primary);
    color: #fff;
}

.sys-gallery-lightbox .sys-lightbox-prev,
.sys-gallery-lightbox .sys-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: #fff;
    color: #222;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.sys-gallery-lightbox .sys-lightbox-prev {
    left: 20px;
}

.sys-gallery-lightbox .sys-lightbox-next {
    right: 20px;
}

.sys-gallery-lightbox .sys-lightbox-prev:hover,
.sys-gallery-lightbox .sys-lightbox-next:hover {
    background: var(--sys-primary);
    color: #fff;
}

.sys-gallery-lightbox .sys-lightbox-content {
    max-width: 90%;
    max-height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sys-gallery-lightbox .sys-lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sys-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

/* ----- WhatsApp flotante ----- */
.sys-whatsapp-float {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 54px;
    height: 54px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
    z-index: 9999;
    transition: var(--transition);
    text-decoration: none;
}

.sys-whatsapp-float::before {
    content: '💬';
    font-size: 26px;
}

.sys-whatsapp-float:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.5);
}

.sys-whatsapp-float:focus-visible {
    outline: 2px solid #25D366;
    outline-offset: 3px;
}

/* ----- Impresión ----- */
@media print {
    .sys-property-page.sys-single-airbnb {
        padding-top: 0;
        padding-bottom: 24px;
    }
    .sys-hero-photo-grid { box-shadow: none; }
    .sys-whatsapp-float,
    .sys-hero-show-all,
    .sys-booking-cta,
    .sys-map-link { display: none !important; }
    .sys-booking-card { box-shadow: none; border: 1px solid #ddd; }
    .sys-single-sidebar { position: static; }
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .sys-hero-photo-grid {
        height: 45vh;
        min-height: 280px;
        max-height: 400px;
        padding: 0 16px;
        margin-bottom: 24px;
    }

    .sys-hero-photo-grid.sys-hero-count-2,
    .sys-hero-photo-grid.sys-hero-count-3,
    .sys-hero-photo-grid.sys-hero-count-4,
    .sys-hero-photo-grid.sys-hero-count-5 {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    .sys-hero-photo-grid.sys-hero-count-3 .sys-hero-photo-main,
    .sys-hero-photo-grid.sys-hero-count-4 .sys-hero-photo-main,
    .sys-hero-photo-grid.sys-hero-count-5 .sys-hero-photo-main {
        grid-row: span 1;
    }

    .sys-hero-photo:not(.sys-hero-photo-main) {
        display: none;
    }

    .sys-single-container {
        padding: 0 16px;
    }

    .sys-single-header {
        padding: 0 0 20px;
        margin-bottom: 24px;
    }

    .sys-single-title {
        font-size: 22px;
    }

    .sys-single-content .sys-section {
        padding: 24px 0;
    }

    .sys-single-content .sys-section-title {
        font-size: 19px;
        margin-bottom: 16px;
    }

    .sys-single-sidebar {
        position: relative;
        top: 0;
    }

    .sys-property-map {
        height: 300px;
    }

    .sys-gallery-lightbox {
        padding: 40px 16px;
    }

    .sys-whatsapp-float {
        bottom: 22px;
        right: 22px;
        width: 50px;
        height: 50px;
    }

    .sys-whatsapp-float::before {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .sys-hero-photo-grid {
        min-height: 240px;
        padding: 0 12px;
    }

    .sys-booking-card {
        padding: 18px;
    }

    .sys-amenities-list-airbnb {
        grid-template-columns: 1fr;
    }
}
