/* =====================================================================
   VNStays Hotel Booking Widget
   ===================================================================== */

/* ── Widget wrapper ──────────────────────────────────────────────── */
.vhb-widget {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    /* overflow: visible — needed so Flatpickr calendar is not clipped */
    overflow: visible;
    margin-top: 14px;
    font-family: inherit;
}

/* Round the price bar top corners to match widget border-radius */
.vhb-price-bar {
    border-radius: 8px 8px 0 0;
}

/* ── Room rate header ────────────────────────────────────────────── */
.vhb-price-bar {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.vhb-price-main {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color, #333);
    line-height: 1;
}

.vhb-price-strike {
    font-size: 13px;
    color: #bbb;
    text-decoration: line-through;
}

.vhb-price-unit {
    font-size: 12px;
    color: #999;
}

/* ── Form ────────────────────────────────────────────────────────── */
.vhb-form {
    padding: 14px 16px 16px;
}

/* ── Labels ──────────────────────────────────────────────────────── */
.vhb-lbl {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 5px;
    user-select: none;
}

/* ══════════════════════════════════════════════════════════════════
   DATES — 2 stacked rows
══════════════════════════════════════════════════════════════════ */
.vhb-dates {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}
.vhb-dates .vhb-input{
    padding-left: 40px;
        margin-bottom: 5px;
        box-shadow: unset !important;
    border-radius: 4px !important;
}
.vhb-date-field {
    width: 100%;
}

/* Flatpickr altInput (the visible pretty input) */
.vhb-date-field input.flatpickr-input.form-control,
.vhb-date-field input[type="text"].flatpickr-input {
    width: 100%;
    padding: 9px 12px 9px 38px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    color: #333;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") no-repeat 14px center;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.vhb-date-field input.flatpickr-input:focus {
    outline: none;
    border-color: var(--primary-color, #555);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.06);
}

/* Fallback for non-flatpickr browsers */
.vhb-input {
    width: 100%;
    padding: 9px 12px 9px 38px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    color: #333;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") no-repeat 14px center;
    box-sizing: border-box;
    cursor: pointer;
    font-family: inherit;
}

/* Hide the original (value-holding) input when altInput is active */
.vhb-date-field input.flatpickr-input[readonly]:not(.flatpickr-mobile):not([type="text"]) {
    display: none;
}

/* ── Flatpickr calendar custom colors ────────────────────────────── */
.flatpickr-calendar {
    font-family: inherit;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    z-index: 99999 !important; /* float above sidebar widgets */
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--primary-color, #333) !important;
    border-color: var(--primary-color, #333) !important;
}

.flatpickr-day.inRange {
    background: rgba(0,0,0,0.07) !important;
    border-color: transparent !important;
    box-shadow: -5px 0 0 rgba(0,0,0,0.07), 5px 0 0 rgba(0,0,0,0.07) !important;
}

.flatpickr-day:hover {
    background: rgba(0,0,0,0.06);
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--primary-color, #333);
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover,
.flatpickr-current-month input.cur-year:hover {
    background: rgba(0,0,0,0.05);
}

/* ══════════════════════════════════════════════════════════════════
   GUESTS — Rooms full width, Adults+Children side by side
══════════════════════════════════════════════════════════════════ */
.vhb-guests {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

/* Each row inside guests */
.vhb-guest-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Full-width row (Rooms) */
.vhb-guest-row--full {
    grid-template-columns: 1fr;
}

.vhb-guest-col {
    /* inherits from parent grid */
}

/* ── Counter control ─────────────────────────────────────────────── */
.vhb-counter {
    display: flex;
    align-items: stretch;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
    height: 36px;
}
.vhb-count-val{
    margin-bottom: 0px;
}
.vhb-btn-count {
    min-height: unset;
        margin-right: 0px;
    margin-bottom: 0px;
    flex: 0 0 34px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 18px;
    font-weight: 300;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
    padding: 0;
    user-select: none;
}

.vhb-btn-count:hover:not(:disabled) {
    background: var(--primary-color, #333);
    color: #fff;
}

.vhb-btn-count:disabled {
    opacity: 0.28;
    cursor: default;
}

.vhb-count-val {
        box-shadow: unset !important;
    border-top: unset !important;
    flex: 1;
    min-width: 0;
    text-align: center;
    border: none;
    border-left: 1px solid #e8e8e8;
    border-right: 1px solid #e8e8e8;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    background: #fff;
    padding: 0;
    -moz-appearance: textfield;
    appearance: textfield;
}

.vhb-count-val::-webkit-outer-spin-button,
.vhb-count-val::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ══════════════════════════════════════════════════════════════════
   PRICE SUMMARY
══════════════════════════════════════════════════════════════════ */
.vhb-summary {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 12px;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.vhb-summary-empty {
    width: 100%;
    text-align: center;
    font-size: 13px;
    color: #bbb;
    font-style: italic;
}

.vhb-summary-calc {
    width: 100%;
}

.vhb-calc-formula {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
    display: block;
}

.vhb-calc-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vhb-total-lbl {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

.vhb-total-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color, #333);
}

/* ── Error ───────────────────────────────────────────────────────── */
.vhb-error {
    background: #fff8f8;
    border: 1px solid #ffcdd2;
    border-radius: 5px;
    padding: 9px 12px;
    font-size: 13px;
    color: #b71c1c;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* ── Submit button ───────────────────────────────────────────────── */
.vhb-submit {
    display: block;
    width: 100%;
    padding: 13px 16px;
    background: var(--primary-color, #333);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    font-family: inherit;
}

.vhb-submit:hover:not(:disabled) {
    opacity: 0.85;
}

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

.vhb-submit.is-loading::after {
    content: '';
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-left: 8px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: middle;
    animation: vhb-spin 0.7s linear infinite;
}

@keyframes vhb-spin {
    to { transform: rotate(360deg); }
}

/* ── "Change dates / guests" edit link (shown in WC cart & checkout) ── */
.vhb-edit-booking-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary-color, #1E73BE);
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid currentColor;
    border-radius: 20px;
    transition: background 0.15s, color 0.15s;
    margin-top: 4px;
    white-space: nowrap;
}

.vhb-edit-booking-link:hover {
    background: var(--primary-color, #1E73BE);
    color: #fff;
}
