/* ============================================================
   CRECEMOS — Detalle de Propiedad
   Estilos para templates/single-property.php
   ============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
    --crp-rojo:       #E30723;
    --crp-rojo-dark:  #b80019;
    --crp-texto:      #222;
    --crp-suave:      #666;
    --crp-borde:      #e0e0e0;
    --crp-fondo:      #f5f5f5;
    --crp-blanco:     #fff;
    --crp-titulo:     'CentenialLT', 'Georgia', serif;
    --crp-body:       'Open Sans', sans-serif;
}

/* ── Reset base del wrapper ───────────────────────────────── */
.cr-prop-wrap {
    font-family: var(--crp-body);
    color: var(--crp-texto);
    background: var(--crp-blanco);
}

/* ── Contenedor interior centrado ────────────────────────── */
.cr-prop-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ── Título de sección ───────────────────────────────────── */
.cr-prop-section-titulo {
    font-family: 'CentenialLT', Georgia, serif;
    font-weight: 100;
    font-size: clamp(20px, 2.6vw, 32px);
    color: var(--crp-rojo);
    text-align: center;
    margin: 0 0 32px;
    letter-spacing: 0.01em;
}

/* ============================================================
   HEADER
   ============================================================ */
.cr-prop-header {
    background: var(--crp-blanco);
    border-bottom: 1px solid var(--crp-borde);
    padding: 28px 0;
}

.cr-prop-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
}

.cr-prop-header__left {
    flex: 1;
    min-width: 0;
}

.cr-prop-titulo {
    font-family: 'CentenialLT', Georgia, serif;
    font-weight: 100;
    font-size: clamp(18px, 2.2vw, 28px);
    color: var(--crp-texto);
    line-height: 1.15;
    margin: 0 0 12px;
}

.cr-prop-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cr-prop-badge {
    font-family: var(--crp-body);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 11px;
    border-radius: 2px;
}

.cr-prop-badge--tipo {
    background: #222;
    color: var(--crp-blanco);
}

.cr-prop-badge--estado {
    background: var(--crp-rojo);
    color: var(--crp-blanco);
}

.cr-prop-badge--label {
    background: #555;
    color: var(--crp-blanco);
}

.cr-prop-header__right {
    text-align: right;
    flex-shrink: 0;
}

.cr-prop-precio {
    font-family: 'CentenialLT', Georgia, serif;
    font-weight: 100;
    font-size: clamp(20px, 2.4vw, 34px);
    color: var(--crp-rojo);
    line-height: 1.05;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.cr-prop-precio__postfix {
    font-size: 0.55em;
    opacity: 0.8;
    font-weight: 100;
    letter-spacing: 0;
}

.cr-prop-area-txt {
    font-family: var(--crp-body);
    font-size: 13px;
    color: var(--crp-suave);
}

/* Fila m² + iconos CTA */
.cr-prop-precio-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
}

/* Iconos CTA (mapa + teléfono) */
.cr-prop-cta-icons {
    display: flex;
    gap: 8px;
}

.cr-prop-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: #f0f0f0;
    border-radius: 2px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.cr-prop-icon-btn:hover {
    background: #e0e0e0;
}

.cr-prop-icon-btn img {
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
}

/* Botón llamar (pendiente número) */
.cr-prop-btn-llamar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 11px 28px;
    background: var(--crp-rojo);
    color: var(--crp-blanco);
    font-family: var(--crp-titulo);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 2px;
    transition: background 0.2s;
}

.cr-prop-btn-llamar:hover {
    background: var(--crp-rojo-dark);
    color: var(--crp-blanco);
}

/* ============================================================
   GALERÍA PRINCIPAL (3 imágenes)
   ============================================================ */
.cr-prop-galeria-top {
    padding: 24px 0;
    background: var(--crp-blanco);
}

/* Imagen única — full width */
.cr-prop-galeria-top__single {
    display: block;
    overflow: hidden;
    border-radius: 2px;
    height: 440px;
}

.cr-prop-galeria-top__single img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s;
}

.cr-prop-galeria-top__single:hover img {
    transform: scale(1.02);
}

.cr-prop-galeria-top__grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    height: 440px;
    gap: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.cr-prop-galeria-top__grande {
    overflow: hidden;
}

.cr-prop-galeria-top__grande img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s;
}

.cr-prop-galeria-top__grande:hover img {
    transform: scale(1.03);
}

.cr-prop-galeria-top__lateral {
    display: flex;
    flex-direction: column;
    gap: 3px;
    height: 100%;
}

/* Link base (imagen grande) */
.cr-prop-galeria-top__link {
    display: block;
    overflow: hidden;
    position: relative;
}

.cr-prop-galeria-top__link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s;
}

.cr-prop-galeria-top__link:hover img {
    transform: scale(1.04);
}

/* Links laterales — absolute para llenar el flex item */
.cr-prop-galeria-top__lateral .cr-prop-galeria-top__link {
    flex: 1;
    min-height: 0;
}

.cr-prop-galeria-top__lateral .cr-prop-galeria-top__link img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Overlay "N más" sobre la última imagen */
.cr-prop-galeria-top__mas {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    gap: 6px;
    pointer-events: none;
}

.cr-prop-galeria-top__mas span {
    font-family: var(--crp-titulo);
    font-size: 18px;
    font-weight: 300;
}

/* ============================================================
   BARRA DE ESPECIFICACIONES
   ============================================================ */
.cr-prop-specs {
    display: flex;
    align-items: stretch;
    background: var(--crp-blanco);
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.cr-prop-spec {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 28px 40px;
    gap: 14px;
    border-right: 2px solid var(--crp-borde);
    flex: 1;
    min-width: 140px;
}

.cr-prop-spec:last-child {
    border-right: none;
}

.cr-prop-spec__icon {
    flex-shrink: 0;
    line-height: 1;
}

.cr-prop-spec__img {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.cr-prop-spec__texts {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Spec sin icono: centrar texto */
.cr-prop-spec--solo .cr-prop-spec__texts {
    text-align: center;
}

.cr-prop-spec__valor {
    font-family: 'CentenialLT', Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--crp-rojo);
    line-height: 1.2;
}

.cr-prop-spec__label {
    font-family: var(--crp-body);
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ============================================================
   DESCRIPCIÓN
   ============================================================ */
.cr-prop-descripcion {
    padding: 56px 0 48px;
    background: var(--crp-blanco);
}

.cr-prop-descripcion__texto {
    font-family: var(--crp-body);
    font-size: 15px;
    line-height: 1.85;
    color: #000;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.cr-prop-descripcion__texto p {
    margin: 0 0 1.2em;
}

.cr-prop-descripcion__texto p:last-child {
    margin-bottom: 0;
}

/* ============================================================
   GALERÍA COMPLETA — grid 4 × 2
   ============================================================ */
.cr-prop-galeria-grid {
    background: var(--crp-fondo);
    padding: 48px 0;
}

.cr-prop-galeria-grid .cr-prop-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.cr-prop-galeria-grid__item {
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #ddd;
}

.cr-prop-galeria-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s;
}

.cr-prop-galeria-grid__item:hover img {
    transform: scale(1.06);
}

/* ============================================================
   MAPA
   ============================================================ */
.cr-prop-mapa-wrap {
    padding: 52px 0 0;
    background: var(--crp-blanco);
}

.cr-prop-mapa {
    width: 100%;
    height: 450px;
    background: #e8e8e8;
    margin-top: 24px;
}

/* ============================================================
   PROPIEDADES RELACIONADAS — grid 3 × 2
   ============================================================ */
.cr-prop-relacionadas {
    padding: 56px 0 64px;
    background: var(--crp-fondo);
}

.cr-prop-relacionadas__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.cr-prop-rel-card {
    display: flex;
    flex-direction: column;
    background: var(--crp-blanco);
    text-decoration: none;
    color: inherit;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid var(--crp-borde);
    transition: box-shadow 0.2s, transform 0.2s;
}

.cr-prop-rel-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    color: inherit;
}

.cr-prop-rel-card__img {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #e0e0e0;
}

.cr-prop-rel-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s;
}

.cr-prop-rel-card:hover .cr-prop-rel-card__img img {
    transform: scale(1.05);
}

.cr-prop-rel-card__sin-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Badges posicionadas en esquinas opuestas */
.cr-prop-rel-badge--tl {
    position: absolute;
    top: 10px;
    left: 10px;
}

.cr-prop-rel-badge--tr {
    position: absolute;
    top: 10px;
    right: 10px;
}

.cr-prop-rel-card__body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.cr-prop-rel-card__titulo {
    font-family: 'CentenialLT', Georgia, serif;
    font-size: 15px;
    font-weight: 100;
    color: var(--crp-texto);
    line-height: 1.3;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Specs row (piso) al pie de la card */
.cr-prop-rel-card__specs {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--crp-borde);
}

/* Fila precio + iconos en cards relacionadas (todo en una sola fila) */
.cr-prop-rel-card__precio-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

/* Precio más compacto dentro de la card para que quepa todo en fila */
.cr-prop-rel-card .cr-card__precio {
    font-size: 14px;
    white-space: nowrap;
}

/* Iconos en fila horizontal junto al precio */
.cr-prop-rel-card__tipo-icons {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}

/* Cada ítem: icono + texto en fila */
.cr-prop-rel-card__icon-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--crp-body);
    font-size: 12px;
    color: var(--crp-suave);
    white-space: nowrap;
}

.cr-prop-rel-card__icon-item img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    opacity: 0.7;
    flex-shrink: 0;
}

/* Precio por m² debajo de la fila principal */
.cr-prop-rel-card__area {
    font-family: var(--crp-body);
    font-size: 12px;
    color: var(--crp-suave);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Pantallas grandes (> 1440px) */
@media (min-width: 1441px) {
    .cr-prop-galeria-top__grid,
    .cr-prop-galeria-top__single {
        height: 520px;
    }
}

/* Tablet landscape (≤ 1024px) */
@media (max-width: 1024px) {
    .cr-prop-inner {
        padding: 0 24px;
    }

    .cr-prop-header__inner {
        padding: 0 24px;
    }

    .cr-prop-specs {
        padding: 0 24px;
    }

    .cr-prop-galeria-top__grid,
    .cr-prop-galeria-top__single {
        height: 380px;
    }

    .cr-prop-galeria-grid .cr-prop-inner {
        grid-template-columns: repeat(3, 1fr);
    }

    .cr-prop-relacionadas__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet portrait (≤ 768px) */
@media (max-width: 768px) {
    .cr-prop-header__inner {
        flex-direction: column;
        gap: 12px;
    }

    .cr-prop-header__right {
        text-align: left;
        width: 100%;
    }

    .cr-prop-precio-meta {
        justify-content: flex-start;
    }

    /* Collage: apila imagen grande arriba + laterales como fila abajo */
    .cr-prop-galeria-top__grid {
        grid-template-columns: 1fr;
        grid-template-rows: 280px 150px;
        height: auto;
    }

    .cr-prop-galeria-top__single {
        height: 280px;
    }

    /* Las dos imágenes laterales pasan a ser una fila horizontal */
    .cr-prop-galeria-top__lateral {
        flex-direction: row;
    }

    .cr-prop-spec {
        padding: 20px 24px;
        min-width: 120px;
    }

    .cr-prop-galeria-grid .cr-prop-inner {
        grid-template-columns: repeat(2, 1fr);
    }

    .cr-prop-relacionadas__grid {
        grid-template-columns: 1fr;
    }

    .cr-prop-mapa {
        height: 340px;
    }

    .cr-prop-section-titulo {
        margin-bottom: 24px;
    }
}

/* Móvil (≤ 480px) */
@media (max-width: 480px) {
    .cr-prop-inner {
        padding: 0 16px;
    }

    .cr-prop-header__inner {
        padding: 0 16px;
    }

    .cr-prop-header {
        padding: 20px 0;
    }

    .cr-prop-specs {
        padding: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    .cr-prop-specs::-webkit-scrollbar {
        display: none;
    }

    .cr-prop-titulo {
        font-size: 20px;
    }

    .cr-prop-galeria-top__grid {
        grid-template-rows: 220px 120px;
    }

    .cr-prop-galeria-top__single {
        height: 220px;
    }

    .cr-prop-spec {
        flex: 0 0 auto;
        min-width: 110px;
        padding: 16px 20px;
        border-right: 2px solid var(--crp-borde);
    }

    .cr-prop-spec:last-child {
        border-right: none;
    }

    .cr-prop-galeria-grid .cr-prop-inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }

    .cr-prop-mapa {
        height: 280px;
    }

    .cr-prop-descripcion {
        padding: 36px 0 32px;
    }

    .cr-prop-descripcion__texto {
        text-align: left;
        font-size: 14px;
    }

    .cr-prop-section-titulo {
        font-size: 22px;
    }

    .cr-prop-relacionadas {
        padding: 40px 0 48px;
    }

    .cr-prop-relacionadas__grid {
        gap: 14px;
    }

    .cr-prop-rel-card__img {
        height: 170px;
    }

    .cr-prop-rel-card__body {
        padding: 14px 16px;
    }
}
