/**
 * Tokko Custom Search and Grid Styles
 * Designed for Inmobiliaria Mega with Premium Modern Aesthetics (Glassmorphism & HSL Colors)
 */

:root {
    --tokko-primary: #0f4c81; /* Deep Ocean Blue */
    --tokko-primary-hover: #0a355c;
    --tokko-accent: #d4af37; /* Warm Gold */
    --tokko-accent-hover: #b89728;
    --tokko-bg-glass: rgba(255, 255, 255, 0.85);
    --tokko-border-glass: rgba(15, 76, 129, 0.12);
    --tokko-text: #2c3e50;
    --tokko-text-light: #7f8c8d;
    --tokko-card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --tokko-card-shadow-hover: 0 20px 40px rgba(15, 76, 129, 0.12);
    --tokko-radius: 12px;
    --tokko-transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================================================
   1. Formulario de Búsqueda (Shortcode & Superior)
   ========================================================================== */
.tokko-search-form-wrapper {
    background: var(--tokko-bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--tokko-border-glass);
    border-radius: var(--tokko-radius);
    padding: 24px;
    box-shadow: var(--tokko-card-shadow-hover);
    max-width: 1100px;
    margin: 30px auto;
    position: relative;
    z-index: 10;
}

.tokko-search-form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    align-items: end;
}

.tokko-search-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tokko-search-group label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--tokko-primary);
}

.tokko-search-select-wrapper {
    position: relative;
}

.tokko-search-select-wrapper::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', sans-serif;
    font-weight: 900;
    font-size: 0.8rem;
    color: var(--tokko-primary);
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: var(--tokko-transition);
}

.tokko-search-select-wrapper select {
    width: 100%;
    padding: 12px 35px 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 0.95rem;
    background: #ffffff;
    color: var(--tokko-text);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: var(--tokko-transition);
}

.tokko-search-select-wrapper select:focus {
    outline: none;
    border-color: var(--tokko-primary);
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.15);
}

.tokko-search-btn-group {
    display: flex;
    justify-content: flex-end;
}

.tokko-search-submit-btn {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--tokko-primary), #1a6da8);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(15, 76, 129, 0.25);
    transition: var(--tokko-transition);
}

.tokko-search-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 76, 129, 0.35);
    background: linear-gradient(135deg, var(--tokko-primary-hover), var(--tokko-primary));
}

.tokko-search-submit-btn:active {
    transform: translateY(0);
}

/* ==========================================================================
   2. Contenedores y Grilla de Propiedades
   ========================================================================== */
.tokko-search-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.tokko-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 15px;
}

.tokko-results-title h2 {
    font-size: 1.5rem;
    color: var(--tokko-primary);
    margin: 0;
}

.tokko-results-count {
    color: var(--tokko-text-light);
    font-size: 0.95rem;
}

.tokko-properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
    margin-bottom: 40px;
}

.tokko-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: var(--tokko-radius);
    border: 1px dashed rgba(0,0,0,0.15);
}

.tokko-no-results i {
    font-size: 3rem;
    color: var(--tokko-primary);
    margin-bottom: 15px;
    opacity: 0.6;
}

.tokko-no-results p {
    font-size: 1.1rem;
    color: var(--tokko-text-light);
}

/* ==========================================================================
   3. Tarjeta de Propiedad Custom (Premium Card)
   ========================================================================== */
.tokko-property-card {
    background: #ffffff;
    border-radius: var(--tokko-radius);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    box-shadow: var(--tokko-card-shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: var(--tokko-transition);
}

.tokko-property-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--tokko-card-shadow-hover);
    border-color: rgba(15, 76, 129, 0.15);
}

/* Media y Slider de Imagenes */
.tokko-card-media {
    position: relative;
    aspect-ratio: 16/10.5;
    background: #eaeaea;
    overflow: hidden;
}

.tokko-card-slider {
    width: 100%;
    height: 100%;
    position: relative;
}

.tokko-slider-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.tokko-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 1;
}

.tokko-slide.active {
    opacity: 1;
    z-index: 2;
}

/* Flechas de Navegación */
.tokko-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: var(--tokko-transition);
}

.tokko-slider-btn i {
    font-size: 0.85rem;
    color: var(--tokko-primary);
    transition: var(--tokko-transition);
}

.tokko-slider-btn:hover {
    background: var(--tokko-primary);
}

.tokko-slider-btn:hover i {
    color: #ffffff;
}

.tokko-card-media:hover .tokko-slider-btn {
    opacity: 1;
    visibility: visible;
}

.tokko-slider-prev {
    left: 12px;
}

.tokko-slider-next {
    right: 12px;
}

/* Puntos de Navegación (Dots) */
.tokko-slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.tokko-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--tokko-transition);
}

.tokko-dot.active {
    background: #ffffff;
    transform: scale(1.3);
}

/* Etiquetas flotantes */
.tokko-badge-status {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 12;
    background: var(--tokko-primary);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.tokko-badge-status.alquileres {
    background: #27ae60; /* Soft Green */
}

.tokko-badge-status.ventas {
    background: var(--tokko-primary); /* Ocean Blue */
}

/* Contenido de la Tarjeta */
.tokko-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tokko-card-price-wrapper {
    margin-bottom: 10px;
}

.tokko-card-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--tokko-primary);
}

.tokko-card-currency {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--tokko-accent);
    margin-left: 4px;
}

.tokko-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--tokko-text);
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 44px;
}

.tokko-card-address {
    font-size: 0.85rem;
    color: var(--tokko-text-light);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tokko-card-address i {
    color: var(--tokko-primary);
    opacity: 0.8;
}

/* Características técnicas */
.tokko-card-features {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 14px;
    margin-top: auto;
}

.tokko-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--tokko-text);
    font-size: 0.85rem;
    font-weight: 600;
}

.tokko-feature-item i {
    font-size: 0.95rem;
    color: var(--tokko-primary);
    opacity: 0.7;
}

.tokko-feature-label {
    font-size: 0.75rem;
    color: var(--tokko-text-light);
    font-weight: 400;
    margin-left: 2px;
}

/* Botón de ver más */
.tokko-card-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    cursor: pointer;
}

/* ==========================================================================
   4. Paginación Custom
   ========================================================================== */
.tokko-pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
}

.tokko-page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 6px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    color: var(--tokko-text);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--tokko-transition);
}

.tokko-page-link:hover {
    border-color: var(--tokko-primary);
    color: var(--tokko-primary);
    background: rgba(15, 76, 129, 0.05);
}

.tokko-page-link.active {
    background: var(--tokko-primary);
    color: #ffffff;
    border-color: var(--tokko-primary);
    box-shadow: 0 4px 10px rgba(15, 76, 129, 0.2);
}

.tokko-page-link.dots {
    border: none;
    background: transparent;
    cursor: default;
}

.tokko-page-link.dots:hover {
    background: transparent;
    color: var(--tokko-text);
}

/* ==========================================================================
   5. Diseño Responsivo
   ========================================================================== */
@media (max-width: 768px) {
    .tokko-search-form-wrapper {
        padding: 16px;
        margin: 15px auto;
    }
    
    .tokko-search-form-fields {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .tokko-properties-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tokko-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
