/* ── Nomadic Homestay Booking: Frontend ─────────────────────────────────── */

#nhb-booking-widget {
    margin: 20px 0;
    font-family: inherit;
}

#nhb-booking-widget .nhb-widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: #222;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0a500;
}

#nhb-booking-widget .nhb-season-notice {
    font-size: .78rem;
    color: #9ca3af;
    margin-bottom: 12px;
}

/* ── Slider container ───────────────────────────────────────────────────── */
#nhb-booking-widget .nhb-slider-outer {
    display: flex;
    align-items: center;
    gap: 8px;
}

#nhb-booking-widget .nhb-slider-viewport {
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

#nhb-booking-widget .nhb-slider-track {
    display: flex;
}

/* ── Single month ───────────────────────────────────────────────────────── */
#nhb-booking-widget .nhb-month {
    display: none;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    min-height: 300px;
    box-sizing: border-box;
}

#nhb-booking-widget .nhb-month--visible {
    display: flex;
}

#nhb-booking-widget .nhb-month-title {
    font-size: .95rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 12px;
    color: #111;
}

/* ── Day-of-week row ────────────────────────────────────────────────────── */
#nhb-booking-widget .nhb-dow-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

#nhb-booking-widget .nhb-cal-dow {
    text-align: center;
    font-size: .65rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 4px 0;
}

/* ── Day grid ───────────────────────────────────────────────────────────── */
#nhb-booking-widget .nhb-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    grid-auto-rows: minmax(32px, auto);
}

#nhb-booking-widget .nhb-cal-day {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    border-radius: 5px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    color: #374151;
    width: 100%;
    aspect-ratio: 1;
    transition: background .15s, color .15s;
    box-sizing: border-box;
}

#nhb-booking-widget .nhb-cal-day--empty         { cursor: default; aspect-ratio: auto; }
#nhb-booking-widget .nhb-cal-day--disabled      { color: #d1d5db; cursor: not-allowed; }
#nhb-booking-widget .nhb-cal-day--out-of-season { color: #d1d5db; cursor: not-allowed; background: #fafafa; }
#nhb-booking-widget .nhb-cal-day--blocked       { background: #fee2e2; color: #b91c1c; cursor: not-allowed; text-decoration: line-through; opacity: .75; }
#nhb-booking-widget .nhb-cal-day--today         { font-weight: 700; box-shadow: inset 0 0 0 1px #f0a500; }

#nhb-booking-widget .nhb-cal-day--available:hover {
    background: #fff3d0;
    color: #b37700;
}

#nhb-booking-widget .nhb-cal-day--start {
    background: #f0a500 !important;
    color: #fff !important;
    border-radius: 5px 0 0 5px;
}
#nhb-booking-widget .nhb-cal-day--end {
    background: #f0a500 !important;
    color: #fff !important;
    border-radius: 0 5px 5px 0;
}
#nhb-booking-widget .nhb-cal-day--start.nhb-cal-day--end {
    border-radius: 5px;
}
#nhb-booking-widget .nhb-cal-day--in-range {
    background: #fff3d0 !important;
    color: #7a5000 !important;
    border-radius: 0;
}

/* ── Nav buttons ────────────────────────────────────────────────────────── */
#nhb-booking-widget .nhb-cal-prev,
#nhb-booking-widget .nhb-cal-next {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    min-width: 34px;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #374151;
    transition: background .15s, border-color .15s;
    padding: 0;
}

#nhb-booking-widget .nhb-cal-prev:hover,
#nhb-booking-widget .nhb-cal-next:hover {
    background: #f0a500;
    color: #fff;
    border-color: #f0a500;
}

/* ── Legend ─────────────────────────────────────────────────────────────── */
#nhb-booking-widget .nhb-calendar-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

#nhb-booking-widget .nhb-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    color: #6b7280;
}

#nhb-booking-widget .nhb-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

#nhb-booking-widget .nhb-dot-available { background: #fff; border: 1px solid #d1d5db; }
#nhb-booking-widget .nhb-dot-selected  { background: #f0a500; }
#nhb-booking-widget .nhb-dot-blocked   { background: #fee2e2; border: 1px solid #fca5a5; }

#nhb-booking-widget .nhb-date-hint {
    font-size: .78rem;
    color: #9ca3af;
    margin: 8px 0 0;
    font-style: italic;
}

/* ── Selected dates display ──────────────────────────────────────────────── */
#nhb-booking-widget .nhb-dates-display {
    margin-top: 14px;
    padding: 12px 14px;
    background: #fffbf0;
    border: 1px solid #f0d080;
    border-radius: 8px;
    box-sizing: border-box;
}

#nhb-booking-widget .nhb-dates-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#nhb-booking-widget .nhb-date-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#nhb-booking-widget .nhb-date-box label {
    font-size: .68rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .04em;
}

#nhb-booking-widget .nhb-date-box span {
    font-size: .9rem;
    font-weight: 600;
    color: #111;
}

#nhb-booking-widget .nhb-date-arrow {
    font-size: 1rem;
    color: #f0a500;
}

#nhb-booking-widget .nhb-nights-box {
    margin-left: auto;
}

/* ── Booking bar ─────────────────────────────────────────────────────────── */
#nhb-booking-widget .nhb-booking-bar {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-sizing: border-box;
}

#nhb-booking-widget .nhb-field-group {
    margin-bottom: 14px;
}

#nhb-booking-widget .nhb-label {
    display: block;
    font-size: .7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px;
}

#nhb-booking-widget .nhb-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .9rem;
    background: #fff;
    color: #333;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: auto;
    appearance: auto;
}

#nhb-booking-widget .nhb-select:focus {
    outline: none;
    border-color: #f0a500;
    box-shadow: 0 0 0 2px rgba(240,165,0,.2);
}

#nhb-booking-widget .nhb-select-small {
    width: auto;
    min-width: 110px;
}

/* ── Price summary ───────────────────────────────────────────────────────── */
#nhb-booking-widget .nhb-price-summary {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}

#nhb-booking-widget .nhb-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 4px;
}

#nhb-booking-widget .nhb-price-label { font-size: .82rem; color: #6b7280; }
#nhb-booking-widget .nhb-price-total { font-size: 1rem; font-weight: 700; color: #111; }

#nhb-booking-widget .nhb-deposit-section {
    border-top: 1px dashed #e2e8f0;
    padding-top: 12px;
    margin-top: 8px;
}

#nhb-booking-widget .nhb-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#nhb-booking-widget .nhb-radio-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: .88rem;
    color: #374151;
    cursor: pointer;
    line-height: 1.4;
}

#nhb-booking-widget .nhb-radio-label input[type="radio"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: #f0a500;
}

#nhb-booking-widget .nhb-deposit-note {
    font-size: .76rem;
    color: #9ca3af;
    display: block;
    margin-top: 2px;
}

#nhb-booking-widget .nhb-charge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
    margin-top: 8px;
    font-size: .9rem;
    color: #374151;
    flex-wrap: wrap;
    gap: 4px;
}

#nhb-booking-widget .nhb-charge-row strong {
    font-size: 1.05rem;
    color: #b37700;
}

/* ── Message ─────────────────────────────────────────────────────────────── */
#nhb-booking-widget .nhb-message {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: .85rem;
    line-height: 1.4;
}

#nhb-booking-widget .nhb-message--error   { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
#nhb-booking-widget .nhb-message--success { background: #dcfce7; border: 1px solid #86efac; color: #166534; }

/* ── Book button ─────────────────────────────────────────────────────────── */
#nhb-booking-widget .nhb-book-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #f0a500;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
    transition: background .15s;
    text-align: center;
}

#nhb-booking-widget .nhb-book-btn:hover:not(:disabled) { background: #d49000; }
#nhb-booking-widget .nhb-book-btn:disabled             { background: #d1d5db; cursor: not-allowed; }
#nhb-booking-widget .nhb-book-btn.nhb-loading          { opacity: .7; pointer-events: none; }

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes nhbSlideRight { from { opacity:0; transform:translateX(24px); }  to { opacity:1; transform:translateX(0); } }
@keyframes nhbSlideLeft  { from { opacity:0; transform:translateX(-24px); } to { opacity:1; transform:translateX(0); } }

#nhb-booking-widget .nhb-slide-right { animation: nhbSlideRight .22s ease; }
#nhb-booking-widget .nhb-slide-left  { animation: nhbSlideLeft  .22s ease; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — tablet
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    #nhb-booking-widget .nhb-month {
        padding: 14px 10px;
    }

    #nhb-booking-widget .nhb-month-title {
        font-size: .88rem;
    }

    #nhb-booking-widget .nhb-cal-dow {
        font-size: .6rem;
        letter-spacing: 0;
    }

    #nhb-booking-widget .nhb-cal-day {
        font-size: .75rem;
    }

    #nhb-booking-widget .nhb-cal-prev,
    #nhb-booking-widget .nhb-cal-next {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 1.1rem;
    }

    #nhb-booking-widget .nhb-nights-box {
        margin-left: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — mobile
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    #nhb-booking-widget .nhb-month {
        padding: 10px 6px;
        min-height: 0;
        border-radius: 8px;
    }

    #nhb-booking-widget .nhb-month-title {
        font-size: .82rem;
        margin-bottom: 8px;
    }

    #nhb-booking-widget .nhb-calendar-grid {
        gap: 1px;
        grid-auto-rows: minmax(28px, auto);
    }

    #nhb-booking-widget .nhb-dow-row {
        gap: 1px;
    }

    #nhb-booking-widget .nhb-cal-dow {
        font-size: .55rem;
        padding: 2px 0;
    }

    #nhb-booking-widget .nhb-cal-day {
        font-size: .7rem;
        border-radius: 3px;
        aspect-ratio: auto;
        min-height: 26px;
    }

    #nhb-booking-widget .nhb-cal-prev,
    #nhb-booking-widget .nhb-cal-next {
        width: 26px;
        height: 26px;
        min-width: 26px;
        font-size: 1rem;
    }

    #nhb-booking-widget .nhb-slider-outer {
        gap: 4px;
    }

    #nhb-booking-widget .nhb-dates-row {
        gap: 8px;
    }

    #nhb-booking-widget .nhb-date-arrow {
        display: none;
    }

    #nhb-booking-widget .nhb-nights-box {
        margin-left: 0;
        width: 100%;
    }

    #nhb-booking-widget .nhb-booking-bar {
        padding: 12px 10px;
    }

    #nhb-booking-widget .nhb-select {
        font-size: .85rem;
    }

    #nhb-booking-widget .nhb-book-btn {
        font-size: .9rem;
        padding: 11px;
    }

    #nhb-booking-widget .nhb-calendar-legend {
        gap: 8px;
    }

    #nhb-booking-widget .nhb-legend-item {
        font-size: .68rem;
    }

    #nhb-booking-widget .nhb-price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    #nhb-booking-widget .nhb-charge-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    #nhb-booking-widget .nhb-radio-label {
        font-size: .82rem;
    }
}
