/* Header Component Styles */
.main-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.main-content {
    /* Fallback evita conteúdo sob a barra no primeiro paint (antes do JS calcular altura real) */
    padding-top: calc(var(--app-header-height, 118px) + env(safe-area-inset-top, 0px));
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 6px;
}

.header-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.header-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-btn i {
    font-size: 1.2rem;
}

.menu-btn,
.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    flex: 1;
    min-width: 0;
    margin-right: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-container {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: min(430px, 100%);
    box-sizing: border-box;
}

.search-box i {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8fa4;
    font-size: 1.15rem;
}

.search-box input {
    width: 100%;
    padding: 0.95rem 1rem 0.95rem 3.4rem;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    transition: transform 0.25s ease;
    cursor: pointer;
}

.search-box input::placeholder {
    color: #8f9bb3;
    font-size: 1.05rem;
}

.search-box input:focus {
    outline: none;
    transform: translateY(-1px);
}

/* Hidden utility class */
.hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-header {
        padding: 0.75rem;
    }

    .header-top {
        margin-bottom: 0.75rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .header-btn {
        font-size: 1rem;
        padding: 0.4rem;
    }

    .search-box input {
        padding: 0.6rem 0.6rem 0.6rem 2.2rem;
        /* iOS Safari dá zoom automático em inputs menores que 16px ao abrir teclado */
        font-size: 16px;
    }
}