/* ======================
   HERO SECTION - ESTILO ZAP IMÓVEIS - MOBILE FIRST
   ====================== */

/* BASE MOBILE STYLES */
.hero-main-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.hero-main-title span {
    color: #23ffba;
    font-weight: 700;
}

.hero-main-title.blurred {
    opacity: 0.7;
    transform: translateY(-2px);
}

/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

/* Overlay escuro para foco no formulário */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2;
    backdrop-filter: blur(2px);
}

/* Remover estas regras já que o Alpine.js controla a visibilidade */

/* Container principal com z-index elevado quando ativo */
.hero-search-container-wide.focused {
    position: relative;
    z-index: 200;
    transform: translateY(-5px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

/* Garantir que o formulário tenha z-index alto sempre */
.hero-search-container-wide {
    position: relative;
    z-index: 150;
    transition: all 0.3s ease;
}

/* Título principal */
.hero-main-title {
    font-size: 3.2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.1;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.hero-main-title.blurred {
    opacity: 0.1;
}

.hero-main-title span {
    color: #23ffba;
    font-weight: 700;
}

/* ======================
   ÍCONES DA SEÇÃO DE BUSCA
   ====================== */

/* Ícones nos labels dos campos */
.hero-field-icon {
    opacity: 0.9;
    flex-shrink: 0;
}

/* Ícones nas abas */
.hero-tab-icon {
    transition: all 0.2s ease;
    opacity: 0.7;
    flex-shrink: 0;
}

.hero-tabs-wide .btn-check:checked + .hero-tab-wide .hero-tab-icon {
    opacity: 1;
    color: #1ECC94;
}

.hero-tab-wide:hover .hero-tab-icon {
    opacity: 0.9;
}

/* ÍCONES MOBILE FIRST */
.hero-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    opacity: 0.6;
    pointer-events: none;
    width: 18px;
    height: 18px;
}

.hero-select-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    opacity: 0.6;
    pointer-events: none;
    width: 18px;
    height: 18px;
}

/* ÍCONES - DESKTOP */
@media (min-width: 768px) {
    .hero-input-icon,
    .hero-select-icon {
        left: 16px;
        width: 20px;
        height: 20px;
    }
}

/* ======================
   LAYOUT WIDE - HORIZONTAL
   ====================== */

/* CONTAINER PRINCIPAL - MOBILE FIRST */
.hero-search-container-wide {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    margin: 0 12px;
}

/* CONTAINER - TABLET E DESKTOP */
@media (min-width: 768px) {
    .hero-search-container-wide {
        border-radius: 16px;
        padding: 24px 32px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
        margin: 0;
    }
}

/* ABAS - MOBILE FIRST */
.hero-tabs-container-wide {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.hero-tabs-wide {
    background: transparent;
    border: none;
    display: flex;
    gap: 0;
    width: 100%;
    flex-direction: column;
}

/* ABAS - TABLET E DESKTOP */
@media (min-width: 768px) {
    .hero-tabs-container-wide {
        justify-content: flex-start;
        margin-bottom: 16px;
    }

    .hero-tabs-wide {
        display: inline-flex;
        flex-direction: row;
        width: auto;
    }
}

/* ABAS INDIVIDUAIS - MOBILE FIRST */
.hero-tab-wide {
    background: transparent;
    border: 2px solid #e9ecef;
    color: #6c757d;
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    min-height: 48px; /* Touch-friendly */
}

/* ABAS - TABLET E DESKTOP */
@media (min-width: 768px) {
    .hero-tab-wide {
        border: none;
        border-bottom: 3px solid transparent;
        border-radius: 0;
        font-size: 1.1rem;
        padding: 8px 24px;
        margin-bottom: 0;
        min-height: auto;
    }
}

.hero-tab-wide:hover {
    color: #181818;
    background: rgba(30, 204, 148, 0.1);
    border-bottom-color: rgba(30, 204, 148, 0.5);
}

.hero-tab-wide:active {
    transform: translateY(1px);
}

.hero-tabs-wide .btn-check:checked + .hero-tab-wide {
    background: transparent;
    color: #1ECC94;
    font-weight: 700;
    border-bottom: 3px solid #1ECC94;
    box-shadow: none;
}

/* Labels dos campos wide */
.hero-field-label-wide {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 8px;
    text-transform: none;
}

/* CAMPO DE PESQUISA - MOBILE FIRST */
.hero-search-input-wide {
    height: 48px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px 12px 45px; /* Espaço para o ícone */
    font-size: 1rem;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: none;
    width: 100%;
}

/* CAMPO DE PESQUISA - DESKTOP */
@media (min-width: 768px) {
    .hero-search-input-wide {
        height: 56px;
        padding: 16px 20px 16px 50px;
        font-size: 1.1rem;
    }
}

.hero-search-input-wide:focus {
    border-color: #23ffba;
    box-shadow: 0 0 0 3px rgba(35, 255, 186, 0.1);
    outline: none;
}

.hero-search-input-wide::placeholder {
    color: #80868b;
    font-weight: 400;
}

/* SELECT - MOBILE FIRST */
.hero-select-wide {
    height: 48px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 40px 12px 45px; /* Padding direito aumentado para seta */
    font-size: 1rem;
    background: #fff;
    transition: all 0.3s ease;
    color: #3c4043;
    line-height: 1.4;
    width: 100%;
    appearance: none; /* Remove estilo padrão do navegador */
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    /* Seta customizada */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

/* SELECT - DESKTOP */
@media (min-width: 768px) {
    .hero-select-wide {
        height: 56px;
        padding: 16px 50px 16px 50px; /* Padding direito aumentado */
        font-size: 1.1rem;
        background-position: right 16px center;
        background-size: 18px;
    }
}

.hero-select-wide:hover {
    border-color: #d1d5d9;
    background-color: #fafbfc;
}

.hero-select-wide:focus {
    border-color: #23ffba;
    box-shadow: 0 0 0 3px rgba(35, 255, 186, 0.1);
    outline: none;
    background-color: #fff;
}

/* Estilo das opções do select */
.hero-select-wide option {
    padding: 8px 12px;
    font-size: inherit;
    color: #3c4043;
    background-color: #fff;
}

/* Botão de limpar clean no dropdown */
.clean-clear-btn {
    transition: all 0.2s ease;
    font-weight: 500;
    white-space: nowrap;
}

.clean-clear-btn:hover {
    color: #0056b3 !important;
    text-decoration: none !important;
    transform: translateY(-1px);
}

.clean-clear-btn:active {
    transform: translateY(0px);
    color: #004085 !important;
}

.clean-clear-btn:focus {
    box-shadow: none;
    outline: none;
}

/* Opção de limpar no dropdown */
.hover-bg:hover {
    background-color: #f8f9fa !important;
    transition: background-color 0.2s ease;
}

/* BOTÃO DE BUSCA - MOBILE FIRST */
.btn-hero-search-wide {
    background-color: #23FFBA;
    color: #181818;
    border: 0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 12px;
}

/* BOTÃO DE BUSCA - DESKTOP */
@media (min-width: 768px) {
    .btn-hero-search-wide {
        height: 56px;
        padding: 16px 24px;
        font-size: 1.1rem;
        gap: 8px;
        margin-top: 0;
    }
}

.btn-hero-search-wide:hover:not(:disabled) {
    background-color: #1ee6a8;
    color: #181818;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(35, 255, 186, 0.3);
}

.btn-hero-search-wide:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(35, 255, 186, 0.2);
}

.btn-hero-search-wide:disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ======================
   LAYOUT ORIGINAL - CENTRALIZADO
   ====================== */

/* Container principal de pesquisa */
.hero-search-container {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-width: 100%;
}

/* Container das abas */
.hero-tabs-container {
    margin-bottom: 32px;
}

/* Abas estilo ZAP */
/* REGRAS ANTIGAS REMOVIDAS - USANDO MOBILE FIRST ACIMA */

.hero-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: #5f6368;
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-tab:hover {
    color: #3c4043;
    background: rgba(255, 255, 255, 0.7);
}

.hero-tabs .btn-check:checked + .hero-tab {
    background: #fff;
    color: #26c492;
    font-weight: 700;
    box-shadow: 0 1px 8px rgba(38, 196, 146, 0.15);
    border: 1px solid rgba(38, 196, 146, 0.2);
}

/* Labels dos campos */
.hero-field-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 8px;
    text-transform: none;
}

/* Campo de pesquisa */
.hero-search-input {
    height: 56px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 1.1rem;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: none;
}

.hero-search-input:focus {
    border-color: #23ffba;
    box-shadow: 0 0 0 3px rgba(35, 255, 186, 0.1);
    outline: none;
}

.hero-search-input::placeholder {
    color: #80868b;
    font-weight: 400;
}

/* Select */
.hero-select {
    height: 56px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 1.1rem;
    background: #fff;
    transition: all 0.3s ease;
    color: #3c4043;
}

.hero-select:focus {
    border-color: #23ffba;
    box-shadow: 0 0 0 3px rgba(35, 255, 186, 0.1);
    outline: none;
}

/* Container do botão */
.hero-search-button {
    text-align: center;
}

/* Botão de busca */
.btn-hero-search {
    background-color: #23ffba;
    color: #000;
    border: 0;
    border-radius: 8px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
    min-width: 200px;
}

.btn-hero-search:hover:not(:disabled) {
    background-color: #1edfa4;
    color: #000;
}

.btn-hero-search:disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Dropdown de resultados */
.btnLocation {
    color: #26c492 !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.btnLocation:hover {
    background-color: #f1f3f4 !important;
}

.btnLocation span {
    color: #3c4043 !important;
}

.btnLocation span strong {
    color: #26c492 !important;
}

/* Responsividade */
/* MELHORIAS ADICIONAIS MOBILE */
@media (max-width: 767px) {
    .hero-search-fields-wide .row {
        gap: 16px;
    }

    .hero-field-label-wide {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    /* Dropdown com melhor scroll em mobile */
    .bg-white.border.rounded.shadow {
        max-height: 250px;
        border-radius: 8px !important;
    }

    /* Melhor espaçamento para o texto do placeholder */
    .hero-search-input-wide::placeholder,
    .hero-select-wide {
        font-size: 0.95rem;
    }
}

/* MOBILE EXTRA SMALL */
@media (max-width: 480px) {
    .hero-main-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }

    .hero-search-container-wide {
        padding: 12px;
        margin: 0 8px;
        border-radius: 8px;
    }

    .hero-field-label-wide {
        font-size: 0.85rem;
    }

    .hero-search-input-wide,
    .hero-select-wide {
        font-size: 0.9rem;
        height: 44px;
    }

    .btn-hero-search-wide {
        height: 44px;
        font-size: 0.95rem;
        font-weight: 700;
    }
}

/* LANDSCAPE MOBILE */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-main-title {
        font-size: 1.4rem;
        margin-bottom: 8px;
    }

    .hero-search-container-wide {
        padding: 8px;
    }

    .hero-tabs-wide .hero-tab-wide {
        padding: 8px 12px;
        margin-bottom: 4px;
    }
}

/* ======================
   FINALIZAÇÃO MOBILE FIRST
   ====================== */

/* Touch targets mínimos para acessibilidade */
@media (max-width: 767px) {
    .hero-tab-wide,
    .btn-hero-search-wide,
    .hero-search-input-wide,
    .hero-select-wide {
        min-height: 44px; /* Padrão iOS/Android */
    }

    /* Melhor contraste para leitura */
    .hero-field-label-wide {
        color: #495057;
        font-weight: 600;
    }
}

/* ======================
   ESTILOS ANTIGOS MANTIDOS PARA COMPATIBILIDADE
   ====================== */

#group-search .btn-outline-primary {
    background-color: white;
    color: #000;
    border-color: #fff;
    border: 0px !important;
    font-size: 1rem;
}

#group-search .btn-outline-primary.active,
#group-search .btn-outline-primary:active,
#group-search .btn-check:checked + .btn-outline-primary {
    background-color: var(--text-dark);
    color: var(--active-color);
}

#searchfield {
    border-radius: 8px;
    border: 2px solid var(--active-color);
    background-color: #f8f9fa;
    font-size: 1.1rem;
    color: #212529;
    transition: all 0.2s ease-in-out;
}

#searchfield:focus {
    outline: none;
    border-color: var(--active-color);
    background-color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

#searchfield::placeholder {
    color: #6c757d;
    font-style: italic;
    font-size: 1rem;
}

.btn-custom {
    background-color: #23ffba;
    color: #212529;
    border: none;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.btn-custom:disabled {
    background-color: #23ffba;
    color: #212529;
}

.btn-custom:hover {
    background-color: #1edfa4;
    color: #212529;
}

[x-cloak] { display: none !important; }
