/**
 * wcdb-frontend.css
 *
 * Styles for the Date Booking widget on the product page.
 */

/* ── Force widget to full width so quantity/button go below ─────────────── */

form.cart {
    display: flex;
    flex-wrap: wrap;
}

.wcdb-booking-widget {
    flex: 0 0 100%;
    width: 100%;
    box-sizing: border-box;
    background: #fafafa;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    padding: 20px 24px;
    margin: 20px 0 20px;
}

form.cart .quantity,
form.cart .single_add_to_cart_button {
    flex: 0 0 auto;
}

/* ── Widget title ───────────────────────────────────────────────────────── */

.wcdb-widget-title {
    font-size: 1.1em;
    font-weight: 700;
    margin: 0 0 16px;
    color: #2c2c2c;
    border-bottom: 2px solid #7b2d2d;
    padding-bottom: 8px;
}

/* ── Two-column row ─────────────────────────────────────────────────────── */

.wcdb-fields-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.wcdb-field-date {
    flex: 1 1 220px;
    min-width: 0;
}

.wcdb-field-time {
    flex: 0 1 180px;
    min-width: 140px;
}

@media ( max-width: 600px ) {
    .wcdb-fields-row {
        flex-direction: column;
        gap: 12px;
    }
    .wcdb-field-date,
    .wcdb-field-time {
        flex: 0 0 100%;
        width: 100%;
    }
}

/* ── Field labels ───────────────────────────────────────────────────────── */

.wcdb-field {
    margin-bottom: 0;
}

.wcdb-field label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 5px;
    color: #444;
}

.wcdb-field label .required {
    color: #d63638;
    margin-left: 2px;
}

/* ── Date input ─────────────────────────────────────────────────────────── */

.wcdb-date-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 14px;
    border: 1px solid #ccc;
    border-radius: 24px;
    font-size: 0.95em;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wcdb-date-input:focus,
.wcdb-date-input:hover {
    border-color: #7b2d2d;
    outline: none;
    box-shadow: 0 0 0 2px rgba(123,45,45,0.15);
}

/* ── Time select ────────────────────────────────────────────────────────── */

.wcdb-time-select {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 32px 9px 14px;
    border: 1px solid #ccc;
    border-radius: 24px;
    font-size: 0.95em;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    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 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wcdb-time-select:focus,
.wcdb-time-select:hover {
    border-color: #7b2d2d;
    outline: none;
    box-shadow: 0 0 0 2px rgba(123,45,45,0.15);
}

/* ── jQuery UI popup overrides ──────────────────────────────────────────── */

.ui-datepicker {
    font-size: 0.9em !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
    background: #fff !important;
    z-index: 99999 !important;
    padding: 10px !important;
}

/* Unavailable / closed dates – greyed out */
.ui-datepicker .wcdb-closed-day a,
.ui-datepicker .wcdb-closed-day span {
    color: #ccc !important;
    cursor: not-allowed !important;
    text-decoration: line-through !important;
}

/* Available open date */
.ui-datepicker .wcdb-open-day a {
    color: #2e7d32 !important;
    font-weight: 600;
}

/* Selected date */
.ui-datepicker .ui-datepicker-current-day a,
.ui-datepicker td .ui-state-active {
    background: #7b2d2d !important;
    color: #fff !important;
    border-radius: 4px !important;
    border: none !important;
}

/* Hover on open days */
.ui-datepicker .wcdb-open-day .ui-state-hover,
.ui-datepicker td .ui-state-hover {
    background: #f5e6e6 !important;
    color: #7b2d2d !important;
    border-radius: 4px !important;
    border: none !important;
}

/* ── Error ──────────────────────────────────────────────────────────────── */

.wcdb-error {
    background: #fde8e8;
    border: 1px solid #d63638;
    border-radius: 4px;
    color: #d63638;
    font-size: 0.9em;
    font-weight: 600;
    padding: 10px 14px;
    margin-top: 12px;
}

/* ── Summary ────────────────────────────────────────────────────────────── */

.wcdb-selection-summary {
    background: #eaf5ea;
    border: 1px solid #5b8c5a;
    border-radius: 4px;
    color: #3a5c39;
    font-size: 0.9em;
    padding: 10px 14px;
    margin-top: 12px;
}

/* ── Disabled Add to Cart ───────────────────────────────────────────────── */

.single_add_to_cart_button.wcdb-btn-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
