/* ============================================
   BARRA DE BÚSQUEDA PREMIUM - DISEÑO MEJORADO
   Fecha: 2025-12-01
============================================ */

.barra-busqueda-premium {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

.busqueda-contenedor-premium {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e0e7ee;
    border-radius: 50px;
    padding: 8px 8px 8px 20px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 4px 10px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.busqueda-contenedor-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--primary-gold, #D4AF37) 50%,
        transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.busqueda-contenedor-premium:hover,
.busqueda-contenedor-premium:focus-within {
    border-color: var(--primary-gold, #D4AF37);
    box-shadow:
        0 15px 40px rgba(212, 175, 55, 0.15),
        0 8px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.busqueda-contenedor-premium:focus-within::before {
    opacity: 1;
}

/* Icono de búsqueda */
.icono-busqueda-premium {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 12px;
    color: var(--primary-gold, #D4AF37);
    font-size: 18px;
    transition: all 0.3s ease;
}

.busqueda-contenedor-premium:focus-within .icono-busqueda-premium {
    transform: scale(1.1) rotate(5deg);
}

/* Input de búsqueda */
.input-busqueda-premium {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 15px;
    font-size: 15px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #2c3e50;
    font-weight: 400;
    outline: none;
    transition: all 0.3s ease;
}

.input-busqueda-premium::placeholder {
    color: #95a5a6;
    font-weight: 300;
    transition: all 0.3s ease;
}

.input-busqueda-premium:focus::placeholder {
    color: #bdc3c7;
    transform: translateX(5px);
}

/* Botón de buscar */
.btn-buscar-premium {
    background: linear-gradient(135deg, var(--primary-gold, #D4AF37) 0%, #C4991F 100%);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 12px rgba(212, 175, 55, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-right: 8px;
}

.btn-buscar-premium::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-buscar-premium:hover::before {
    width: 300px;
    height: 300px;
}

.btn-buscar-premium:hover {
    background: linear-gradient(135deg, #C4991F 0%, var(--primary-gold, #D4AF37) 100%);
    box-shadow:
        0 6px 20px rgba(212, 175, 55, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-buscar-premium:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Botón de limpiar */
.btn-limpiar-premium {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 12px rgba(231, 76, 60, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-size: 16px;
}

.btn-limpiar-premium:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    box-shadow:
        0 6px 20px rgba(231, 76, 60, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px) rotate(90deg);
}

.btn-limpiar-premium:active {
    transform: translateY(0) rotate(90deg);
    box-shadow:
        0 2px 8px rgba(231, 76, 60, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Resultados de búsqueda */
.resultados-busqueda-premium {
    margin-top: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e0e7ee;
    border-radius: 12px;
    color: #2c3e50;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .barra-busqueda-premium {
        max-width: 100%;
    }

    .busqueda-contenedor-premium {
        padding: 6px 6px 6px 15px;
        border-radius: 40px;
    }

    .icono-busqueda-premium {
        width: 20px;
        height: 20px;
        font-size: 16px;
        margin-right: 8px;
    }

    .input-busqueda-premium {
        padding: 10px 10px;
        font-size: 14px;
    }

    .btn-buscar-premium {
        padding: 10px 20px;
        font-size: 13px;
        margin-right: 6px;
    }

    .btn-limpiar-premium {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .busqueda-contenedor-premium {
        flex-wrap: wrap;
        padding: 10px;
        border-radius: 20px;
    }

    .icono-busqueda-premium {
        margin-right: 8px;
    }

    .input-busqueda-premium {
        width: 100%;
        margin-bottom: 10px;
        padding: 10px;
        text-align: center;
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.5);
    }

    .btn-buscar-premium {
        flex: 1;
        margin-right: 8px;
        padding: 10px 16px;
        font-size: 12px;
    }

    .btn-limpiar-premium {
        width: 40px;
        height: 40px;
    }
}

/* Animación de carga en el input */
.input-busqueda-premium.searching {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(212, 175, 55, 0.1) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: searching 1.5s linear infinite;
}

@keyframes searching {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Estado con resultados */
.resultados-busqueda-premium.has-results {
    border-color: #27ae60;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.resultados-busqueda-premium.no-results {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

/* Efecto de brillo sutil */
.busqueda-contenedor-premium::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
    pointer-events: none;
    opacity: 0;
}

.busqueda-contenedor-premium:hover::after {
    opacity: 1;
    animation: shine 2s ease infinite;
}

@keyframes shine {
    0% {
        left: -50%;
    }
    100% {
        left: 150%;
    }
}

/* ============================================
   FILTROS HORIZONTALES PREMIUM - DISEÑO COMPACTO
============================================ */

.filtros-horizontales-premium {
    margin-top: 20px;
    padding: 14px 18px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(248, 250, 252, 0.85) 100%
    );
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.05),
        0 10px 20px rgba(0, 0, 0, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(229, 231, 235, 0.5);
    position: relative;
    overflow: hidden;
}

.filtros-horizontales-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(212, 175, 55, 0.03),
        transparent
    );
    transition: left 0.6s ease;
}

.filtros-horizontales-premium:hover::before {
    left: 100%;
}

.grupo-filtros-premium {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.grupo-filtros-premium:last-child {
    margin-bottom: 0;
}

.titulo-grupo-filtros {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.titulo-grupo-filtros i {
    color: var(--primary-gold, #D4AF37);
    font-size: 14px;
}

.contenedor-chips-filtros {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Chips de filtros - Versión compacta */
.chip-filtro {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    color: #374151;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    white-space: nowrap;
}

.chip-filtro i {
    font-size: 13px;
    transition: transform 0.25s ease;
}

.chip-filtro span {
    transition: transform 0.25s ease;
}

.chip-filtro::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.08);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.chip-filtro:hover::before {
    width: 120px;
    height: 120px;
}

.chip-filtro:hover {
    border-color: var(--primary-gold, #D4AF37);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(212, 175, 55, 0.12);
}

.chip-filtro:hover i {
    transform: scale(1.15);
}

.chip-filtro:active {
    transform: translateY(0);
}

/* Estado activo del chip */
.chip-filtro.active {
    background: linear-gradient(135deg, var(--primary-gold, #D4AF37) 0%, #C4991F 100%);
    border-color: #C4991F;
    color: white;
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.25);
    font-weight: 600;
}

.chip-filtro.active i {
    animation: gentlePulse 2s ease infinite;
}

@keyframes gentlePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* Variantes de colores para chips de nutrición */
.chip-nutricion:not(.active):hover {
    border-color: #4CAF50;
    background: #f1f8f4;
}

.chip-nutricion.active {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    border-color: #388E3C;
}

/* Variantes de colores para chips de belleza */
.chip-belleza:not(.active):hover {
    border-color: #E91E63;
    background: #fef0f5;
}

.chip-belleza.active {
    background: linear-gradient(135deg, #E91E63 0%, #C2185B 100%);
    border-color: #C2185B;
}

/* Variantes de colores para categorías */
.chip-categoria:not(.active):hover {
    border-color: #3B82F6;
    background: #eff6ff;
}

.chip-categoria.active {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    border-color: #2563EB;
}

/* Botón de limpiar filtros - Versión compacta */
.btn-limpiar-filtros-premium {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #ffffff;
    border: 1.5px solid #ef4444;
    border-radius: 20px;
    color: #ef4444;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn-limpiar-filtros-premium::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-limpiar-filtros-premium:hover::before {
    width: 200px;
    height: 200px;
}

.btn-limpiar-filtros-premium:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-color: #dc2626;
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

.btn-limpiar-filtros-premium:active {
    transform: translateY(0);
}

.btn-limpiar-filtros-premium i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.btn-limpiar-filtros-premium:hover i {
    transform: rotate(180deg);
}

/* Responsive para filtros */
@media (max-width: 768px) {
    .filtros-horizontales-premium {
        padding: 12px 15px;
    }

    .grupo-filtros-premium {
        gap: 6px;
    }

    .titulo-grupo-filtros {
        font-size: 11px;
        width: 100%;
        margin-bottom: 5px;
    }

    .titulo-grupo-filtros i {
        font-size: 12px;
    }

    .contenedor-chips-filtros {
        gap: 5px;
        width: 100%;
    }

    .chip-filtro {
        padding: 5px 10px;
        font-size: 11px;
    }

    .chip-filtro i {
        font-size: 11px;
    }

    .btn-limpiar-filtros-premium {
        padding: 5px 12px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .filtros-horizontales-premium {
        padding: 10px 12px;
        margin-top: 15px;
    }

    .grupo-filtros-premium {
        margin-bottom: 10px;
    }

    .titulo-grupo-filtros {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .contenedor-chips-filtros {
        gap: 5px;
    }

    .chip-filtro {
        padding: 5px 10px;
        font-size: 11px;
    }

    .chip-filtro i {
        font-size: 11px;
    }
}

/* Animación de entrada para los filtros */
.filtros-horizontales-premium {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Indicador visual de filtro activo */
.chip-filtro.active::after {
    content: '✓';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 1.5px solid white;
    border-radius: 50%;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow:
        0 2px 6px rgba(16, 185, 129, 0.4),
        0 1px 2px rgba(0, 0, 0, 0.1);
    animation: popIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Efecto de brillo en chips - solo cuando NO está activo */
.chip-filtro:not(.active)::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.5),
        transparent
    );
    transition: left 0.5s ease;
    pointer-events: none;
}

.chip-filtro:not(.active):hover::after {
    left: 100%;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Separador sutil entre grupos de filtros */
.grupo-filtros-premium:not(:last-child) {
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(229, 231, 235, 0.3);
}
