/* ============================================================
   Pickup Appointment Scheduler — Widget Styles
   ============================================================ */

/* ----- Placeholder when Ship is selected (stays mounted for polling) ----- */
.pickup-scheduler-placeholder {
    display: none !important;
}

/* ----- Shared widget container ----- */
/*
 * Doubled selector to out-specifiy WC's slot-wrapper padding rule:
 * .wc-block-components-totals-wrapper.slot-wrapper>*>* { padding: 16px 0; }
 * No border or margin — widget sits flush inside the order summary panel.
 */
.pickup-scheduler-widget,
div.pickup-scheduler-widget,
.pickup-scheduler-widget.pickup-scheduler-widget {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 16px !important;
    transition: border-color 0.15s, background-color 0.15s;
}

/* ----- Validation error state ----- */
/* Applied via JS when Place Order is clicked with no date/time selected.   */
/* Clears automatically when the user focuses into the widget (:focus-within). */
.pickup-scheduler-widget.pickup-scheduler--error,
div.pickup-scheduler-widget.pickup-scheduler--error,
.pickup-scheduler-widget.pickup-scheduler-widget.pickup-scheduler--error {
    border: 2px solid #cc1818 !important;
    background-color: #fff0f0 !important;
}

.pickup-scheduler-widget.pickup-scheduler--error:focus-within,
div.pickup-scheduler-widget.pickup-scheduler--error:focus-within {
    border: 2px solid transparent !important;
    background-color: #f9f9f9 !important;
}

.pickup-scheduler-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: #1a1a1a;
}

.pickup-scheduler-note {
    font-size: 0.9rem;
    color: #555;
    margin: 0 0 16px;
    line-height: 1.5;
}

.pickup-scheduler-contact {
    font-size: 0.85rem;
    color: #777;
    margin-top: 16px;
}

/* ----- Field layout ----- */
.pickup-scheduler-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pickup-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Spacing between consecutive fields in the block checkout widget
   (fields are direct children of the widget, not wrapped in .pickup-scheduler-fields) */
.pickup-scheduler-widget .pickup-field + .pickup-field {
    margin-top: 16px;
}

.pickup-field label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.pickup-field label abbr {
    text-decoration: none;
    color: #c00;
    margin-left: 2px;
}

/* ----- Date input + time select ----- */
.pickup-field input[type="date"],
.pickup-field select {
    width: 100%;
    max-width: 320px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #333;
    background-color: #fff;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.pickup-field input[type="date"]:focus,
.pickup-field select:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

/* ----- Loading indicator ----- */
.pickup-slots-loading {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
    margin-top: 8px;
    display: block;
}

/* ----- Slot error / info message ----- */
.pickup-slots-message {
    font-size: 0.88rem;
    color: #b00;
    padding: 8px 12px;
    background: #fff0f0;
    border: 1px solid #f5c6c6;
    border-radius: 4px;
    margin-top: 8px;
}

/* ----- Disabled / full slot options ----- */
.pickup-field select option:disabled {
    color: #aaa;
}

/* ----- Standalone shortcode widget adjustments ----- */
.pickup-scheduler-standalone {
    max-width: 480px;
    border: 1px solid #e0e0e0;
    margin: 24px 0;
}

/* ----- Hide "Ship" method toggle when cart is all local-pickup-only ----- */
/*
 * The body class `cart-all-local-pickup` is added by PHP when every cart item
 * carries the `local-pickup-only` shipping class. The Ship option is always the
 * first child of the shipping-method container.
 */
.cart-all-local-pickup .wc-block-checkout__shipping-method-option:first-child {
    display: none;
}

/* ----- Responsive ----- */
@media ( min-width: 640px ) {
    .pickup-scheduler-fields {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .pickup-field {
        flex: 0 0 auto;
    }
}
