/* =====================================================
   Prenotazione WhatsApp v2 — Frontend Styles
   ===================================================== */

#prenota-wa-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(16, 11, 7, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#prenota-wa-overlay.pw-open {
    display: flex;
}

#prenota-wa-modal {
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    padding: 46px 42px 34px;
    border-radius: 18px;
    border: 1px solid rgba(127, 101, 74, 0.18);
    background: linear-gradient(180deg, #f8f3ec 0%, #f3ede4 100%);
    box-shadow: 0 28px 90px rgba(10, 8, 6, 0.35);
    animation: pw-in 0.28s cubic-bezier(0.34, 1.3, 0.64, 1);
    scrollbar-width: thin;
    scrollbar-color: #c8b59f transparent;
}

@keyframes pw-in {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

#prenota-wa-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(124, 100, 77, 0.18) !important;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45) !important;
    box-shadow: none !important;
    color: #8d7863;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background .2s, color .2s, transform .2s;
}

#prenota-wa-close:hover {
    background: rgba(255, 255, 255, 0.75) !important;
    color: #2f241a;
    transform: rotate(90deg);
}

.pw-header {
    text-align: center;
    margin-bottom: 30px;
}

.pw-header-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.pw-header-line {
    width: 42px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(123, 98, 73, 0.55), transparent);
}

.pw-header-monogram {
    color: #8f7457;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 12px;
    letter-spacing: 0.36em;
    text-transform: uppercase;
}

.pw-kicker {
    margin: 0 0 10px;
    color: #9a836c;
    font-family: sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.pw-header h2 {
    margin: 0 0 12px !important;
    padding: 0 !important;
    color: #2f241a !important;
    font-family: Fraunces, Georgia, "Times New Roman", serif !important;
    font-size: clamp(30px, 4vw, 40px) !important;
    font-weight: 300 !important;
    line-height: 1.05;
    letter-spacing: 0.01em;
}

.pw-intro {
    max-width: 420px;
    margin: 0 auto !important;
    color: #7f6a56;
    font-size: 14px;
    line-height: 1.7;
}

.pw-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.pw-field {
    margin-bottom: 18px;
}

#prenota-wa-form label {
    display: block !important;
    margin-bottom: 8px !important;
    color: #705b47 !important;
    font-family: sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
}

.pw-req {
    color: #a34f3d;
}

#prenota-wa-form input,
#prenota-wa-form select,
#prenota-wa-form textarea,
#prenota-wa-form .nice-select {
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 58px;
    margin: 0 !important;
    border: 1px solid #d8cab8 !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.88) !important;
    color: #2f241a !important;
    font-family: sans-serif !important;
    font-size: 15px !important;
    line-height: 1.4;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transition: border-color .2s, box-shadow .2s, background .2s !important;
}

#prenota-wa-form input,
#prenota-wa-form select,
#prenota-wa-form textarea {
    padding: 16px 18px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    outline: none !important;
}

#prenota-wa-form textarea {
    min-height: 130px;
    resize: vertical !important;
}

#prenota-wa-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.25L6 6.25L11 1.25' stroke='%237f6a56' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 18px center !important;
    padding-right: 42px !important;
    cursor: pointer !important;
}

#prenota-wa-form .nice-select {
    display: flex;
    align-items: center;
    float: none;
    padding: 0 18px;
    background: rgba(255, 255, 255, 0.88) !important;
}

#prenota-wa-form .nice-select .current {
    color: #2f241a !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    background: transparent !important;
}

#prenota-wa-form .nice-select:after {
    right: 20px;
    width: 8px;
    height: 8px;
    border-bottom: 1.5px solid #7f6a56;
    border-right: 1.5px solid #7f6a56;
}

#prenota-wa-form .nice-select .list {
    width: 100%;
    margin-top: 10px;
    max-height: min(280px, 48vh);
    border: 1px solid #d8cab8 !important;
    border-radius: 14px !important;
    background: #fcf8f2 !important;
    color: #2f241a !important;
    box-shadow: 0 18px 35px rgba(29, 20, 12, 0.14) !important;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#prenota-wa-form .nice-select .option {
    min-height: 44px;
    padding: 10px 16px;
    line-height: 24px;
    background: #fcf8f2 !important;
    color: #2f241a !important;
}

#prenota-wa-form .nice-select .option.selected,
#prenota-wa-form .nice-select .option:hover,
#prenota-wa-form .nice-select .option.focus {
    background: rgba(143, 116, 87, 0.11) !important;
    color: #2f241a !important;
}

#prenota-wa-form .nice-select,
#prenota-wa-form .nice-select span,
#prenota-wa-form .nice-select .current,
#prenota-wa-form .nice-select .list,
#prenota-wa-form .nice-select .option {
    color: #2f241a !important;
}

#prenota-wa-form .nice-select span,
#prenota-wa-form .nice-select .current {
    background: transparent !important;
}

#prenota-wa-form .nice-select .option.disabled,
#prenota-wa-form .nice-select .option:first-child {
    color: #9d8b79 !important;
    background: #f4ede4 !important;
}

#prenota-wa-form select:disabled,
#prenota-wa-form .nice-select.disabled {
    opacity: 0.58;
    cursor: not-allowed !important;
}

#prenota-wa-form input:focus,
#prenota-wa-form select:focus,
#prenota-wa-form textarea:focus,
#prenota-wa-form .nice-select.open,
#prenota-wa-form .nice-select:focus {
    border-color: #b69a79 !important;
    box-shadow: 0 0 0 4px rgba(182, 154, 121, 0.14) !important;
    background: #fff !important;
}

#prenota-wa-form input.pw-error,
#prenota-wa-form select.pw-error,
.pw-field.has-error .nice-select {
    border-color: #b35a48 !important;
    box-shadow: 0 0 0 4px rgba(179, 90, 72, 0.11) !important;
}

.pw-error-msg {
    display: none;
    margin-top: 6px;
    color: #b35a48;
    font-family: sans-serif;
    font-size: 11px;
}

.pw-field.has-error .pw-error-msg {
    display: block;
}

.pw-help {
    margin: 8px 2px 0;
    color: #8c7863;
    font-size: 12px;
    line-height: 1.65;
}

.pw-service-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pw-service-btn {
    min-height: 58px;
    border: 1px solid #d8cab8;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    color: #5a4635;
    font-family: sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: border-color .2s, background .2s, color .2s, transform .2s, box-shadow .2s;
}

.pw-service-btn:hover {
    transform: translateY(-1px);
    border-color: #b79a79;
}

.pw-service-btn.is-active {
    border-color: #8f7457;
    background: linear-gradient(180deg, rgba(143, 116, 87, 0.12) 0%, rgba(143, 116, 87, 0.2) 100%);
    color: #2f241a;
    box-shadow: 0 10px 22px rgba(64, 43, 25, 0.08);
}

.pw-service-btn.is-hidden {
    display: none;
}

.pw-service-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
}

#pw-chiuso-msg {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(179, 90, 72, 0.28);
    border-radius: 12px;
    background: rgba(179, 90, 72, 0.08);
    color: #8d4c3e;
    font-size: 13px;
    line-height: 1.6;
}

.pw-submit {
    width: 100% !important;
    margin-top: 10px !important;
    padding: 18px 22px !important;
    border: none !important;
    border-radius: 14px !important;
    background: var(--pw-accent, #38a3a5) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px !important;
    cursor: pointer !important;
    box-shadow: 0 20px 34px rgba(56, 163, 165, 0.24) !important;
    transition: transform .2s, box-shadow .2s, filter .2s !important;
}

.pw-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.04) !important;
    box-shadow: 0 24px 38px rgba(56, 163, 165, 0.28) !important;
}

.pw-submit:active {
    transform: translateY(0);
}

.pw-submit-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.pw-submit-top {
    display: block;
    opacity: 0.72;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.pw-submit-main {
    display: block;
    margin-top: 3px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.pw-submit svg {
    flex-shrink: 0;
}

.pw-notice {
    margin: 14px auto 0;
    max-width: 420px;
    color: #8d7863;
    text-align: center;
    font-size: 12px;
    line-height: 1.7;
}

@media (max-width: 640px) {
    #prenota-wa-modal {
        padding: 36px 20px 24px;
        border-radius: 16px;
    }

    .pw-row,
    .pw-service-switch {
        grid-template-columns: 1fr;
    }

    .pw-submit {
        padding: 16px 18px !important;
    }

    .pw-submit-main {
        font-size: 16px;
    }
}
