/* ========================================
   BÚSQUEDA DE LUJO - TESOROS DEL CARIBE
   CSS para formularios de búsqueda elegantes
   ======================================== */

/* Aseguramos que el root tenga las variables correctas */
:root {
    /* Heredamos las variables de luxury.css y agregamos específicas de búsqueda */
    --search-title-size: clamp(1.8rem, 3.5vw, 3.5rem);
    --search-text-size: clamp(0.9rem, 1.2vw, 1rem);
    --search-icon-size: clamp(1rem, 1.5vw, 1.2rem);
    --search-button-size: clamp(0.8rem, 1vw, 0.9rem);
}

/* Reset específico para elementos de búsqueda */
.quick-search *,
.quick-search *::before,
.quick-search *::after {
    box-sizing: border-box;
    font-size: inherit;
}

/* Búsqueda Rápida */
.quick-search {
    background: linear-gradient(135deg, var(--white-cream), var(--gray-platinum));
    position: relative;
}

.search-container {
    background: linear-gradient(135deg, var(--navy-primary), var(--navy-dark));
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.search-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--gold-primary) 0%, 
        var(--gold-light) 25%, 
        var(--gold-metallic) 50%, 
        var(--gold-light) 75%, 
        var(--gold-primary) 100%
    );
    background-size: 200% auto;
    animation: shimmerGradient 4s linear infinite;
}

.search-title {
    font-family: var(--font-display);
    font-size: var(--search-title-size);
    text-align: center;
    margin-bottom: var(--space-lg);
    font-weight: 700;
    /* Aplicamos el mismo efecto dorado brillante del hero */
    color: var(--gold-dark);
    background: linear-gradient(
        to right,
        var(--gold-dark) 0%,
        var(--gold-dark) 22%,
        var(--gold-primary) 32%,
        var(--gold-metallic) 47%,
        var(--gold-primary) 52%,
        var(--gold-dark) 72%,
        var(--gold-dark) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 8s linear infinite;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.08);
}

@keyframes shimmerGradient {
    0% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
    100% {
        background-position: 0% center;
    }
}

@keyframes shimmerText {
    0% {
        background-position: 200% center;
    }
    50% {
        background-position: 0% center;
    }
    100% {
        background-position: -200% center;
    }
}

.search-form-simple {
    background: var(--white-pure);
    border-radius: var(--border-radius-lg);
    padding: var(--space-md);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.search-main {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Filtros activos - Prevenir flickering */
.active-filters {
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: var(--space-md);
    opacity: 1;
    max-height: 120px; /* Reducimos la altura máxima para mejor UX */
    display: block;
    position: relative;
    overflow-y: auto; /* Agregamos scroll vertical */
    border-radius: var(--border-radius); /* Agregamos bordes redondeados */
}

.active-filters.hidden {
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden; /* Mantenemos hidden cuando está oculto */
}

.active-filters.visible {
    opacity: 1;
    max-height: 120px; /* Altura máxima consistente */
    margin-top: var(--space-md);
    display: block;
    overflow-y: auto; /* Scroll cuando está visible */
}

/* Loading state para filtros */
.active-filters.loading {
    pointer-events: none;
}

.active-filters.loading .filters-tags {
    opacity: 0.8;
    position: relative;
}

.active-filters.loading .filters-tags::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: shimmer 2s infinite;
    z-index: 1;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.filters-title {
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    font-weight: 600;
    color: var(--navy-primary);
}

.btn-clear-filters {
    background: none;
    border: none;
    color: var(--navy-primary);
    font-size: 0.9rem;
    padding: var(--space-xs);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: background-color 0.2s ease;
}

.btn-clear-filters:hover {
    background: var(--gray-platinum);
}

.filters-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-xs) 0; /* Agregamos padding vertical para mejor separación */
    min-height: fit-content; /* Altura mínima ajustable */
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--navy-primary);
    color: var(--white-pure);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--border-radius);
    font-size: clamp(0.75rem, 1.2vw, 0.85rem);
    font-weight: 500;
}

.filter-tag-remove {
    background: none;
    border: none;
    color: var(--white-pure);
    padding: 2px;
    cursor: pointer;
    border-radius: 2px;
    line-height: 1;
    margin-left: var(--space-xs);
    transition: background-color 0.2s ease;
}

.filter-tag-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

.location-selector {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--white-pure);
    border: 2px solid var(--gray-platinum);
    border-radius: var(--border-radius);
    position: relative;
}

.location-selector::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: var(--space-md);
    color: var(--gold-primary);
    pointer-events: none;
}

.location-icon {
    color: var(--gold-primary);
    font-size: clamp(1rem, 2vw, 1.2rem);
}

.location-select {
    flex: 1;
    border: none;
    background: transparent;
    font-size: clamp(0.875rem, 2vw, 1rem);
    color: var(--navy-primary);
    font-weight: 600;
    outline: none;
    appearance: none;
    cursor: pointer;
    width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    padding-right: var(--space-xl);
}

.location-select option {
    color: var(--navy-primary);
    background: var(--white-pure);
    padding: var(--space-sm);
}

.search-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-filters,
.btn-clear,
.btn-search {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    min-height: 48px;
    transition: all 0.3s ease;
}

.btn-filters {
    background: var(--navy-primary);
    color: var(--white-pure);
    border: none;
}

.btn-filters:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 54, 93, 0.3);
}

.btn-clear {
    background: var(--white-pure);
    color: var(--navy-primary);
    border: 2px solid var(--navy-primary);
    text-decoration: none;
}

.btn-clear:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 54, 93, 0.2);
}

.btn-search {
    background: var(--black-luxury);
    color: var(--white-pure);
    border: none;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(28, 28, 28, 0.4);
    background: #0a0a0a;
}

.btn-search span {
    color: var(--white-pure);
    font-weight: 700;
    text-shadow: none;  /* Removemos la sombra ya que no es necesaria con el alto contraste */
}

/* Responsive */
@media (max-width: 768px) {
    .search-container {
        padding: var(--space-md);
        margin: 0 var(--space-sm);
    }

    .search-main {
        flex-direction: column;
        gap: var(--space-md);
    }

    .location-selector {
        width: 100%;
        padding: var(--space-xs) var(--space-sm);
    }

    .search-actions {
        width: 100%;
        flex-direction: column;
        gap: var(--space-sm);
    }

    .btn-filters,
    .btn-clear,
    .btn-search {
        width: 100%;
        justify-content: center;
        min-height: 40px;
    }

    .location-selector {
        padding: var(--space-xs) var(--space-sm);
    }

    .location-select {
        padding-right: var(--space-lg);
    }

    .location-selector::after {
        right: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .search-container {
        padding: var(--space-sm);
    }

    .search-main {
        gap: var(--space-lg);
    }

    .search-actions {
        gap: var(--space-md);
    }

    .btn-filters,
    .btn-clear,
    .btn-search {
        min-height: 36px;
    }

    .location-selector {
        padding: var(--space-xs) var(--space-xs);
    }

    .location-select {
        font-size: 0.875rem;
        padding-right: var(--space-md);
    }

    .location-icon {
        font-size: 0.9rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    :root {
        --search-title-size: clamp(1.3rem, 3.5vw, 2rem);
        --search-text-size: clamp(0.8rem, 1vw, 0.9rem);
        --search-icon-size: clamp(0.85rem, 1.2vw, 1rem);
        --search-button-size: clamp(0.7rem, 0.85vw, 0.8rem);
    }

    .quick-search .search-container {
        padding: var(--space-md);
    }

    .search-form-simple {
        padding: var(--space-sm);
    }
    
    .search-actions {
        display: flex;
        flex-direction: column;
        gap: var(--space-sm);
        width: 100%;
    }
    
    .btn-clear {
        width: 100%;
        order: 1;
        min-height: 34px;
        padding: 6px;
    }
    
    .btn-filters {
        width: 100%;
        order: 2;
        min-height: 34px;
        padding: 6px;
    }
    
    .btn-search {
        width: 100%;
        order: 3;
        min-height: 34px;
        padding: 6px;
    }

    .btn-filters i,
    .btn-search i,
    .btn-clear i {
        font-size: 0.95rem;
    }
}

/* Mobile Small */
@media (max-width: 360px) {
    :root {
        --search-title-size: clamp(1.2rem, 3.5vw, 1.8rem);
        --search-text-size: clamp(0.75rem, 0.9vw, 0.85rem);
        --search-icon-size: clamp(0.8rem, 1.1vw, 0.95rem);
        --search-button-size: clamp(0.65rem, 0.8vw, 0.75rem);
    }

    .quick-search .search-container {
        padding: var(--space-sm);
    }
    
    .search-actions {
        gap: var(--space-sm);
    }
    
    .btn-clear {
        min-height: 32px;
        padding: 4px;
    }
    
    .btn-filters {
        min-height: 32px;
        padding: 4px;
    }
    
    .btn-search {
        min-height: 32px;
        padding: 4px;
    }

    .btn-filters i,
    .btn-search i,
    .btn-clear i {
        font-size: 0.85rem;
    }
}

/* Extra Small Mobile */
@media (max-width: 280px) {
    .search-actions {
        gap: 6px;
    }
    
    .btn-clear {
        min-height: 30px;
        padding: 3px;
    }
    
    .btn-filters {
        min-height: 30px;
        padding: 3px;
    }
    
    .btn-search {
        min-height: 30px;
        padding: 3px;
    }

    .btn-filters i,
    .btn-search i,
    .btn-clear i {
        font-size: 0.8rem;
    }
}

/* Animación para notificaciones de error de precio */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Estilos para el contenedor de error de validación de precios */
.price-validation-error {
    font-family: var(--font-body);
    line-height: 1.4;
}

/* Responsive para notificaciones de error */
@media (max-width: 768px) {
    .price-validation-error {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        max-width: none !important;
        font-size: 13px !important;
        padding: 10px 14px !important;
    }
} 