/* ==========================================================================
   Componentes — verificação de idade, cookies, filtros, formulário, acordeão, lightbox
   ========================================================================== */

/* Verificação de idade (+18) */
.age-gate {
    position: fixed; inset: 0; z-index: 1000;
    display: grid; place-items: center; padding: 20px; overflow-y: auto;
    background: linear-gradient(rgba(26, 13, 7, 0.88), rgba(26, 13, 7, 0.95)), url("../img/desert.jpg") center / cover;
    color: var(--sand);
}
.age-gate__card {
    width: min(100%, 440px); padding: 36px 32px; text-align: center;
    border: 1px solid rgba(212, 174, 98, 0.25); border-radius: 28px; background: var(--cafe);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.age-gate__card[hidden] { display: none; }
.age-gate__logo { width: 150px; margin: 0 auto 22px; }
.age-gate h2 { font-size: 34px; font-weight: 600; margin-bottom: 14px; }
.age-gate h2 em { color: var(--orange); }
.age-gate p { color: rgba(246, 237, 224, 0.75); font-size: 14.5px; }
.age-gate__actions { display: flex; gap: 12px; margin: 24px 0 18px; }
.age-gate__actions .btn { flex: 1; padding-inline: 12px; }
.age-gate__legal { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(246, 237, 224, 0.12); font-size: 12px !important; }
.age-gate__legal a { color: var(--gold); }

/* Caixas de confirmação */
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; cursor: pointer; text-align: left; }
.check input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--dune); }
.check--light { color: rgba(246, 237, 224, 0.8); }
.check a { color: var(--gold); }
.age-gate .check { justify-content: center; }

/* Aviso de cookies */
.cookie-banner {
    position: fixed; left: 20px; bottom: 20px; z-index: 200;
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px;
    width: min(calc(100% - 40px), 620px); padding: 18px 22px;
    border-radius: 20px; background: var(--night); color: var(--sand);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4); font-size: 13.5px;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { flex: 1 1 260px; }
.cookie-banner a { color: var(--gold); }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Filtros (sabores e galeria) */
.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filter {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 0 18px;
    border: 1px solid rgba(42, 26, 16, 0.2); border-radius: 999px; background: var(--card);
    font: 700 13.5px/1 var(--font-sans); white-space: nowrap;
    transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
.filter:hover { border-color: var(--ink); }
.filter.is-active, .filter[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: var(--sand); }
.filter__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fam, var(--sand)); }
.filter__count { font-weight: 600; opacity: 0.6; }

/* Interruptor de formato */
.size-switch { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.28); }
.size-switch button {
    min-width: 64px; min-height: 40px; white-space: nowrap; padding: 0 16px; border: 0; border-radius: 999px;
    background: transparent; color: #fff; font: 800 13px/1 var(--font-sans);
    transition: background-color 0.25s, color 0.25s;
}
.size-switch button[aria-pressed="true"] { background: var(--card); color: var(--night); }

/* Acordeão */
.accordion__item { border-bottom: 1px solid rgba(42, 26, 16, 0.18); }
.accordion__item:first-child { border-top: 1px solid rgba(42, 26, 16, 0.18); }
.accordion__trigger {
    display: flex; justify-content: space-between; align-items: center; gap: 20px;
    width: 100%; min-height: 64px; padding: 16px 0; border: 0; background: none; text-align: left;
    font: 600 19px/1.3 var(--font-serif);
}
.accordion__icon {
    display: grid; place-items: center; flex: none;
    width: 32px; height: 32px; border-radius: 50%; background: rgba(42, 26, 16, 0.08);
}
.accordion__icon .icon:last-child, .accordion__trigger[aria-expanded="true"] .icon:first-child { display: none; }
.accordion__trigger[aria-expanded="true"] .icon:last-child { display: block; }
.accordion__trigger[aria-expanded="true"] .accordion__icon { background: var(--night); color: var(--sand); }
.accordion__panel { padding: 0 52px 22px 0; color: var(--ink-2); }

/* Formulário de contacto */
.contact-form {
    display: grid; gap: 18px; padding: clamp(24px, 3vw, 36px);
    border-radius: 28px; background: var(--cafe); color: var(--sand);
}
.contact-form h3 { font-size: 26px; }
.subjects { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.subjects legend { margin-bottom: 8px; font: 700 12px/1 var(--font-sans); color: rgba(246, 237, 224, 0.7); padding: 0; }
.subject { position: relative; }
.subject input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.subject span {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
    border: 1px solid rgba(246, 237, 224, 0.25); border-radius: 999px;
    font: 700 13px/1 var(--font-sans); transition: background-color 0.2s, color 0.2s;
}
.subject input:checked + span { background: var(--dune); border-color: var(--dune); color: var(--night); }
.subject input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font: 700 12.5px/1.3 var(--font-sans); color: rgba(246, 237, 224, 0.75); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea {
    width: 100%; min-height: 48px; padding: 12px 14px;
    border: 1px solid rgba(246, 237, 224, 0.18); border-radius: var(--radius-field);
    background: rgba(255, 255, 255, 0.05); color: var(--sand);
}
.field textarea { resize: vertical; min-height: 130px; }
.field input::placeholder { color: rgba(246, 237, 224, 0.4); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--orange); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #ff8a73; }
.field__error { min-height: 0; color: #ffb3a3; font-size: 12.5px; font-weight: 600; }
.field__error:empty { display: none; }
.form-destination { font-size: 12.5px; color: rgba(246, 237, 224, 0.65); }
.form-destination strong { color: var(--sand); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-success {
    display: grid; align-content: center; justify-items: start; gap: 16px;
    min-height: 360px; padding: clamp(24px, 3vw, 40px);
    border-radius: 28px; background: var(--cafe); color: var(--sand);
}
.form-success[hidden], .contact-form[hidden] { display: none; }
.form-success p { color: rgba(246, 237, 224, 0.75); }
.form-success__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--dune); color: var(--night); }
.form-success h3 { font-size: 34px; }

/* Lightbox */
.lightbox {
    width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; padding: 0;
    border: 0; background: rgba(10, 5, 2, 0.94); color: var(--sand);
}
.lightbox[open] { display: grid; grid-template-columns: 72px 1fr 72px; align-items: center; }
.lightbox::backdrop { background: rgba(10, 5, 2, 0.9); }
.lightbox__figure { display: grid; justify-items: center; gap: 16px; min-width: 0; }
.lightbox__img { max-width: min(100%, 900px); max-height: 76vh; border-radius: 16px; object-fit: contain; }
.lightbox__placeholder { width: min(100%, 700px); aspect-ratio: 4 / 3; border-radius: 16px; }
.lightbox__img[hidden], .lightbox__placeholder[hidden] { display: none; }
.lightbox__caption { font: 600 16px/1.4 var(--font-serif); text-align: center; }
.lightbox__btn { display: grid; place-items: center; width: 52px; height: 52px; margin: auto; border: 1px solid rgba(246, 237, 224, 0.3); border-radius: 50%; background: transparent; color: inherit; }
.lightbox__btn:hover { background: rgba(246, 237, 224, 0.12); }
.lightbox__close { position: absolute; top: 16px; right: 16px; margin: 0; }

@media (max-width: 640px) {
    .lightbox[open] { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
    .lightbox__prev, .lightbox__next { position: absolute; bottom: 20px; }
    .lightbox__prev { left: calc(50% - 64px); }
    .lightbox__next { left: calc(50% + 12px); }
    .accordion__panel { padding-right: 0; }
}
