/**
 * CSS especial para el template property-detail.php
 * Estilos para la página de detalle de propiedades
 */

/* Contenedor principal */
.apis-property-detail {
    background: #f8f9fa;
    min-height: 100vh;
}

/* Galería de imágenes */
.apis-property-gallery {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.apis-gallery-slider {
    display: flex;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.img-main {
    width: 60%;
    max-height: 500px;
    position: relative;
    overflow: hidden;
    border-radius: 8px 0 0 8px;
}

.img-main img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.img-main:hover img {
    transform: scale(1.05);
}

.images-secondary {
    width: 40%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-height: 500px;
    padding: 4px;
}

.img-secondary-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    flex: 1;
}

.img-secondary-wrapper img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 10px;
    display: block;
}

.img-secondary-wrapper:hover img {
    transform: scale(1.1);
}

/* Botón "Ver todas las fotos" */
.apis-gallery-view-all {
    background: rgba(0,0,0,0.7) !important;
    color: #fff !important;
    padding: 12px 20px !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(5px);
}

.apis-gallery-view-all:hover {
    background: rgba(0,0,0,0.9) !important;
    color: #fff !important;
    transform: translate(-50%, -50%) scale(1.05) !important;
}

/* Layout principal */
.apis-property-layout {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0; /* Evita que el contenido se desborde */
}

.sidebar {
    width: 350px;
    flex-shrink: 0;
    position: static;
}

/* Información principal de la propiedad */
.apis-property-main-info {
    background: #fff;
    padding: 2rem;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.apis-property-main-info h1 {
    color: #000;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.apis-property-ref {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.apis-property-price {
    font-size: 2rem;
    font-weight: 700;
    color: #7e6a5a;
    margin-bottom: 1.5rem;
}

.apis-property-location {
    color: #34495e;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.apis-property-location i {
    color: #e74c3c;
}

.apis-property-features {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.apis-property-features span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #000;
    font-weight: 500;
    background: #ecf0f1;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
}

.apis-property-features i {
    color: #3498db;
}

/* Descripción */
.apis-property-description {
    background: #fff;
    padding: 2rem;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.apis-property-description h2 {
    color: #000;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
}

.apis-property-description p {
    color: #34495e;
    line-height: 1.8;
    font-size: 1.1rem;
}

/* Características adicionales */
.apis-property-characteristics {
    background: #fff;
    padding: 2rem;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.apis-property-characteristics h2 {
    color: #000;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
}

.apis-property-characteristics ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.apis-property-characteristics li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    color: #34495e;
    font-size: 0.95rem;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.apis-property-characteristics li:hover {
    background: #e9ecef;
    border-color: #3498db;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.apis-property-characteristics li:last-child {
    border: 1px solid #ecf0f1;
}

.apis-property-characteristics i {
    color: #3498db;
    font-size: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* Mapa */
.apis-property-map {
    background: #fff;
    padding: 2rem;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.apis-property-map h2 {
    color: #000;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
}

.apis-property-map iframe {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Tour Virtual */
.apis-property-tour {
    background: #fff;
    padding: 2rem;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.apis-property-tour h2 {
    color: #000;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.tour-container {
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.tour-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Videos */
.apis-property-videos {
    background: #fff;
    padding: 2rem;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.apis-property-videos h2 {
    color: #000;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
}

.apis-property-video {
    margin-bottom: 1.5rem;
}

.apis-property-video iframe {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Sidebar */
.sidebar {
    background: #fff;
    padding: 1.5rem;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.sidebar h3 {
    color: #000;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.sidebar h4 {
    color: #000;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
}

.sidebar p {
    color: #34495e;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.sidebar hr {
    margin: 1.5rem 0;
    border-color: #ecf0f1;
}

.sidebar .btn-primary {
    background: #7e6a5a;
    border: none;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar .btn-primary:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* Mensaje de no propiedad encontrada */
.apis-no-property-detail {
    background: #fff;
    padding: 3rem;
    text-align: center;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    color: #7f8c8d;
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .apis-gallery-slider {
        flex-direction: column;
    }
    
    .img-main {
        width: 100%;
        border-radius: 8px 8px 0 0;
    }
    
    .img-main img {
        height: 400px;
    }
    
    .images-secondary {
        width: 100%;
        border-radius: 0 0 8px 8px;
    }
    
    .apis-property-layout {
        flex-direction: column;
        gap: 2rem;
    }
    
    .sidebar {
        width: 100%;
        order: -1; /* Mover sidebar arriba en móvil */
    }
    
    .apis-property-main-info h1 {
        font-size: 2rem;
    }
    
    .apis-property-price {
        font-size: 1.5rem;
    }
    
    .apis-property-features {
        gap: 1rem;
    }
    
    .apis-property-features span {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .apis-property-characteristics ul {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .sidebar {
        position: static;
    }
}

@media (max-width: 480px) {
    .apis-property-main-info,
    .apis-property-description,
    .apis-property-characteristics,
    .apis-property-map,
    .apis-property-tour,
    .apis-property-videos,
    .sidebar {
        padding: 1.5rem;
    }
    
    .apis-property-main-info h1 {
        font-size: 1.8rem;
    }
    
    .apis-property-features {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.apis-property-main-info,
.apis-property-description,
.apis-property-characteristics,
.apis-property-map,
.apis-property-tour,
.apis-property-videos,
.sidebar {
    animation: fadeInUp 0.6s ease-out;
}

/* Estados de hover mejorados */
.apis-property-main-info:hover,
.apis-property-description:hover,
.apis-property-characteristics:hover,
.apis-property-map:hover,
.apis-property-tour:hover,
.apis-property-videos:hover,
.sidebar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.12);
    transition: all 0.3s ease;
}

/* Sección de Certificación Energética */
.apis-property-energy-certification {
    background: #fff;
    padding: 2rem;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

.apis-property-energy-certification h2 {
    color: #000;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.apis-property-energy-certification h2 i {
    color: #f39c12;
    font-size: 1.5rem;
}

.energy-certification-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.energy-rating-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0;
    padding: 1.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.energy-rating-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.energy-rating-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.energy-rating-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.energy-rating-header h3 {
    color: #000;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.energy-letter {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.energy-letter.a { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.energy-letter.b { background: linear-gradient(135deg, #2ecc71, #3498db); }
.energy-letter.c { background: linear-gradient(135deg, #3498db, #f39c12); }
.energy-letter.d { background: linear-gradient(135deg, #f39c12, #e67e22); }
.energy-letter.e { background: linear-gradient(135deg, #e67e22, #e74c3c); }
.energy-letter.f { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.energy-letter.g { background: linear-gradient(135deg, #c0392b, #8e44ad); }

.energy-consumption-bar {
    margin-top: 1rem;
}

.energy-bar {
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.energy-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease-in-out;
    position: relative;
    overflow: hidden;
}

.energy-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

.energy-bar-fill.a { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.energy-bar-fill.b { background: linear-gradient(90deg, #2ecc71, #3498db); }
.energy-bar-fill.c { background: linear-gradient(90deg, #3498db, #f39c12); }
.energy-bar-fill.d { background: linear-gradient(90deg, #f39c12, #e67e22); }
.energy-bar-fill.e { background: linear-gradient(90deg, #e67e22, #e74c3c); }
.energy-bar-fill.f { background: linear-gradient(90deg, #e74c3c, #c0392b); }
.energy-bar-fill.g { background: linear-gradient(90deg, #c0392b, #8e44ad); }

.energy-value {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.energy-legend {
    background: #f8f9fa;
    border-radius: 0;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.energy-legend h4 {
    color: #000;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.energy-scale {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.energy-scale-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.energy-scale-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.energy-scale-letter {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    color: white;
    margin-bottom: 0.25rem;
}

.energy-scale-item.a .energy-scale-letter { background: #27ae60; }
.energy-scale-item.b .energy-scale-letter { background: #2ecc71; }
.energy-scale-item.c .energy-scale-letter { background: #3498db; }
.energy-scale-item.d .energy-scale-letter { background: #f39c12; }
.energy-scale-item.e .energy-scale-letter { background: #e67e22; }
.energy-scale-item.f .energy-scale-letter { background: #e74c3c; }
.energy-scale-item.g .energy-scale-letter { background: #c0392b; }

.energy-scale-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: center;
    font-weight: 500;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive para certificación energética */

/* Estilos del Modal de Solicitar Información */
.apis-property-modal
{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.apis-modal-content
{
    background: #fff;
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: apisModalSlideIn 0.3s ease;
    padding: 24px;
}

.apis-modal-close
{
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    z-index: 10;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.apis-modal-close:hover
{
    color: #000;
}

.apis-contact-form h3
{
    color: #000;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

/* Estilos para el formulario CF7 dentro del modal */
.apis-contact-form .wpcf7-form
{
    margin: 0;
}

.apis-contact-form .wpcf7-form-control
{
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.apis-contact-form .wpcf7-submit
{
    background: #7e6a5a;
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.apis-contact-form .wpcf7-submit:hover
{
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

@keyframes apisModalSlideIn
{
    from
    {
        opacity: 0;
        transform: translateY(-50px);
    }
    to
    {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bloquear scroll del body cuando el modal está abierto */
body.modal-open
{
    overflow: hidden;
}

/* Responsive para el modal */
@media (max-width: 992px)
{
    .img-secondary-wrapper img {
        height: 150px;
    }
    .img-main img {
        height: 300px;
    }
    .apis-gallery-view-all
    {
        padding: 8px 16px!important;
    }
}
@media (max-width: 768px)
{
    .apis-modal-content
    {
        max-width: 92vw;
        padding: 18px;
    }
    .energy-certification-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .energy-scale {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .energy-rating-card {
        padding: 1rem;
    }
    
    .energy-letter {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px)
{
    .apis-property-modal
    {
        padding: 5px;
        align-items: flex-start;
        padding-top: 10px;
    }
    
    .apis-modal-content
    {
        max-width: 95vw;
        padding: 14px;
        max-height: 95vh;
        border-radius: 8px;
    }
} 