/*
Theme Name: Hello Child
Theme URI: https://github.com/elementor/hello-theme/
Description: Hello Child Theme for Elementor
Author: Your Name
Author URI: https://terrenos.net.pe/
Template: hello-elementor
Version: 1.0.0
Text Domain: hello-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/

/* =========================================
   ESTILOS PARA FORMULARIOS DE TERRENOS
   ========================================= */

/* Variables globales */
:root {
  /* Colores principales */
  --verde-basico: #0d6b3b;
  --verde-premium: #2e7d32;
  --marron: #8e6b3a;
  --marron-premium: #6b4e1f;
  --bg-blanco: #ffffff;
  --bg-gris: #f8fafc;
  --texto-oscuro: #1a202c;
  --texto-medio: #4a5568;
  --texto-claro: #718096;
  --borde: #e2e8f0;
  --exito: #38a169;
  --error: #e53e3e;
  --advertencia: #dd6b20;
  
  /* Sombras */
  --sombra-suave: 0 4px 20px rgba(0, 0, 0, 0.08);
  --sombra-media: 0 6px 25px rgba(0, 0, 0, 0.1);
  --sombra-fuerte: 0 8px 30px rgba(0, 0, 0, 0.12);
  
  /* Bordes */
  --radio-borde: 12px;
  --radio-borde-premium: 16px;
  
  /* Transiciones */
  --transicion-rapida: all 0.3s ease;
  --transicion-lenta: all 0.5s ease;
}

/* =========================================
   ESTILOS PARA LISTADO DE TERRENOS
   ========================================= */

/* Contenedor principal de terrenos */
.terrenos-listing {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    padding: 20px 0;
    margin: 0 auto;
    max-width: 1200px;
}

/* Tarjeta de terreno básico */
.terreno-card-basico {
    background: var(--bg-blanco);
    border-radius: var(--radio-borde);
    box-shadow: var(--sombra-suave);
    border: 1px solid var(--borde);
    overflow: hidden;
    transition: var(--transicion-rapida);
    position: relative;
    height: fit-content;
}

.terreno-card-basico:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-fuerte);
}

.terreno-card-basico::before {
    content: 'BÁSICO';
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--verde-basico);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tarjeta de terreno premium */
.terreno-card-premium {
    background: linear-gradient(135deg, var(--bg-blanco) 0%, var(--bg-gris) 100%);
    border-radius: var(--radio-borde-premium);
    box-shadow: var(--sombra-media);
    border: 2px solid var(--verde-premium);
    overflow: hidden;
    transition: var(--transicion-rapida);
    position: relative;
    height: fit-content;
}

.terreno-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(46, 125, 50, 0.15);
}

.terreno-card-premium::before {
    content: 'PREMIUM ⭐';
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, var(--verde-premium), #4caf50);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Imagen del terreno */
.terreno-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: var(--transicion-rapida);
}

.terreno-card-premium .terreno-image {
    height: 250px;
}

.terreno-card-basico:hover .terreno-image,
.terreno-card-premium:hover .terreno-image {
    transform: scale(1.05);
}

/* Contenido de la tarjeta */
.terreno-content {
    padding: 20px;
}

.terreno-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--texto-oscuro);
    margin: 0 0 10px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.terreno-card-premium .terreno-title {
    font-size: 20px;
    color: var(--verde-premium);
}

.terreno-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--verde-basico);
    margin: 0 0 15px 0;
}

.terreno-card-premium .terreno-price {
    font-size: 24px;
    color: #d32f2f;
}

.terreno-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.terreno-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--texto-medio);
}

.terreno-meta-item i {
    color: var(--verde-basico);
    width: 16px;
    text-align: center;
    font-style: normal;
}

.terreno-card-premium .terreno-meta-item i {
    color: var(--verde-premium);
}

.terreno-location {
    font-size: 14px;
    color: var(--texto-claro);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.terreno-location i {
    font-style: normal;
}

.terreno-description {
    font-size: 14px;
    color: var(--texto-medio);
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Información de contacto */
.terreno-contact {
    background: var(--bg-gris);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid var(--verde-basico);
}

.terreno-card-premium .terreno-contact {
    border-left-color: var(--verde-premium);
    background: linear-gradient(135deg, var(--bg-gris) 0%, #edf2f7 100%);
}

.contact-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--texto-medio);
}

.contact-item strong {
    color: var(--texto-oscuro);
}

/* Badges de estado */
.terreno-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.terreno-badge {
    background: #e2e8f0;
    color: var(--texto-medio);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.terreno-badge.operacion {
    background: #bee3f8;
    color: #2b6cb0;
}

.terreno-badge.categoria {
    background: #c6f6d5;
    color: #276749;
}

/* Botones de acción */
.terreno-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-terreno {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transicion-rapida);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-whatsapp {
    background: #25d366;
    color: white;
}

.btn-whatsapp:hover {
    background: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-details {
    background: var(--verde-basico);
    color: white;
}

.terreno-card-premium .btn-details {
    background: var(--verde-premium);
}

.btn-details:hover {
    background: #084c28;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 107, 59, 0.3);
}

.terreno-card-premium .btn-details:hover {
    background: #1b5e20;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

/* Estados del post */
.terreno-status {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.terreno-status.draft {
    background: var(--error);
}

.terreno-status.pending {
    background: var(--advertencia);
}

.terreno-status.published {
    background: var(--exito);
}

/* Paginación */
.terrenos-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    padding: 20px 0;
}

.terrenos-pagination .page-numbers {
    padding: 10px 18px;
    margin: 0 5px;
    border: 1px solid var(--borde);
    border-radius: 8px;
    text-decoration: none;
    color: var(--texto-medio);
    font-weight: 600;
    transition: var(--transicion-rapida);
}

.terrenos-pagination .page-numbers.current {
    background: var(--verde-basico);
    color: white;
    border-color: var(--verde-basico);
}

.terrenos-pagination .page-numbers:hover {
    background: var(--bg-gris);
    border-color: var(--verde-basico);
    color: var(--verde-basico);
}

/* Mensaje sin resultados */
.no-terrenos {
    text-align: center;
    padding: 60px 20px;
    color: var(--texto-medio);
}

.no-terrenos p {
    font-size: 18px;
    margin: 0;
}

/* =========================================
   ESTILOS PARA PÁGINA INDIVIDUAL DE TERRENO
   ========================================= */

.single-terrenos,
.single-terrenos_premium {
    background: var(--bg-gris);
}

.terreno-single-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.terreno-single-header {
    background: white;
    border-radius: var(--radio-borde);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--sombra-suave);
}

.terreno-single-badge {
    display: inline-block;
    background: var(--verde-basico);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.single-terrenos_premium .terreno-single-badge {
    background: linear-gradient(135deg, var(--verde-premium), #4caf50);
}

.terreno-single-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--texto-oscuro);
    margin: 0 0 20px 0;
    line-height: 1.2;
}

.terreno-single-price {
    font-size: 36px;
    font-weight: 700;
    color: var(--verde-basico);
    margin: 0 0 20px 0;
}

.single-terrenos_premium .terreno-single-price {
    color: #d32f2f;
}

.terreno-single-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.terreno-single-meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-gris);
    border-radius: 8px;
}

.terreno-single-meta-icon {
    width: 40px;
    height: 40px;
    background: var(--verde-basico);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.single-terrenos_premium .terreno-single-meta-icon {
    background: var(--verde-premium);
}

.terreno-single-meta-content h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: var(--texto-claro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.terreno-single-meta-content p {
    margin: 0;
    font-size: 16px;
    color: var(--texto-oscuro);
    font-weight: 600;
}

.terreno-single-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.terreno-single-main {
    background: white;
    border-radius: var(--radio-borde);
    padding: 30px;
    box-shadow: var(--sombra-suave);
}

.terreno-single-sidebar {
    background: white;
    border-radius: var(--radio-borde);
    padding: 30px;
    box-shadow: var(--sombra-suave);
    height: fit-content;
}

.terreno-single-section {
    margin-bottom: 30px;
}

.terreno-single-section:last-child {
    margin-bottom: 0;
}

.terreno-single-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--texto-oscuro);
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-gris);
}

.terreno-single-description {
    line-height: 1.7;
    color: var(--texto-medio);
    font-size: 16px;
}

.terreno-single-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.terreno-single-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    transition: var(--transicion-rapida);
    cursor: pointer;
}

.terreno-single-gallery img:hover {
    transform: scale(1.05);
}

.terreno-single-contact-card {
    text-align: center;
}

.terreno-single-contact-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-gris);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 32px;
    color: var(--verde-basico);
}

.single-terrenos_premium .terreno-single-contact-avatar {
    color: var(--verde-premium);
}

.terreno-single-contact-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--texto-oscuro);
    margin: 0 0 5px 0;
}

.terreno-single-contact-phone {
    font-size: 18px;
    color: var(--texto-medio);
    margin: 0 0 20px 0;
}

.terreno-single-contact-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-contact-whatsapp {
    background: #25d366;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transicion-rapida);
}

.btn-contact-whatsapp:hover {
    background: #128c7e;
    transform: translateY(-2px);
}

.btn-contact-phone {
    background: var(--verde-basico);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transicion-rapida);
}

.single-terrenos_premium .btn-contact-phone {
    background: var(--verde-premium);
}

.btn-contact-phone:hover {
    background: #084c28;
    transform: translateY(-2px);
}

.single-terrenos_premium .btn-contact-phone:hover {
    background: #1b5e20;
}

/* =========================================
   ESTILOS RESPONSIVE
   ========================================= */

@media (max-width: 1024px) {
    .terrenos-listing {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
    
    .terreno-single-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .terrenos-listing {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }
    
    .terreno-meta {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        grid-template-columns: 1fr;
    }
    
    .terreno-actions {
        flex-direction: column;
    }
    
    .terreno-single-container {
        padding: 20px 15px;
    }
    
    .terreno-single-header {
        padding: 20px;
    }
    
    .terreno-single-title {
        font-size: 24px;
    }
    
    .terreno-single-price {
        font-size: 28px;
    }
    
    .terreno-single-meta-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .terreno-single-main,
    .terreno-single-sidebar {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .terreno-content {
        padding: 15px;
    }
    
    .terreno-title {
        font-size: 16px;
    }
    
    .terreno-card-premium .terreno-title {
        font-size: 18px;
    }
    
    .terreno-price {
        font-size: 20px;
    }
    
    .terreno-card-premium .terreno-price {
        font-size: 22px;
    }
    
    .terreno-single-title {
        font-size: 20px;
    }
    
    .terreno-single-price {
        font-size: 24px;
    }
}

/* =========================================
   ANIMACIONES Y EFECTOS
   ========================================= */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.terreno-card-basico,
.terreno-card-premium {
    animation: fadeInUp 0.6s ease-out;
}

/* Efectos de carga skeleton */
.terreno-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* =========================================
   ESTILOS PARA FORMULARIOS EN EL FRONTEND
   ========================================= */

/* Mejoras para los formularios existentes */
.terrenos-form .terrenos-card,
.terrenos-wrap .card-form {
    box-shadow: var(--sombra-suave);
    border: 1px solid var(--borde);
}

.terrenos-form .terrenos-card:hover,
.terrenos-wrap .card-form:hover {
    box-shadow: var(--sombra-media);
}

/* Estados de validación */
.input-valid {
    border-color: var(--exito) !important;
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1) !important;
}

.input-invalid {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1) !important;
}

/* Mensajes de éxito/error */
.form-message {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 600;
}

.form-message.success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: var(--exito);
}

.form-message.error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: var(--error);
}

/* =========================================
   ESTILOS ADICIONALES PARA WORDPRESS
   ========================================= */

/* Ajustes para Elementor */
.elementor-widget-container .terrenos-listing {
    padding: 0;
}

/* Mejora la visualización en el customizer */
.wp-customizer .terreno-card-basico,
.wp-customizer .terreno-card-premium {
    animation: none;
}

/* Soporte para modo oscuro */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-blanco: #1a202c;
        --bg-gris: #2d3748;
        --texto-oscuro: #f7fafc;
        --texto-medio: #e2e8f0;
        --texto-claro: #cbd5e0;
        --borde: #4a5568;
    }
    
    .terreno-card-basico,
    .terreno-card-premium,
    .terreno-single-header,
    .terreno-single-main,
    .terreno-single-sidebar {
        background: #2d3748;
    }
    
    .terreno-contact {
        background: #4a5568;
    }
}

/* =========================================
   ESTILOS PARA WIDGETS Y SIDEBARS
   ========================================= */

.widget_terrenos .terreno-card-basico,
.widget_terrenos .terreno-card-premium {
    margin-bottom: 20px;
}

.widget_terrenos .terrenos-listing {
    grid-template-columns: 1fr;
    gap: 15px;
}

/* =========================================
   UTILIDADES
   ========================================= */

.text-verde-basico { color: var(--verde-basico); }
.text-verde-premium { color: var(--verde-premium); }
.bg-verde-basico { background: var(--verde-basico); }
.bg-verde-premium { background: var(--verde-premium); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================
   ESTILOS PARA ARCHIVES DE TERRENOS
   ========================================= */

.post-type-archive-terrenos .page-header,
.post-type-archive-terrenos_premium .page-header {
    background: linear-gradient(135deg, var(--verde-basico), var(--marron));
    color: white;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
}

.post-type-archive-terrenos_premium .page-header {
    background: linear-gradient(135deg, var(--verde-premium), var(--marron-premium));
}

.page-header h1 {
    font-size: 42px;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.page-header p {
    font-size: 18px;
    margin: 0;
    opacity: 0.9;
}

/* Filtros */
.terrenos-filters {
    background: white;
    padding: 25px;
    border-radius: var(--radio-borde);
    box-shadow: var(--sombra-suave);
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--texto-oscuro);
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--borde);
    border-radius: 8px;
    font-size: 14px;
}

.btn-filter {
    background: var(--verde-basico);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transicion-rapida);
}

.btn-filter:hover {
    background: #084c28;
    transform: translateY(-2px);
}

.post-type-archive-terrenos_premium .btn-filter {
    background: var(--verde-premium);
}

.post-type-archive-terrenos_premium .btn-filter:hover {
    background: #1b5e20;
}