.search-container {
    display: none;
    position: absolute;
    top: 10px; /* Ajustado para ficar abaixo do header */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 300px;
    background-color: #fff;
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.search-wrapper {
    display: flex;
    flex-direction: row; /* Alterado para row para alinhar input e botão na mesma linha */
    width: 100%;
    gap: 10px;
    align-items: center;
}

.search-container input {
    flex: 1; /* Faz o input ocupar o espaço disponível */
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.close-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 12px 10px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
    white-space: nowrap; /* Evita que o texto do botão quebre em várias linhas */
}

.close-btn:hover {
    background-color: #c82333;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
/* ========================================
   ANIMAÇÃO DO ÍCONE DE BUSCA
   ======================================== */
.icon-button .icon {
    transition: all 0.3s ease;
}

.icon-button:hover .icon {
    transform: scale(1.1);
}

/* Estilo para SVG de fechar */
.icon-button svg.icon {
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-button:hover svg.icon {
    transform: rotate(90deg) scale(1.1);
}
/* ========================================
   MODO BUSCA ATIVO - TELA LIMPA
   ======================================== */
body.search-mode-active {
    background: #f8f9fa;
}

/* Garantir que apenas resultados apareçam */
body.search-mode-active #product-container {
    margin-top: 20px !important;
    padding-top: 0 !important;
}

/* Forçar altura mínima para resultados */
body.search-mode-active #normal-section {
    min-height: calc(100vh - 200px);
}

/* ========================================
   ANIMAÇÃO DO ÍCONE DE BUSCA
   ======================================== */
.icon-button .icon {
    transition: all 0.3s ease;
    cursor: pointer;
}

.icon-button:hover .icon {
    transform: scale(1.15);
}

/* Animação de rotação ao trocar para X */
.icon-button .icon[alt="Limpar busca"] {
    animation: rotateIn 0.3s ease;
}

@keyframes rotateIn {
    from {
        transform: rotate(-90deg) scale(0.8);
        opacity: 0;
    }
    to {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

/* Animação ao voltar para lupa */
.icon-button .icon[alt="Buscar"] {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Destacar botão quando busca ativa */
body.search-mode-active .icon-button {
    background: rgba(231, 76, 60, 0.1);
    border-radius: 50%;
}

/* ========================================
   RESPONSIVIDADE MOBILE
   ======================================== */
@media (max-width: 768px) {
    body.search-mode-active #normal-section {
        min-height: calc(100vh - 150px);
    }
}

/* ========================================
   ANIMAÇÃO DO SVG DE FECHAR
   ======================================== */
.icon-button svg.close-icon {
    animation: rotateIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes rotateIn {
    0% {
        transform: rotate(-90deg) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: rotate(20deg) scale(1.1);
    }
    100% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

/* Hover no X vermelho */
.icon-button:hover svg.close-icon {
    transform: rotate(90deg) scale(1.15) !important;
    filter: drop-shadow(0 0 8px rgba(231, 76, 60, 0.5));
}

/* Pulso no botão quando busca ativa */
body.search-mode-active .icon-button {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
}
/* ========================================
   GARANTIR VISIBILIDADE DO ÍCONE
   ======================================== */
#searchButton {
    position: relative;
    z-index: 10000;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#searchButton .icon {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#searchButton svg.close-icon {
    display: block !important;
    opacity: 1 !important;
}

/* Efeito visual quando X está ativo */
#searchButton svg.close-icon path {
    transition: all 0.3s ease;
}

#searchButton:hover svg.close-icon path {
    fill: #C0392B !important;
}

/* ========================================
   OCULTAR TUDO EM MODO BUSCA
   ======================================== */
body.search-mode-active .trevus-marketing-carousel,
body.search-mode-active #trevus-fixed-banner,
body.search-mode-active #banner-container,
body.search-mode-active #benefits-section,
body.search-mode-active #brands-carousel-section,
body.search-mode-active #reviews-carousel-section,
body.search-mode-active #scroll-to-top,
body.search-mode-active #featured-section {
    display: none !important;
}

/* Garantir que resultados apareçam */
body.search-mode-active #normal-section {
    display: block !important;
    min-height: 60vh;
    padding-top: 20px;
}

body.search-mode-active #product-container {
    margin-top: 0 !important;
}
/* ========================================
   INDICADOR DE CATEGORIA ATIVA (MOBILE)
   ======================================== */

.category-active-badge {
    display: none;
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 999;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
    max-width: 80%;
}

.category-active-badge.show {
    display: flex;
}

.category-badge-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.category-badge-close {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.category-badge-close:hover,
.category-badge-close:active {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Desktop: esconder badge */
@media (min-width: 1024px) {
    .category-active-badge {
        display: none !important;
    }
}