/* ==========================================================================
   RADHA CORE — HEADER.CSS
   Estilos estruturais do cabeçalho: sticky, branding, ações, menu-toggle,
   navegação principal e o estado "sobre o hero".

   Este ficheiro é carregado em TODAS as páginas. Anteriormente estes
   estilos viviam apenas no home.css (enfileirado só em is_front_page() ||
   is_home()), o que fazia o header ficar sem display:flex, sem branding e
   com dimensões erradas em todas as outras páginas do site.

   Mobile-first rigoroso | Vanilla CSS | Variáveis do style.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. COMPENSAÇÃO DO HEADER FIXO
   O .site-header é position:fixed, por isso sai do fluxo normal e o conteúdo
   ficaria por baixo dele. Nas páginas COM hero a compensação é feita dentro
   do próprio hero, por .hero-body { padding-top }, porque o hero tem de
   encostar ao topo da janela para a imagem de fundo ocupar a primeira dobra.

   Daí a classe .radha-has-hero, acrescentada ao <body> por
   radha_core_body_class_has_hero() em functions.php: sem ela, qualquer
   `padding-top` em #content desceria o hero 72–88px e abriria uma faixa da cor
   do body acima da imagem — o espaço que estas regras deviam evitar.

   Antes usava-se :not(.home):not(.front-page), mas o WordPress nunca acrescenta
   essas classes: a home é servida por index.php e o body fica apenas com
   `blog`. A excepção nunca chegava a aplicar-se, pelo que a home recebia a
   compensação duas vezes — uma aqui, outra no .hero-body.
   -------------------------------------------------------------------------- */

/* Remove margem padrão do browser para que o hero encoste no topo */
body {
    margin: 0;
}



/* Com hero: #content e #primary começam no topo (hero-background em top 0) */
body.radha-has-hero #content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.radha-has-hero #primary {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.radha-has-hero .radha-hero-fullscreen {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* --------------------------------------------------------------------------
   1. POSICIONAMENTO E ESTADOS DO STICKY HEADER
   -------------------------------------------------------------------------- */
/*
 * Escala unica do header. Todas as alturas derivam destas variaveis para que
 * o logo, o botao de consulta e o menu-toggle fiquem sempre na mesma linha
 * de base, independentemente do estado de scroll.
 */
.site-header {
    --header-control-height: 40px;
    --header-logo-height: 44px;
    --header-height: 72px;
    --header-gutter: 1.25rem;

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    padding: 0.875rem 0;
    min-height: var(--header-height);
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease,
                padding 0.3s ease, min-height 0.3s ease;
}

/* Gutters responsivos alinhados com o .site-header-inner. */
@media (min-width: 1024px) {
    .site-header {
        --header-gutter: 3rem;
    }
}

.site-header--sticky,
.site-header--scrolled {
    background: rgba(250, 248, 245, 0.97);
    backdrop-filter: blur(var(--booking-blur, 12px));
    -webkit-backdrop-filter: blur(var(--booking-blur, 12px));
    box-shadow: 0 1px 0 var(--border-subtle, #eae6df);
}

/* Estado sobre o hero (imagem escura por baixo): fundo transparente e
   texto claro para garantir legibilidade do logo e do botão de consulta. */
.site-header--over-hero:not(.site-header--sticky) {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

.site-header--over-hero:not(.site-header--sticky) .site-title,
.site-header--over-hero:not(.site-header--sticky) .site-title a {
    color: #ffffff;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

/* Logo sobre hero: fundo suave para manter o logo legível sobre a imagem. */
.site-header--over-hero:not(.site-header--sticky) .site-branding .custom-logo {
    filter: drop-shadow(0 1px 12px rgba(0, 0, 0, 0.45));
}

/* Esconde ao descer, revela ao subir */
.site-header.is-hidden {
    transform: translateY(-100%);
    pointer-events: none;
}

/* O header é o containing block do painel do formulário; ao sair do ecrã
   o painel perde utilidade e o ponteiro deve ser libertado. */
.site-header.is-hidden .radha-header-booking__panel {
    pointer-events: none;
}

/* O header mantém a MESMA altura em todos os estados de scroll.
   Reduzir min-height no estado sticky provoca um salto do conteúdo e
   reposiciona o painel do formulário a meio do scroll. */
.site-header--sticky {
    padding: 1rem 0;
    min-height: 72px;
}

/* --------------------------------------------------------------------------
   2. BRANDING
   -------------------------------------------------------------------------- */
.site-branding {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    z-index: 10;
}

.site-branding {
    align-items: center;
}

.site-branding .custom-logo {
    max-height: var(--header-logo-height, 44px);
    width: auto;
    display: block;
    transition: max-height 0.3s ease;
}

.site-title {
    font-size: 1.375rem;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text-primary, #1a1a1a);
    transition: font-size 0.3s ease, color 0.3s ease;
}

.site-title a {
    color: inherit;
    text-decoration: none;
}

.site-description {
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-secondary, #666666);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Redução suave do logo no estado sticky (apenas visual, sem alterar altura) */
.site-header--sticky .site-branding .custom-logo { max-height: 40px; }
.site-header--sticky .site-description { display: none; }
.site-header--sticky .site-branding img { max-height: 36px; }
.site-header--sticky .site-title { font-size: 1.125rem; }

/* --------------------------------------------------------------------------
   3. NAVEGAÇÃO PRINCIPAL
   -------------------------------------------------------------------------- */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.primary-menu-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-menu-list li {
    position: relative;
}

.primary-menu-list a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
    text-decoration: none;
    border-radius: 2px;
    transition: color 0.2s ease, background 0.2s ease;
}

.primary-menu-list a:hover,
.primary-menu-list .current-menu-item > a {
    color: var(--accent-color, #8c7a6b);
    background: rgba(140, 122, 107, 0.08);
}

/* Sub-menus */
.primary-menu-list .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    padding: 0.5rem 0;
    margin: 0;
    list-style: none;
    background: #ffffff;
    border: 1px solid var(--border-subtle, #eae6df);
    border-radius: 4px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

.primary-menu-list li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.primary-menu-list .sub-menu a {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.primary-menu-list .sub-menu a:hover {
    background: var(--bg-color, #faf8f5);
    color: var(--accent-color, #8c7a6b);
}

/* O off-canvas gere a navegação até 1023px */
@media (max-width: 1023px) {
    .main-navigation {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   4. AÇÕES DO HEADER (botão de consulta + espaço do menu-toggle)
   -------------------------------------------------------------------------- */
.site-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    /* O padding-right que aqui existia reservava espaco para o .menu-toggle
       flutuante. Como o botao passou a estar na mesma flex row, ja nao e
       necessario e provocava um desvio extra a direita. */
}

/* Mini-cart */
.site-mini-cart .hb-mini-cart {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-color, #faf8f5);
    border: 1px solid var(--border-subtle, #eae6df);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.site-mini-cart .hb-mini-cart:hover {
    border-color: var(--accent-color, #8c7a6b);
}

.site-mini-cart .hb-mini-cart-icon {
    width: 24px;
    height: 24px;
    stroke: var(--text-primary, #1a1a1a);
}

.site-mini-cart .hb-mini-cart-count {
    background: var(--accent-color, #8c7a6b);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    min-width: 1.5rem;
    text-align: center;
}

.site-mini-cart .hb-mini-cart-total {
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
}

/* --------------------------------------------------------------------------
   5. MENU TOGGLE — Standalone, Fixed Top Right
   -------------------------------------------------------------------------- */
/*
 * O botão passou a viver dentro de .site-header-inner, pelo que já não é
 * posicionado de forma absoluta: alinha-se naturalmente na mesma flex row do
 * logo e do botão de consulta. A altura é partilhada com o botão de consulta
 * (--header-control-height) para que ambos fiquem perfeitamente na mesma linha.
 */
.menu-toggle {
    flex: 0 0 auto;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--header-control-height, 40px);
    height: var(--header-control-height, 40px);
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-subtle, #eae6df);
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.menu-toggle:hover {
    background: rgba(140, 122, 107, 0.08);
    border-color: var(--accent-color, #8c7a6b);
}

.menu-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(140, 122, 107, 0.4);
    border-color: var(--accent-color, #8c7a6b);
}

.menu-toggle[aria-expanded="true"] {
    background: var(--text-primary, #1a1a1a);
    border-color: var(--text-primary, #1a1a1a);
}

/* Sobre o hero (imagem escura): o botão e as barras passam a claros. */
.site-header--over-hero:not(.site-header--sticky) .menu-toggle {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.5);
}

.site-header--over-hero:not(.site-header--sticky) .menu-toggle-icon,
.site-header--over-hero:not(.site-header--sticky) .menu-toggle-icon::before,
.site-header--over-hero:not(.site-header--sticky) .menu-toggle-icon::after {
    background: #ffffff;
}

.menu-toggle-icon {
    position: relative;
    width: 22px;
    height: 2px;
    background: var(--text-primary, #1a1a1a);
    border-radius: 2px;
    transition: background 0.2s ease;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text-primary, #1a1a1a);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), top 0.3s ease, bottom 0.3s ease;
}

.menu-toggle-icon::before { top: -7px; }
.menu-toggle-icon::after  { bottom: -7px; }

.menu-toggle[aria-expanded="true"] .menu-toggle-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon::after  { bottom: 0; transform: rotate(-45deg); }

.menu-toggle:active .menu-toggle-icon { transform: scale(0.95); }

/* --------------------------------------------------------------------------
   5.1 RESPONSIVO — ALINHAMENTO E TAMANHOS
   -------------------------------------------------------------------------- */

/* Ecrãs médios: o texto do botão de consulta deixa de caber comfortavelmente
   junto ao logo e ao menu-toggle, por isso reduz-se. */
@media (max-width: 900px) {
    .site-header {
        --header-control-height: 38px;
        --header-logo-height: 40px;
        --header-gutter: 1.5rem;
    }

    /* .site-header-inner é uma GRELHA (1fr auto 1fr): o espaçamento entre as
       três colunas é column-gap, não gap. */
    .site-header-inner {
        column-gap: 0.5rem;
    }

    .radha-header-booking__toggle {
        padding: 0 0.875rem;
    }
}

/* Tablets e telemóveis: o botão de consulta fica só com o ícone, para que o
   menu-toggle, o logo e o ícone de busca caibam na mesma linha sem espremer
   nenhum deles. O aria-label garante a acessibilidade. */
@media (max-width: 640px) {
    .site-header {
        --header-control-height: 36px;
        --header-logo-height: 36px;
        --header-height: 64px;
        --header-gutter: 1rem;
        padding: 0.75rem 0;
    }

    .site-header-inner {
        min-height: 44px;
        column-gap: 0.5rem;
    }

    .site-header--sticky .site-header-inner {
        min-height: 44px;
    }

    .radha-header-booking__toggle {
        width: var(--header-control-height, 36px);
        min-width: var(--header-control-height, 36px);
        padding: 0;
    }

    .radha-header-booking__toggle-text {
        display: none;
    }

    .site-title {
        font-size: 1.125rem;
    }
}

/* Em ecrãs muito estreitos o logo cede espaço aos controlos, mas nunca
   desaparece — a marca continua identificável. */
@media (max-width: 380px) {
    .site-header {
        --header-control-height: 34px;
        --header-logo-height: 32px;
    }

    .site-title {
        font-size: 1rem;
    }
}

/* --------------------------------------------------------------------------
   6. ACESSIBILIDADE — REDUÇÃO DE MOVIMENTO
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .site-header,
    .site-header .site-title,
    .site-header .custom-logo,
    .menu-toggle,
    .menu-toggle-icon,
    .menu-toggle-icon::before,
    .menu-toggle-icon::after,
    .primary-menu-list .sub-menu {
        transition: none !important;
        animation: none !important;
    }
}

/* --------------------------------------------------------------------------
   6.1 PAINEL DE BUSCA DE DISPONIBILIDADE (variante radhacore1)
   -------------------------------------------------------------------------- */
.radha-header-booking__toggle {
    flex: 0 0 auto;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--header-control-height, 40px);
    height: var(--header-control-height, 40px);
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-subtle, #eae6df);
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, width 0.2s ease, padding 0.2s ease;
}

/* Quando o texto do toggle está visível (telas maiores que 640px),
   ajusta a largura do botão para acomodar ícone + texto */
@media (min-width: 641px) {
    .radha-header-booking__toggle {
        width: auto;
        min-width: var(--header-control-height, 40px);
        padding: 0 0.875rem;
        height: auto;
        min-height: var(--header-control-height, 40px);
    }
}

.radha-header-booking__toggle:hover {
    background: rgba(140, 122, 107, 0.08);
    border-color: var(--accent-color, #8c7a6b);
}

.radha-header-booking__toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(140, 122, 107, 0.4);
    border-color: var(--accent-color, #8c7a6b);
}

.radha-header-booking__toggle[aria-expanded="true"] {
    background: var(--text-primary, #1a1a1a);
    border-color: var(--text-primary, #1a1a1a);
}

.radha-header-booking__toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    flex-shrink: 0;
}

.radha-header-booking__toggle-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
    margin-left: 0.5rem;
    white-space: nowrap;
}

.radha-header-booking__toggle[aria-expanded="true"] .radha-header-booking__toggle-text {
    color: #ffffff;
}

.radha-header-booking__toggle svg {
    stroke: var(--text-primary, #1a1a1a);
}

.radha-header-booking__toggle[aria-expanded="true"] svg {
    stroke: #ffffff;
}

/* Painel drop-down do formulário de busca */
.radha-header-booking__panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: #ffffff;
    border: 1px solid var(--border-subtle, #eae6df);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    padding: 1rem;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 150;
}

.radha-header-booking__toggle[aria-expanded="true"] + .radha-header-booking__panel,
.radha-header-booking__panel.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Sobre o hero: ajustes de cor para o toggle */
.site-header--over-hero:not(.site-header--sticky) .radha-header-booking__toggle {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.5);
}

.site-header--over-hero:not(.site-header--sticky) .radha-header-booking__toggle svg {
    stroke: #ffffff;
}

.site-header--over-hero:not(.site-header--sticky) .radha-header-booking__toggle-text {
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   7. BUSCA PADRÃO DO WORDPRESS (quando não há quartos cadastrados)
   -------------------------------------------------------------------------- */
.radha-header-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.radha-header-search__input {
    width: 0;
    min-width: 0;
    padding: 0 0.875rem;
    height: var(--header-control-height, 40px);
    border: 1px solid var(--border-subtle, #eae6df);
    border-radius: 6px;
    background: var(--bg-color, #faf8f5);
    color: var(--text-primary, #1a1a1a);
    font-size: 0.875rem;
    transition: width 0.3s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
}

.radha-header-search.is-active .radha-header-search__input {
    width: 180px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    border-color: var(--accent-color, #8c7a6b);
    box-shadow: 0 0 0 3px rgba(140, 122, 107, 0.1);
    outline: none;
}

.radha-header-search.is-active .radha-header-search__input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(140, 122, 107, 0.4);
}

.radha-header-search__submit {
    width: var(--header-control-height, 40px);
    height: var(--header-control-height, 40px);
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-subtle, #eae6df);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary, #1a1a1a);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radha-header-search__submit:hover {
    background: rgba(140, 122, 107, 0.08);
    border-color: var(--accent-color, #8c7a6b);
}

.radha-header-search__submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(140, 122, 107, 0.4);
    border-color: var(--accent-color, #8c7a6b);
}

.radha-header-search__submit svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-primary, #1a1a1a);
}

/* Sobre o hero: ajustes de cor para o campo de busca */
.site-header--over-hero:not(.site-header--sticky) .radha-header-search__input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.site-header--over-hero:not(.site-header--sticky) .radha-header-search.is-active .radha-header-search__input {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.site-header--over-hero:not(.site-header--sticky) .radha-header-search__submit {
    border-color: rgba(255, 255, 255, 0.3);
}

.site-header--over-hero:not(.site-header--sticky) .radha-header-search__submit:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #ffffff;
}

.site-header--over-hero:not(.site-header--sticky) .radha-header-search__submit svg {
    stroke: #ffffff;
}

/* Mobile: o campo de busca expande para ocupar o espaço disponível */
@media (max-width: 640px) {
    .radha-header-search.is-active .radha-header-search__input {
        width: 140px;
    }
}

/* --------------------------------------------------------------------------
   8. BARRA DE BUSCA SEMPRE VISÍVEL (header)
   -------------------------------------------------------------------------- */

.radha-header-search-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    min-width: 0;
}

/* Garante que o wrapper de busca não seja esmagado pela grelha do header
   (booking.css define .site-header-inner como display: grid). */
.site-header-inner .radha-header-search-wrapper {
    min-width: 0;
    max-width: 100%;
}

/* Sobrescreve eventuais regras de booking.css que possam afetar o novo wrapper */
.radha-header-search-wrapper .hotel-booking-search,
.radha-header-search-wrapper .radha-booking-form--header,
.radha-header-search-wrapper .radha-search-form-static {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    max-width: none !important;
}

/* Container do formulário v2 em variante header */
.radha-header-search-wrapper .hotel-booking-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
}

.radha-header-search-wrapper .radha-form-table {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    background: none;
    border: none;
    box-shadow: none;
}

.radha-header-search-wrapper .radha-form-field {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
}

.radha-header-search-wrapper .radha-form-field label {
    display: none;
}

.radha-header-search-wrapper .radha-input-wrapper {
    display: flex;
    align-items: center;
}

.radha-header-search-wrapper .radha-date-input {
    width: 130px;
    padding: 0 0.875rem;
    height: var(--header-control-height, 40px);
    border: 1px solid var(--border-subtle, #eae6df);
    border-radius: 6px;
    background: var(--bg-color, #faf8f5);
    color: var(--text-primary, #1a1a1a);
    font-size: 0.875rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    /* Sobrescreve background hardcoded em booking.css */
    background: var(--bg-color, #faf8f5) !important;
}

.radha-header-search-wrapper .radha-date-input::placeholder {
    color: var(--text-secondary, #666666);
    opacity: 0.7;
}

.radha-header-search-wrapper .radha-date-input:focus {
    outline: none;
    border-color: var(--accent-color, #8c7a6b);
    box-shadow: 0 0 0 3px rgba(140, 122, 107, 0.1);
}

.radha-header-search-wrapper .radha-submit--header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.radha-header-search-wrapper .radha-btn--static,
.radha-header-search-wrapper .wphb-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    height: var(--header-control-height, 40px);
    background: var(--accent-color, #8c7a6b);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
    text-decoration: none;
    justify-content: center;
    /* Sobrescreve regras de booking.css */
    background: var(--accent-color, #8c7a6b) !important;
    color: #ffffff !important;
}

.radha-header-search-wrapper .radha-btn--static:hover,
.radha-header-search-wrapper .wphb-button:hover {
    background: var(--accent-color, #8c7a6b);
    opacity: 0.9;
}

.radha-header-search-wrapper .radha-btn--static:active,
.radha-header-search-wrapper .wphb-button:active {
    transform: scale(0.97);
}

.radha-header-search-wrapper .radha-btn--static svg,
.radha-header-search-wrapper .wphb-button svg {
    stroke: #ffffff;
    width: 16px;
    height: 16px;
}

/* Busca padrão do WordPress (quando não há quartos cadastrados) — sempre visível */
.radha-header-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.radha-header-search__input {
    width: 180px !important;
    min-width: 120px !important;
    padding: 0 0.875rem;
    height: var(--header-control-height, 40px);
    border: 1px solid var(--border-subtle, #eae6df);
    border-radius: 6px;
    background: var(--bg-color, #faf8f5);
    color: var(--text-primary, #1a1a1a);
    font-size: 0.875rem;
    transition: width 0.3s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

.radha-header-search__input:focus {
    outline: none;
    border-color: var(--accent-color, #8c7a6b);
    box-shadow: 0 0 0 3px rgba(140, 122, 107, 0.1);
}

/* Garante que o input de busca seja visível na home (sobrescreve regras antigas) */
body.home .radha-header-search__input,
body.front-page .radha-header-search__input,
body.blog .radha-header-search__input {
    width: 180px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    background: var(--bg-color, #faf8f5) !important;
    color: var(--text-primary, #1a1a1a) !important;
}

body.home .site-header--over-hero:not(.site-header--sticky) .radha-header-search__input,
body.front-page .site-header--over-hero:not(.site-header--sticky) .radha-header-search__input {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
}

body.home .site-header--over-hero:not(.site-header--sticky) .radha-header-search__input::placeholder,
body.front-page .site-header--over-hero:not(.site-header--sticky) .radha-header-search__input::placeholder {
    color: rgba(255, 255, 255, 0.75) !important;
}

.radha-header-search__submit {
    width: var(--header-control-height, 40px);
    height: var(--header-control-height, 40px);
    padding: 0;
    background: var(--accent-color, #8c7a6b);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.radha-header-search__submit:hover {
    background: var(--accent-color, #8c7a6b);
    opacity: 0.9;
}

.radha-header-search__submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(140, 122, 107, 0.4);
}

.radha-header-search__submit svg {
    width: 18px;
    height: 18px;
    stroke: #ffffff;
}

/* Sobre o hero — ajustes de cor para a barra de busca */
.site-header--over-hero:not(.site-header--sticky) .radha-header-search__input {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.site-header--over-hero:not(.site-header--sticky) .radha-header-search__input::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

.site-header--over-hero:not(.site-header--sticky) .radha-header-search__input:focus {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.site-header--over-hero:not(.site-header--sticky) .radha-header-search__submit {
    background: #ffffff;
    color: var(--text-primary, #1a1a1a);
}

.site-header--over-hero:not(.site-header--sticky) .radha-header-search__submit svg {
    stroke: var(--text-primary, #1a1a1a);
}

.site-header--over-hero:not(.site-header--sticky) .radha-header-search__submit:hover {
    background: #ffffff;
    opacity: 0.95;
}

/* Garante visibilidade da busca na home (header sobre o hero) */
body.home .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper,
body.front-page .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper {
    opacity: 1;
    visibility: visible;
}

body.home .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-date-input,
body.front-page .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-date-input {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

body.home .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-date-input::placeholder,
body.front-page .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-date-input::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

body.home .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-date-input:focus,
body.front-page .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-date-input:focus {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

body.home .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-btn--static,
body.front-page .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-btn--static,
body.home .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .wphb-button,
body.front-page .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .wphb-button {
    background: #ffffff;
    color: var(--text-primary, #1a1a1a);
}

body.home .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-btn--static svg,
body.front-page .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-btn--static svg,
body.home .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .wphb-button svg,
body.front-page .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .wphb-button svg {
    stroke: var(--text-primary, #1a1a1a);
}

/* Sobre o hero — ajustes para o formulário v2 */
.site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-date-input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-date-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-date-input:focus {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-btn--static,
.site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .wphb-button {
    background: #ffffff;
    color: var(--text-primary, #1a1a1a);
}

.site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-btn--static svg,
.site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .wphb-button svg {
    stroke: var(--text-primary, #1a1a1a);
}

/* Garante visibilidade dos inputs de busca na home (sobrescreve regras antigas) */
body.home .radha-header-search-wrapper .radha-date-input,
body.front-page .radha-header-search-wrapper .radha-date-input {
    width: 130px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    background: var(--bg-color, #faf8f5) !important;
    color: var(--text-primary, #1a1a1a) !important;
    border: 1px solid var(--border-subtle, #eae6df) !important;
}

body.home .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-date-input,
body.front-page .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-date-input {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
}

body.home .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-date-input::placeholder,
body.front-page .site-header--over-hero:not(.site-header--sticky) .radha-header-search-wrapper .radha-date-input::placeholder {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Mobile: ajustes para a barra de busca */
@media (max-width: 640px) {
    .radha-header-search-wrapper .radha-date-input {
        width: 110px;
    }

    .radha-header-search__input {
        width: 140px;
    }

    .radha-header-search-wrapper .radha-btn--static,
    .radha-header-search-wrapper .wphb-button {
        padding: 0 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .radha-header-search-wrapper .radha-date-input {
        width: 90px;
    }

    .radha-header-search__input {
        width: 120px;
    }
}

/* --------------------------------------------------------------------------
   9. ESTADO "SEM QUARTOS CADASTRADOS" — arquivo de quartos
   -------------------------------------------------------------------------- */

.radha-no-rooms {
    text-align: center;
    padding: 4rem 1rem;
    background: var(--bg-color, #faf8f5);
    border: 1px solid var(--border-subtle, #eae6df);
    border-radius: 8px;
    margin: 2rem 0;
}

.radha-no-rooms p {
    color: var(--text-secondary, #666666);
    font-size: 1.125rem;
    margin: 0 0 1.5rem;
}

.radha-no-rooms .radha-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent-color, #8c7a6b);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.radha-no-rooms .radha-btn:hover {
    background: var(--accent-color, #8c7a6b);
    opacity: 0.9;
}
