@layer components {
    .kicker {
        margin-bottom: .8rem;
        color: var(--sage-h);
        font-size: .75rem;
        font-weight: 700;
        letter-spacing: var(--tracking-kicker);
        text-transform: uppercase;
    }

    /* Pulsanti */
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-3);
        min-height: 52px;
        padding: 0 28px;
        border: 1px solid var(--sage-h);
        border-radius: var(--r-pill);
        background: var(--sage-h);
        color: var(--pure-white);
        box-shadow: var(--shadow-button);
        cursor: pointer;
        font: 650 .9rem var(--font-sans);
        text-decoration: none;
        transition: background-color .24s ease, color .24s ease, border-color .24s ease, box-shadow .24s ease;
    }

    .btn:hover {
        border-color: var(--pine);
        background: var(--pine);
        color: var(--pure-white);
        box-shadow: var(--shadow-button-hover);
    }

    .btn.out {
        border-color: rgba(255, 255, 255, .58);
        background: transparent;
        color: var(--pure-white);
        box-shadow: none;
    }

    .btn.out:hover {
        border-color: var(--pure-white);
        background: var(--overlay-light);
    }

    .light .btn.out,
    .reviews-section .btn.out,
    .btn.out.d {
        border-color: var(--sage-h);
        color: var(--pine);
    }

    .light .btn.out:hover,
    .reviews-section .btn.out:hover,
    .btn.out.d:hover {
        border-color: var(--pine);
        background: var(--pine);
        color: var(--pure-white);
    }

    .btn.red {
        border-color: var(--red);
        background: var(--red);
        color: var(--pure-white);
    }

    .btn.red:hover {
        border-color: var(--red-hover);
        background: var(--red-hover);
        color: var(--pure-white);
    }

    .btn.red:focus-visible {
        outline-color: var(--red-soft);
    }

    .btn.sm {
        min-height: 44px;
        padding-inline: 16px;
        font-size: var(--text-md);
    }

    /* Variante compatta nell'intestazione */
    .header-book {
        min-height: 44px;
        padding-inline: 18px;
        border-color: var(--sage-button);
        background: var(--sage-button);
        color: var(--pine-deep);
        font-size: var(--text-sm);
    }

    .header-book:hover {
        border-color: var(--sage-button-hover);
        background: var(--sage-button-hover);
        color: var(--pine-deep);
    }

    .chip {
        flex: none;
        min-height: 42px;
        padding: 0 17px;
        border: 1px solid #d0d6ce;
        border-radius: var(--r-pill);
        background: transparent;
        color: var(--pine);
        cursor: pointer;
        font: 600 var(--text-sm) var(--font-sans);
        transition: background-color .2s ease, color .2s ease, border-color .2s ease;
    }

    .chip:hover {
        border-color: var(--sage-h);
    }

    .chip[aria-pressed="true"] {
        border-color: var(--pine);
        background: var(--pine);
        color: var(--pure-white);
    }

    .filters {
        display: flex;
        gap: 8px;
        padding: 2px 0 22px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .filters::-webkit-scrollbar {
        display: none;
    }

    .menu-toolbar {
        display: flex;
        align-items: end;
        justify-content: space-between;
        gap: 20px;
        margin-bottom: 25px;
    }

    .menu-toolbar .filters {
        flex-wrap: wrap;
        padding-bottom: 0;
    }

    .menu-toolbar .chip {
        background: var(--white);
    }

    .menu-toolbar .chip[aria-pressed="true"] {
        border-color: var(--pine);
        background: var(--pine);
        color: var(--pure-white);
    }

    .menu-status {
        min-height: 1.5em;
        margin: -12px 0 8px;
        color: var(--mute);
        font-size: var(--text-md);
    }

    /* Campi dei moduli pubblici */
    .f {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .f .full {
        grid-column: 1 / -1;
    }

    .booking-card label {
        display: grid;
        align-content: start;
        gap: 6px;
        color: #d5ded7;
        font-size: .7rem;
        font-weight: 650;
        letter-spacing: .09em;
        text-transform: uppercase;
    }

    .booking-card :is(input, select, textarea) {
        width: 100%;
        min-height: 48px;
        padding: 12px 14px;
        border: 1px solid var(--border-form);
        border-radius: var(--r-form);
        background: var(--surface-form);
        color: var(--pure-white);
        font: inherit;
        font-size: 16px;
        letter-spacing: normal;
        text-transform: none;
    }

    .booking-card textarea {
        min-height: 76px;
        resize: vertical;
    }

    .booking-card :is(input, textarea)::placeholder {
        color: var(--text-placeholder);
    }

    .booking-card :is(input, textarea):focus {
        border-color: var(--sage-focus);
        outline: 3px solid rgba(182, 204, 189, .18);
    }

    .field-err {
        display: block;
        min-height: 0;
        color: var(--text-error-on-dark);
        font-size: .75rem;
        font-weight: 600;
        letter-spacing: 0;
        line-height: 1.35;
        text-transform: none;
    }

    .booking-card label.invalid :is(input, select, .date-trigger) {
        border: 2px solid var(--red-soft);
        background-color: var(--surface-form-invalid);
    }

    .err {
        min-height: 1.2em;
        color: var(--text-error-on-dark-soft);
        font-size: .85rem;
    }

    /* Campi chiari dell'area titolare */
    .light-f label {
        display: grid;
        gap: 6px;
        margin: 10px 0;
        color: var(--mute);
        font-size: .73rem;
        font-weight: 650;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .light-f :is(input, select, textarea),
    .admin-booking-filters :is(input, select) {
        width: 100%;
        min-height: 48px;
        padding: 12px 14px;
        border: 1px solid var(--border-soft);
        border-radius: var(--r-form);
        background: var(--pure-white);
        color: var(--ink);
        font: inherit;
        font-size: 16px;
        letter-spacing: normal;
        text-transform: none;
    }

    .light-f label.invalid :is(input, select) {
        border-color: var(--red-strong);
        background-color: var(--surface-error);
    }

    .light-f :is(input, select)[aria-invalid="true"] {
        border-color: var(--red-strong);
        background-color: var(--surface-error);
        box-shadow: 0 0 0 3px rgba(177, 61, 50, .13);
    }

    .light-f .err {
        color: var(--text-error);
    }

    .hint {
        color: var(--mute);
        font-size: var(--text-md);
        font-weight: 400;
        letter-spacing: 0;
        text-transform: none;
    }

    .menu-search {
        display: grid;
        flex: 0 1 270px;
        gap: 6px;
        min-width: 210px;
        color: var(--mute);
        font-size: .7rem;
        font-weight: 650;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .menu-search input {
        width: 100%;
        min-height: 46px;
        padding: 12px 14px;
        border: 1px solid var(--border-soft);
        border-radius: var(--r-form);
        background: var(--white);
        color: var(--ink);
        font: inherit;
        font-size: 16px;
        letter-spacing: normal;
        text-transform: none;
    }

    .menu-search input::placeholder {
        color: var(--text-placeholder);
    }

    /* Card */
    .card {
        padding: clamp(23px, 4vw, 40px);
        border: 1px solid rgba(255, 255, 255, .09);
        border-radius: var(--r);
        background: var(--pine);
        color: var(--text-on-dark);
        box-shadow: var(--contact-shadow);
    }

    .card .kicker {
        margin-bottom: 9px;
        color: var(--gold);
    }

    .card h3 {
        margin-bottom: 8px;
        color: var(--white);
        font-size: 2rem;
    }

    /* Stato e messaggi */
    .st {
        display: inline-block;
        padding: 4px 11px;
        border-radius: var(--r-pill);
        font-size: .75rem;
        font-weight: 750;
    }

    /* Calendario */
    .date-picker {
        position: relative;
    }

    .date-trigger {
        width: 100%;
        min-height: var(--select-min-height);
        padding: var(--select-padding);
        border: 1px solid var(--field-border);
        border-radius: var(--select-radius);
        background-color: var(--field-bg);
        color: var(--field-color);
        cursor: pointer;
        font: inherit;
        font-family: var(--select-font);
        font-size: var(--select-font-size);
        font-weight: var(--select-font-weight);
        text-align: left;
        transition: var(--transition-control);
    }

    .date-calendar {
        position: absolute;
        z-index: 20;
        top: calc(100% + 8px);
        left: 0;
        width: min(340px, calc(100vw - 54px));
        padding: 15px;
        border: 1px solid var(--border-light);
        border-radius: var(--r-md);
        background: var(--white);
        color: var(--pine);
        box-shadow: 0 18px 45px rgba(0, 0, 0, .25);
    }

    .date-calendar[hidden] {
        display: none;
    }

    .calendar-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 11px;
        text-transform: capitalize;
    }

    .calendar-nav,
    .calendar-day {
        display: grid;
        width: 38px;
        height: 38px;
        place-items: center;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: var(--pine);
        cursor: pointer;
        font: 600 .95rem var(--font-sans);
    }

    .calendar-nav:hover,
    .calendar-day:hover:not(:disabled) {
        background: #e8eee8;
    }

    .calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        justify-items: center;
        gap: 4px;
    }

    .calendar-weekdays {
        margin-bottom: 5px;
        color: var(--mute);
        font-size: var(--text-xs);
        font-weight: 700;
    }

    .calendar-day:disabled {
        color: #b8bdb8;
        cursor: not-allowed;
    }

    .calendar-day.closed:disabled {
        background: #f3e4df;
        color: #a64b40;
        text-decoration: line-through;
    }

    .calendar-day.partially-closed:not(:disabled) {
        box-shadow: inset 0 -2px 0 var(--gold);
    }

    .calendar-day.selected {
        background: var(--pine);
        color: var(--pure-white);
    }

    /* Select: native e personalizzate condividono font, misure, colori e stati */
    .booking-card {
        --field-bg: var(--surface-form);
        --field-bg-hover: var(--surface-form-hover);
        --field-border: var(--border-form);
        --field-border-hover: var(--sage-focus);
        --field-color: var(--pure-white);
        --field-chevron: var(--sage-arrow);
        --field-invalid-border: var(--red-soft);
        --field-invalid-bg: var(--surface-form-invalid);
        --field-invalid-ring: inset 0 0 0 1px var(--red-soft);
    }

    :is(.booking-card, .light-f, .admin-booking-filters) select,
    .custom-select-trigger {
        min-height: var(--select-min-height);
        padding: var(--select-padding);
        border: 1px solid var(--field-border);
        border-radius: var(--select-radius);
        background-color: var(--field-bg);
        color: var(--field-color);
        cursor: pointer;
        font: inherit;
        font-family: var(--select-font);
        font-size: var(--select-font-size);
        font-weight: var(--select-font-weight);
        letter-spacing: normal;
        text-transform: none;
        transition: var(--transition-control);
    }

    :is(.booking-card, .light-f, .admin-booking-filters) select {
        appearance: none;
        padding-right: var(--select-padding-end);
        background-image: linear-gradient(45deg, transparent 50%, var(--field-chevron) 50%),
            linear-gradient(135deg, var(--field-chevron) 50%, transparent 50%);
        background-position: calc(100% - 19px) 21px, calc(100% - 13px) 21px;
        background-repeat: no-repeat;
        background-size: 6px 6px;
    }

    :is(.booking-card, .light-f, .admin-booking-filters) select option {
        background: var(--select-panel-bg);
        color: var(--select-option-color);
        font-family: var(--select-font);
        font-size: var(--select-font-size);
        font-weight: var(--select-font-weight);
        letter-spacing: normal;
        text-transform: none;
    }

    :is(.booking-card, .light-f, .admin-booking-filters) select option:checked {
        background: var(--select-option-selected-bg);
        color: var(--select-option-selected-color);
    }

    .custom-select {
        position: relative;
        display: block;
        width: 100%;
        min-width: 0;
    }

    .custom-select > .custom-select-native {
        position: absolute;
        width: 1px;
        height: 1px;
        min-height: 0;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .custom-select-trigger {
        position: relative;
        display: block;
        width: 100%;
        padding-right: var(--select-padding-end);
        overflow: hidden;
        text-align: left;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .custom-select-trigger::after {
        position: absolute;
        top: 50%;
        right: 14px;
        width: 8px;
        height: 8px;
        margin-top: -4px;
        border-right: 2px solid var(--field-chevron);
        border-bottom: 2px solid var(--field-chevron);
        content: "";
        transform: translateY(-2px) rotate(45deg);
        transition: transform .18s ease;
    }

    .custom-select.is-open .custom-select-trigger::after {
        transform: translateY(2px) rotate(225deg);
    }

    :is(.booking-card, .light-f, .admin-booking-filters) select:hover:not(:disabled),
    .custom-select-trigger:hover:not(:disabled),
    .date-trigger:hover:not(:disabled),
    .custom-select.is-open .custom-select-trigger {
        border-color: var(--field-border-hover);
        background-color: var(--field-bg-hover);
    }

    :is(.booking-card, .light-f, .admin-booking-filters) select:focus-visible,
    .custom-select-trigger:focus-visible,
    .date-trigger:focus-visible {
        border-color: var(--field-border-hover);
        outline: var(--select-focus-width) solid var(--select-focus-color);
        outline-offset: var(--select-focus-offset);
    }

    :is(.booking-card, .light-f, .admin-booking-filters) select:disabled,
    .custom-select-trigger:disabled,
    .date-trigger:disabled {
        cursor: not-allowed;
        opacity: var(--select-disabled-opacity);
    }

    .custom-select .custom-select-trigger[aria-invalid="true"],
    :is(.booking-card, .light-f) label.invalid .custom-select-trigger {
        border-color: var(--field-invalid-border);
        background-color: var(--field-invalid-bg);
        box-shadow: var(--field-invalid-ring);
    }

    .custom-select-listbox {
        position: absolute;
        z-index: 35;
        top: calc(100% + 6px);
        right: 0;
        left: 0;
        max-height: var(--select-panel-max-height);
        padding: var(--select-panel-padding);
        overflow-y: auto;
        border: 1px solid var(--select-panel-border);
        border-radius: var(--select-panel-radius);
        background: var(--select-panel-bg);
        color: var(--select-option-color);
        box-shadow: var(--select-panel-shadow);
        font-family: var(--select-font);
        font-size: var(--select-font-size);
        font-weight: var(--select-font-weight);
        letter-spacing: normal;
        text-align: left;
        text-transform: none;
    }

    .custom-select-listbox[hidden] {
        display: none;
    }

    .custom-select.opens-up .custom-select-listbox {
        top: auto;
        bottom: calc(100% + 6px);
    }

    .custom-select-option {
        min-height: var(--select-option-min-height);
        padding: var(--select-option-padding);
        border-radius: var(--select-option-radius);
        color: var(--select-option-color);
        cursor: pointer;
        font-family: var(--select-font);
        font-size: var(--select-font-size);
        font-weight: var(--select-font-weight);
        letter-spacing: normal;
        line-height: 1.4;
        text-transform: none;
    }

    .custom-select-option[aria-selected="true"] {
        background: var(--select-option-selected-bg);
        color: var(--select-option-selected-color);
        font-weight: var(--select-option-selected-weight);
    }

    .custom-select-option.is-active:not([aria-disabled="true"]),
    .custom-select-option:hover:not([aria-disabled="true"]) {
        background: var(--select-option-hover-bg);
        color: var(--select-option-hover-color);
    }

    .custom-select-option[aria-disabled="true"] {
        opacity: var(--select-option-disabled-opacity);
        cursor: not-allowed;
    }

    /* Dialoghi */
    .adm-body dialog {
        width: min(520px, calc(100% - 28px));
        max-height: 90vh;
        margin: auto;
        padding: 24px;
        overflow: auto;
        border: 1px solid var(--border-card);
        border-radius: var(--r);
        background: var(--white);
        color: var(--ink);
        box-shadow: var(--shadow-booking);
    }

    .adm-body dialog::backdrop {
        background: rgba(11, 28, 23, .62);
        backdrop-filter: blur(4px);
    }

    /* Notifiche */
    .toast {
        position: fixed;
        z-index: 99;
        bottom: 90px;
        left: 50%;
        max-width: 92%;
        padding: 13px 22px;
        border: 1px solid rgba(255, 255, 255, .18);
        border-radius: var(--r-pill);
        background: var(--pine);
        color: var(--pure-white);
        font-size: .85rem;
        font-weight: 650;
        opacity: 0;
        pointer-events: none;
        transform: translate(-50%, 16px);
        transition: opacity .25s ease, transform .25s ease;
    }

    .toast.show {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    .toast.bad {
        background: #8e342d;
    }

    /* Contatto WhatsApp */
    .wa {
        position: fixed;
        z-index: 40;
        right: 22px;
        bottom: 22px;
        display: grid;
        align-items: center;
        justify-items: center;
        width: 56px;
        height: 56px;
        padding: 0;
        border: 1px solid var(--border-on-dark-medium);
        border-radius: 50%;
        background: var(--whatsapp);
        color: var(--pure-white);
        box-shadow: 0 10px 28px rgba(19, 58, 39, .24);
        text-decoration: none;
        transition: box-shadow .2s ease;
    }

    .wa-icon {
        width: 29px;
        height: 29px;
        fill: currentColor;
    }

    .wa:hover {
        box-shadow: 0 14px 30px rgba(19, 58, 39, .3);
    }
}
