/* ==============================================
   InPuglia Booking Form - booking-form.css
   Envision Digital — v1.0.0
   ============================================== */

/* ---------- FORM WRAPPER ---------- */
.ipbf-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    background: #ffffff;
    padding: 20px 22px;
    border-radius: 8px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.10);
    font-family: 'Lato', 'Helvetica Neue', Arial, sans-serif;
    max-width: 960px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ---------- FIELDS ---------- */
.ipbf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 180px;
    min-width: 160px;
    box-sizing: border-box;
}

.ipbf-field-dates {
    flex: 2 1 260px;
}

.ipbf-field label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: #9a8060;
    margin: 0;
    padding: 0;
}

/* ---------- DATE TRIGGER ---------- */
.ipbf-date-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #f9f5ef;
    border: 1.5px solid #e4d9c8;
    border-radius: 6px;
    padding: 10px 13px;
    cursor: pointer;
    font-size: 13.5px;
    color: #333;
    transition: border-color .2s, box-shadow .2s;
    user-select: none;
    min-height: 42px;
    box-sizing: border-box;
}
.ipbf-date-trigger:hover,
.ipbf-date-trigger:focus {
    border-color: #c9a84c;
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
    outline: none;
}
.ipbf-date-trigger svg:first-child {
    flex-shrink: 0;
    color: #c9a84c;
}
.ipbf-date-trigger span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #555;
}
.ipbf-date-trigger span.has-dates {
    color: #2c2c2c;
    font-weight: 600;
}
.ipbf-chevron {
    color: #c9a84c;
    flex-shrink: 0;
    transition: transform .2s;
}
.ipbf-date-trigger.open .ipbf-chevron {
    transform: rotate(180deg);
}

/* ---------- SELECT WRAPPER ---------- */
.ipbf-select-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #f9f5ef;
    border: 1.5px solid #e4d9c8;
    border-radius: 6px;
    padding: 0 13px;
    transition: border-color .2s, box-shadow .2s;
    min-height: 42px;
    box-sizing: border-box;
}
.ipbf-select-wrap:focus-within {
    border-color: #c9a84c;
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}
.ipbf-select-wrap svg {
    flex-shrink: 0;
    color: #c9a84c;
}
.ipbf-select {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 13.5px;
    color: #2c2c2c;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding: 10px 0;
    font-family: inherit;
}
.ipbf-select:focus {
    outline: none;
}

/* ---------- SEARCH BUTTON ---------- */
.ipbf-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #c9a84c;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 11px 26px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    flex-shrink: 0;
    align-self: flex-end;
    min-height: 42px;
    font-family: inherit;
    box-shadow: 0 3px 12px rgba(201, 168, 76, 0.35);
}
.ipbf-btn:hover {
    background: #b8963e;
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(201, 168, 76, 0.45);
}
.ipbf-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.30);
}

/* ============================================================
   CALENDAR OVERLAY
   ============================================================ */
.ipbf-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 15, 5, 0.55);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.ipbf-overlay.active {
    display: flex;
}

/* Modal */
.ipbf-cal-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.22);
    padding: 28px 28px 22px;
    max-width: 700px;
    width: 100%;
    animation: ipbf-popIn .22s cubic-bezier(.34,1.4,.64,1);
    box-sizing: border-box;
}
@keyframes ipbf-popIn {
    from { opacity: 0; transform: translateY(16px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header modal */
.ipbf-cal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 22px;
}
.ipbf-cal-header-info h3 {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 800;
    color: #1e1e1e;
    font-family: 'Lato', sans-serif;
}
.ipbf-cal-hint {
    margin: 0;
    font-size: 12px;
    color: #c9a84c;
    font-weight: 600;
    min-height: 16px;
}
.ipbf-cal-close {
    background: #f5f0e8;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 20px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    flex-shrink: 0;
    margin-top: 2px;
}
.ipbf-cal-close:hover {
    background: #ecdfc4;
    color: #333;
}

/* Due colonne mesi */
.ipbf-cal-months {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

/* Mese singolo */
.ipbf-cal-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.ipbf-cal-month-title {
    font-weight: 800;
    font-size: 14px;
    color: #1e1e1e;
    text-transform: capitalize;
    font-family: 'Lato', sans-serif;
}
.ipbf-cal-nav {
    background: none;
    border: 1.5px solid #e4d9c8;
    cursor: pointer;
    color: #c9a84c;
    font-size: 18px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, border-color .15s;
    line-height: 1;
    font-family: inherit;
}
.ipbf-cal-nav:hover {
    background: #faf3e4;
    border-color: #c9a84c;
}
.ipbf-cal-nav.ipbf-invisible {
    visibility: hidden;
    pointer-events: none;
}

/* Griglia calendario */
.ipbf-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.ipbf-cal-dow {
    text-align: center;
    font-size: 10px;
    font-weight: 800;
    color: #c9a84c;
    text-transform: uppercase;
    padding: 3px 0 8px;
    letter-spacing: .07em;
}
.ipbf-cal-day {
    text-align: center;
    font-size: 13px;
    color: #2c2c2c;
    padding: 7px 2px;
    border-radius: 4px;
    cursor: pointer;
    transition: background .12s, color .12s;
    line-height: 1.3;
    font-family: 'Lato', sans-serif;
}
.ipbf-cal-day.empty {
    pointer-events: none;
}
.ipbf-cal-day.disabled {
    color: #d0c8bc;
    pointer-events: none;
}
.ipbf-cal-day:hover:not(.disabled):not(.empty) {
    background: #faf3e4;
    color: #b8963e;
}
.ipbf-cal-day.selected-start,
.ipbf-cal-day.selected-end {
    background: #c9a84c !important;
    color: #fff !important;
    font-weight: 700;
}
.ipbf-cal-day.in-range {
    background: #faf3e4;
    color: #8a6c2a;
    border-radius: 0;
}
.ipbf-cal-day.selected-start { border-radius: 4px 0 0 4px; }
.ipbf-cal-day.selected-end   { border-radius: 0 4px 4px 0; }
.ipbf-cal-day.selected-start.selected-end { border-radius: 4px; }
.ipbf-cal-day.today:not(.selected-start):not(.selected-end) {
    font-weight: 700;
    color: #c9a84c;
}

/* Azioni footer modal */
.ipbf-cal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #f0ebe0;
}
.ipbf-cal-cancel {
    background: none;
    border: 1.5px solid #e4d9c8;
    color: #777;
    border-radius: 6px;
    padding: 9px 20px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, color .15s;
    font-family: inherit;
}
.ipbf-cal-cancel:hover {
    border-color: #c9a84c;
    color: #c9a84c;
}
.ipbf-cal-apply {
    background: #c9a84c;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px 26px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .15s;
    font-family: inherit;
}
.ipbf-cal-apply:hover {
    background: #b8963e;
}
.ipbf-cal-apply:disabled {
    background: #d9c99a;
    cursor: not-allowed;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
    .ipbf-cal-months {
        grid-template-columns: 1fr;
    }
    .ipbf-cal-modal {
        padding: 20px 16px 16px;
        max-height: 90vh;
        overflow-y: auto;
    }
}

@media (max-width: 620px) {
    .ipbf-wrap {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }
    .ipbf-field,
    .ipbf-field-dates {
        flex: 1 1 100%;
        min-width: 100%;
    }
    .ipbf-btn {
        width: 100%;
        justify-content: center;
    }
}
