/*
 * TAD Meet — Single product Date × Time selector.
 *
 * Mobile-first. Desktop styling applied via @media (min-width: 900px).
 * Scoped under .tad-meet-selector to avoid leaking into surrounding theme.
 *
 * Hides the parts of WC's default variations form we don't want, while
 * keeping the cart form + submit button reachable (we drive them via JS).
 *
 * Theming: colors/fonts/radii pull from `theme-tokens.css`. Override any
 * `--tad-meet-*` custom property on :root to restyle without forking.
 */

/* Hide WC's default per-attribute table + single-variation block;
   our 2-select selector replaces them. The submit button is preserved. */
.single-product form.variations_form > table.variations,
.single-product form.variations_form .single_variation_wrap .single_variation,
.single-product form.variations_form .single_variation_wrap .woocommerce-variation-add-to-cart .quantity {
    display: none !important;
}

/* Container ----------------------------------------------------------- */
.tad-meet-selector {
    display: block;
    margin: 0 0 1.25rem;
    padding: 1rem 1rem 1.25rem;
    background: var(--tad-meet-color-surface, #fafafa);
    border: 1px solid var(--tad-meet-color-border, #e5e5e5);
    border-radius: var(--tad-meet-radius, 6px);
    font-family: var(--tad-meet-font-family, inherit);
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--tad-meet-color-text, #222);
}

.tad-meet-selector__row {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.75rem;
}

.tad-meet-selector__label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--tad-meet-color-text, #222);
}

.tad-meet-selector__date,
.tad-meet-selector__time {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    min-height: 40px;
    padding: 0.45rem 2rem 0.45rem 0.6rem;
    background-color: var(--tad-meet-color-surface-alt, #fff);
    border: 1px solid var(--tad-meet-color-border, #c7c7c7);
    border-radius: calc(var(--tad-meet-radius, 6px) - 2px);
    font: inherit;
    color: var(--tad-meet-color-text, #222);
    cursor: pointer;

    /* Caret arrow */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23555' d='M0 0l5 6 5-6z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
}

.tad-meet-selector__date:focus,
.tad-meet-selector__time:focus {
    outline: none;
    border-color: var(--tad-meet-color-primary, #2271b1);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.tad-meet-selector__date option:disabled,
.tad-meet-selector__time option:disabled {
    color: var(--tad-meet-color-disabled, #aaa);
}

/* Feedback ------------------------------------------------------------ */
.tad-meet-selector__feedback {
    min-height: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.tad-meet-selector__hint {
    color: var(--tad-meet-color-muted, #666);
}

.tad-meet-selector__feedback--available {
    color: var(--tad-meet-color-success, #1e7e34);
    font-weight: 500;
}

.tad-meet-selector__feedback--unavailable {
    color: var(--tad-meet-color-danger, #b32d2e);
    font-weight: 500;
}

.tad-meet-selector__feedback--info {
    color: var(--tad-meet-color-primary, #2271b1);
    font-weight: 500;
}

/* Desktop ------------------------------------------------------------- */
@media (min-width: 900px) {
    .tad-meet-selector {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .tad-meet-selector__row {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    .tad-meet-selector__label {
        flex: 0 0 6rem;
        margin-bottom: 0;
    }

    .tad-meet-selector__date,
    .tad-meet-selector__time {
        flex: 1;
        max-width: 24rem;
    }
}
