/* HestiaHost frontend — wrapper + styles per Litepicker (light DOM) */
hh-booking-widget {
    display: block;
    margin: 20px 0;
    outline: none !important;
}

hh-booking-widget:focus,
hh-booking-widget:focus-visible,
hh-booking-widget:focus-within {
    outline: none !important;
    box-shadow: none !important;
}

.hh-shortcode-error {
    padding: 12px 16px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.hh-picker-anchor {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* Litepicker override — vive nel light DOM, non nel Shadow */
.litepicker {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 13px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    border-radius: 12px !important;
    z-index: 999999 !important;
    /* Evita overflow orizzontale fuori dal viewport su mobile. */
    max-width: calc(100vw - 16px) !important;
    box-sizing: border-box;
}

@media (max-width: 720px) {
    .litepicker .container__months {
        width: 100% !important;
        max-width: calc(100vw - 16px) !important;
    }
    .litepicker .container__months .month-item {
        width: 100% !important;
    }
}

.litepicker .container__days .day-item.is-booked,
.litepicker .container__days .day-item.is-blocked {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    text-decoration: line-through;
    pointer-events: none;
    cursor: not-allowed;
}

.litepicker .container__days .day-item.is-past {
    opacity: 0.3;
    pointer-events: none;
}

.litepicker .container__days .day-item.is-start-date,
.litepicker .container__days .day-item.is-end-date {
    background-color: #2563eb !important;
    color: #fff !important;
}

.litepicker .container__days .day-item.is-in-range {
    background-color: #dbeafe !important;
    color: #1e40af !important;
}

/* ─── Checkout Modal (light DOM) ─── */
body.hh-modal-open {
    overflow: hidden;
}

.hh-checkout-dialog {
    padding: 0;
    border: none;
    background: transparent;
    max-width: 560px;
    width: 90vw;
    max-height: 90vh;
    border-radius: var(--hh-radius, 12px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--hh-text, #1f2937);
}

.hh-checkout-dialog::backdrop {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
}

.hh-checkout-dialog[open] {
    animation: hh-modal-in 0.2s ease-out;
}

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

.hh-checkout-content {
    background: var(--hh-bg, #ffffff);
    color: var(--hh-text, #1f2937);
    border-radius: var(--hh-radius, 12px);
    padding: 28px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.hh-checkout-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--hh-muted, #6b7280);
    border-radius: 50%;
}

.hh-checkout-close:hover {
    background: #f3f4f6;
    color: var(--hh-text, #1f2937);
}

.hh-checkout-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 16px;
    padding-right: 40px;
}

.hh-checkout-summary {
    padding: 14px 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 20px;
}

.hh-checkout-accommodation {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.hh-checkout-dates {
    font-size: 14px;
    color: var(--hh-muted, #6b7280);
    display: flex;
    gap: 8px;
    align-items: center;
}

.hh-checkout-arrow {
    opacity: 0.5;
}

.hh-checkout-guests {
    font-size: 13px;
    color: var(--hh-muted, #6b7280);
    margin-top: 4px;
}

.hh-checkout-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.hh-checkout-section {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--hh-muted, #6b7280);
    letter-spacing: 0.05em;
    margin: 20px 0 10px;
}

.hh-checkout-field {
    margin-bottom: 12px;
}

.hh-checkout-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--hh-text, #1f2937);
    margin-bottom: 4px;
}

.hh-checkout-field input[type="text"],
.hh-checkout-field input[type="email"],
.hh-checkout-field input[type="tel"],
.hh-checkout-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--hh-border, #e5e7eb);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--hh-bg, #fff);
    color: var(--hh-text, #1f2937);
    box-sizing: border-box;
}

.hh-checkout-field input:focus,
.hh-checkout-field textarea:focus {
    outline: none;
    border-color: var(--hh-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.hh-checkout-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.hh-checkout-gateways {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.hh-gateway-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--hh-border, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.hh-gateway-option:hover {
    border-color: var(--hh-primary, #2563eb);
}

.hh-gateway-option input[type="radio"]:checked + .hh-gateway-label {
    font-weight: 600;
}

.hh-gateway-option:has(input[type="radio"]:checked) {
    border-color: var(--hh-primary, #2563eb);
    background: rgba(37, 99, 235, 0.04);
}

.hh-checkout-instructions {
    background: #fef3c7;
    color: #78350f;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    white-space: pre-wrap;
    margin-bottom: 16px;
}

.hh-checkout-totals {
    margin: 16px 0;
    padding-top: 12px;
    border-top: 1px solid var(--hh-border, #e5e7eb);
}

.hh-checkout-totals .hh-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
    color: var(--hh-muted, #6b7280);
}

.hh-checkout-totals .hh-summary-row.total {
    color: var(--hh-text, #1f2937);
    font-weight: 700;
    font-size: 16px;
    border-top: 1px solid var(--hh-border, #e5e7eb);
    padding-top: 8px;
    margin-top: 4px;
}

.hh-checkout-totals .hh-summary-row.deposit {
    color: var(--hh-primary, #2563eb);
    font-weight: 600;
}

.hh-terms {
    margin: 16px 0;
}

.hh-terms label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 13px;
    cursor: pointer;
}

.hh-checkout-submit {
    width: 100%;
    padding: 14px 20px;
    background: var(--hh-primary, #2563eb);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.hh-checkout-submit:hover:not(:disabled) {
    background: var(--hh-primary-hover, #1d4ed8);
}

.hh-checkout-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hh-checkout-success {
    text-align: center;
}

.hh-checkout-success .hh-checkout-title {
    text-align: center;
    padding-right: 0;
}

.hh-checkout-success .hh-success-totals {
    text-align: left;
    margin: 16px auto 20px;
    padding-top: 12px;
    border-top: 1px solid var(--hh-border, #e5e7eb);
    max-width: 360px;
}

.hh-checkout-success .hh-success-totals .hh-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
    color: var(--hh-muted, #6b7280);
}

.hh-checkout-success .hh-success-totals .hh-summary-row.total {
    color: var(--hh-text, #1f2937);
    font-weight: 700;
    font-size: 16px;
    border-top: 1px solid var(--hh-border, #e5e7eb);
    padding-top: 8px;
    margin-top: 4px;
}

.hh-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.hh-success-message {
    text-align: center;
    color: var(--hh-muted, #6b7280);
    margin-bottom: 20px;
}

.hh-success-reference {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

.hh-success-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--hh-muted, #6b7280);
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.hh-success-uuid {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 13px;
    word-break: break-all;
}

@media (max-width: 560px) {
    .hh-checkout-content {
        padding: 18px;
    }
    .hh-checkout-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .hh-checkout-title {
        font-size: 20px;
        margin: 0 0 12px;
    }
    .hh-checkout-summary {
        padding: 12px 14px;
        margin-bottom: 14px;
    }
    .hh-checkout-section {
        margin: 14px 0 6px;
    }
    .hh-checkout-field {
        margin-bottom: 8px;
    }
    .hh-checkout-field label {
        margin-bottom: 2px;
    }
    .hh-checkout-instructions {
        margin-bottom: 12px;
    }
    .hh-checkout-totals {
        margin: 12px 0;
        padding-top: 10px;
    }
    .hh-terms {
        margin: 12px 0;
    }
    .hh-checkout-gateways {
        margin-bottom: 12px;
    }
}

#hh-stripe-checkout-mount {
    margin-top: 16px;
    min-height: 400px;
}

.hh-checkout-stripe {
    max-height: 90vh;
    overflow-y: auto;
}

#hh-paypal-buttons-mount {
    margin-top: 20px;
    min-height: 200px;
}

.hh-checkout-paypal {
    max-height: 90vh;
    overflow-y: auto;
}

.hh-paypal-loading {
    text-align: center;
    color: var(--hh-muted, #6b7280);
    font-size: 13px;
    padding: 12px;
}

.hh-paypal-loading:has(~ #hh-paypal-buttons-mount:not(:empty)) {
    display: none;
}
