/* ========================================
   SISTEMA DE BUSCA PREMIUM - UNIQUE PLÁSTICA
   Design sofisticado e elegante
   ======================================== */

/* Ícone de Busca no Menu - Design Refinado */
.search-icon-button {
    background: transparent;
    border: 1.5px solid rgba(165, 133, 70, 0.3);
    cursor: pointer;
    padding: 8px 16px;
    margin-left: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 50px;
    overflow: visible;
}

.search-icon-button:hover {
    border-color: #a58546;
    background: rgba(165, 133, 70, 0.05);
    transform: translateY(-1px);
}

.search-icon-button:active {
    transform: translateY(0);
}

.search-icon-button svg {
    width: 18px;
    height: 18px;
    fill: #a58546;
    transition: all 0.3s ease;
}

.search-icon-button:hover svg {
    transform: scale(1.05);
    fill: #8b6f3d;
}

/* Texto "Buscar" no botão - Desktop e Mobile */
.search-icon-button::after {
    content: 'Buscar';
    font-size: 14px;
    color: #999;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

.search-icon-button:hover::after {
    color: #a58546;
}

/* Modal de Busca - Overlay Premium */
.search-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 99999;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-modal-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Container do Modal - Design Elegante */
.search-modal-container {
    background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
    border-radius: 20px;
    width: 90%;
    max-width: 750px;
    max-height: 75vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3),
                0 0 1px rgba(165, 133, 70, 0.5);
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(165, 133, 70, 0.2);
    position: relative;
}

.search-modal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #a58546, #c9a865, #a58546);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-80px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Header do Modal - Premium */
.search-modal-header {
    padding: 20px 30px 25px;
    border-bottom: 1px solid rgba(165, 133, 70, 0.15);
    background: linear-gradient(to bottom, #ffffff, #fefefe);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-modal-close-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.search-modal-close {
    position: static;
    background: #ffffff;
    border: 1.5px solid rgba(165, 133, 70, 0.25);
    font-size: 20px;
    color: #a58546;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    font-weight: 300;
    flex-shrink: 0;
}

.search-modal-close:hover {
    background: rgba(165, 133, 70, 0.1);
    border-color: #a58546;
    transform: rotate(90deg) scale(1.05);
    color: #8b6f3d;
    box-shadow: 0 4px 12px rgba(165, 133, 70, 0.15);
}

.search-modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* Input de Busca - Elegante */
.search-input-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 18px 55px 18px 24px;
    font-size: 17px;
    border: 2px solid rgba(165, 133, 70, 0.2);
    border-radius: 50px;
    background: #ffffff;
    color: #333;
    outline: none;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-weight: 400;
    letter-spacing: 0.3px;
}

.search-input:focus {
    border-color: #a58546;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(165, 133, 70, 0.15),
                0 0 0 4px rgba(165, 133, 70, 0.05);
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: #999;
    font-weight: 300;
}

.search-icon-input {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    fill: #a58546;
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.search-input:focus ~ .search-icon-input {
    opacity: 1;
}

/* Contador de Resultados - Refinado */
.search-results-count {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    padding-left: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.search-results-count strong {
    color: #a58546;
    font-weight: 600;
}

/* Lista de Resultados - Design Premium */
.search-results {
    max-height: 420px;
    overflow-y: auto;
    padding: 20px 25px;
    background: #fafafa;
}

.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: rgba(165, 133, 70, 0.05);
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #a58546, #c9a865);
    border-radius: 10px;
    border: 2px solid #fafafa;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #8b6f3d, #a58546);
}

/* Item de Resultado - Elegante */
.search-result-item {
    padding: 18px 22px;
    margin-bottom: 10px;
    background: #ffffff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    text-decoration: none;
    display: block;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.search-result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #a58546, #c9a865);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.search-result-item:hover::before {
    transform: scaleY(1);
}

.search-result-item:hover {
    background: #ffffff;
    border-left-color: transparent;
    transform: translateX(8px);
    box-shadow: 0 4px 20px rgba(165, 133, 70, 0.15);
}

.search-result-category {
    font-size: 11px;
    text-transform: uppercase;
    color: #a58546;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    display: inline-block;
    padding: 3px 10px;
    background: rgba(165, 133, 70, 0.08);
    border-radius: 20px;
}

.search-result-title {
    font-size: 16px;
    color: #222;
    font-weight: 600;
    margin-bottom: 6px;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.4;
}

.search-result-description {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    font-weight: 400;
}

.search-result-item mark {
    background: linear-gradient(120deg, rgba(165, 133, 70, 0.2) 0%, rgba(165, 133, 70, 0.3) 100%);
    color: #8b6f3d;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Estado Vazio - Elegante */
.search-empty-state {
    padding: 70px 30px;
    text-align: center;
    color: #888;
}

.search-empty-state svg {
    width: 90px;
    height: 90px;
    fill: rgba(165, 133, 70, 0.3);
    margin-bottom: 25px;
    filter: drop-shadow(0 4px 10px rgba(165, 133, 70, 0.1));
}

.search-empty-state h3 {
    color: #333;
    font-size: 22px;
    margin-bottom: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.search-empty-state p {
    font-size: 14px;
    color: #777;
    line-height: 1.6;
}

.search-empty-state strong {
    color: #a58546;
    font-weight: 600;
}

/* Mensagem Inicial - Sofisticada */
.search-initial-state {
    padding: 60px 30px;
    text-align: center;
    color: #888;
}

.search-initial-state svg {
    width: 70px;
    height: 70px;
    fill: rgba(165, 133, 70, 0.4);
    margin-bottom: 20px;
    opacity: 0.8;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.search-initial-state p {
    font-size: 15px;
    color: #666;
    line-height: 1.7;
    font-weight: 400;
}

.search-initial-state small {
    color: #999;
    font-size: 13px;
}

/* Loading State */
.search-loading {
    padding: 50px;
    text-align: center;
    display: none;
}

.search-loading.active {
    display: block;
}

.search-spinner {
    width: 45px;
    height: 45px;
    border: 4px solid rgba(165, 133, 70, 0.2);
    border-top-color: #a58546;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsivo - Premium */
@media (max-width: 768px) {
    .search-modal-overlay.active {
        padding-top: 60px;
    }

    .search-modal-container {
        width: 96%;
        max-height: 80vh;
        border-radius: 16px;
    }

    .search-modal-header {
        padding: 16px 20px 20px;
        gap: 12px;
    }

    .search-input {
        font-size: 16px;
        padding: 16px 50px 16px 20px;
    }

    .search-results {
        padding: 15px 20px;
    }

    .search-result-item {
        padding: 15px 18px;
        margin-bottom: 8px;
    }

    .search-result-title {
        font-size: 15px;
    }

    .search-result-description {
        font-size: 12px;
    }

    /* Botão de busca mobile - Alinhado à esquerda */
    .search-icon-button {
        margin-left: 6px;
        padding: 7px 14px;
        gap: 7px;
    }

    .search-modal-close {
        top: 20px;
        right: 20px;
        width: 34px;
        height: 34px;
    }
}

@media (max-width: 480px) {
    .search-modal-overlay.active {
        padding-top: 30px;
    }

    .search-modal-container {
        width: 100%;
        border-radius: 12px 12px 0 0;
        max-height: 90vh;
    }

    .search-modal-header {
        padding: 14px 16px 18px;
        gap: 10px;
    }

    .search-results {
        max-height: calc(90vh - 160px);
        padding: 12px 15px;
    }

    .search-input {
        padding: 14px 45px 14px 18px;
        font-size: 15px;
    }

    /* Ajustes mobile pequeno */
    .search-icon-button {
        margin-left: 4px;
        padding: 6px 12px;
        gap: 6px;
    }

    .search-modal-close {
        top: 18px;
        right: 18px;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}

/* Acessibilidade Premium */
.search-modal-overlay:focus-within .search-input {
    border-color: #a58546;
}

.search-result-item:focus {
    outline: 2px solid #a58546;
    outline-offset: 3px;
    box-shadow: 0 4px 20px rgba(165, 133, 70, 0.2);
}

.search-icon-button:focus {
    outline: 3px solid rgba(165, 133, 70, 0.4);
    outline-offset: 2px;
}

/* Animação de Entrada dos Resultados */
.search-result-item {
    animation: resultSlideIn 0.3s ease forwards;
    opacity: 0;
}

@keyframes resultSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item:nth-child(1) { animation-delay: 0.05s; }
.search-result-item:nth-child(2) { animation-delay: 0.1s; }
.search-result-item:nth-child(3) { animation-delay: 0.15s; }
.search-result-item:nth-child(4) { animation-delay: 0.2s; }
.search-result-item:nth-child(5) { animation-delay: 0.25s; }
.search-result-item:nth-child(n+6) { animation-delay: 0.3s; }

/* Efeito Hover Suave no Modal */
.search-modal-container {
    transition: transform 0.3s ease;
}
