/* ============================================================
 * DATE  —  <x-ow.date>  .ow-date  .ow-datepop   (its own file: the reservation panel and the till load
 * the tokens and their own field styles, not the whole kit)
 * A YYYY-MM-DD text field with a calendar icon, and the popup that
 * public/custom/js/ow-date.js draws in the page's language. The popup
 * is appended to <body>, so it carries .ow-scope itself (see CLAUDE.md,
 * "dialog at body level").
 * ============================================================ */
.ow-date { position: relative; display: block; min-width: 0; }
.ow-date__input { padding-right: 40px; }
.ow-date__btn {
    position: absolute; top: 0; right: 0; bottom: 0; width: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border: 0; background: transparent; color: var(--ow-muted);
    border-radius: 0 var(--ow-radius) var(--ow-radius) 0; cursor: pointer;
}
.ow-date__btn:hover { color: var(--ow-brand-ink); }
.ow-date__input:disabled + .ow-date__btn { cursor: not-allowed; opacity: .5; }

.ow-datepop {
    position: fixed; z-index: 100000; width: 292px; padding: var(--ow-sp-3);
    background: var(--ow-surface); color: var(--ow-ink);
    border: 1px solid var(--ow-line); border-radius: var(--ow-radius);
    box-shadow: 0 18px 48px -12px rgba(16, 24, 40, .28), 0 2px 8px rgba(16, 24, 40, .08);
    font-family: inherit; font-size: var(--ow-fs-sm);
}
.ow-datepop__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--ow-sp-2); }
.ow-datepop__title { font-weight: var(--ow-fw-semibold); font-size: var(--ow-fs-md); }
.ow-datepop__nav {
    width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--ow-radius-sm);
    background: transparent; color: var(--ow-ink); font-size: 22px; line-height: 1; cursor: pointer;
}
.ow-datepop__nav:hover { background: var(--ow-sunken); }
.ow-datepop__row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ow-datepop__row > span { text-align: center; }
.ow-datepop__dow > span {
    padding: 6px 0; font-size: var(--ow-fs-xs); font-weight: var(--ow-fw-semibold);
    color: var(--ow-muted); text-transform: lowercase;
}
.ow-datepop__day {
    height: 36px; padding: 0; border: 0; border-radius: var(--ow-radius-sm); background: transparent;
    color: var(--ow-ink); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer;
}
.ow-datepop__day:hover:not(:disabled) { background: var(--ow-brand-wash); }
.ow-datepop__day:focus-visible, .ow-datepop__nav:focus-visible, .ow-datepop__today:focus-visible { outline: none; box-shadow: var(--ow-ring); }
.ow-datepop__day.is-today { box-shadow: inset 0 0 0 1.5px var(--ow-brand); }
.ow-datepop__day.is-selected { background: var(--ow-brand); color: #fff; box-shadow: none; font-weight: var(--ow-fw-semibold); }
.ow-datepop__day:disabled { color: #c3c8cf; cursor: not-allowed; }
.ow-datepop__foot { margin-top: var(--ow-sp-2); padding-top: var(--ow-sp-2); border-top: 1px solid var(--ow-line-soft); text-align: center; }
.ow-datepop__today {
    padding: 6px 12px; border: 0; border-radius: var(--ow-radius-sm); background: transparent;
    color: var(--ow-brand-ink); font: inherit; font-weight: var(--ow-fw-semibold); cursor: pointer;
}
.ow-datepop__today:hover { background: var(--ow-brand-wash); }
/* A finger needs 44px: the popup grows on touch screens (phones and the Sunmi till). */
@media (pointer: coarse), (max-width: 575.98px) {
    .ow-datepop { width: min(336px, calc(100vw - 16px)); }
    .ow-datepop__day { height: 44px; }
    .ow-datepop__nav { width: 44px; height: 44px; }
    .ow-datepop__today { padding: 12px 18px; }
}

/* ============================================================
 * TIME  —  <x-ow.time>  .ow-time  .ow-timepop   (same file as the date: both load together)
 * An HH:MM text field (24-hour clock) with a clock icon, and the list of times
 * public/custom/js/ow-time.js draws on click / ArrowDown. Appended to <body>, so it carries .ow-scope itself.
 * ============================================================ */
.ow-time { position: relative; display: block; min-width: 0; }
.ow-time__input { padding-right: 40px; font-variant-numeric: tabular-nums; }
.ow-time__btn {
    position: absolute; top: 0; right: 0; bottom: 0; width: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border: 0; background: transparent; color: var(--ow-muted);
    border-radius: 0 var(--ow-radius) var(--ow-radius) 0; cursor: pointer;
}
.ow-time__btn:hover { color: var(--ow-brand-ink); }
.ow-time__input:disabled + .ow-time__btn { cursor: not-allowed; opacity: .5; }
.ow-timepop {
    position: fixed; z-index: 100000; max-height: 264px; overflow-y: auto; padding: var(--ow-sp-1);
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; width: 280px;
    background: var(--ow-surface); color: var(--ow-ink);
    border: 1px solid var(--ow-line); border-radius: var(--ow-radius);
    box-shadow: 0 18px 48px -12px rgba(16, 24, 40, .28), 0 2px 8px rgba(16, 24, 40, .08);
    font-family: inherit; font-size: var(--ow-fs-sm);
}
.ow-timepop__opt {
    height: 36px; padding: 0; border: 0; border-radius: var(--ow-radius-sm); background: transparent;
    color: var(--ow-ink); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer;
}
.ow-timepop__opt:hover { background: var(--ow-brand-wash); }
.ow-timepop__opt:focus-visible { outline: none; box-shadow: var(--ow-ring); }
.ow-timepop__opt.is-selected { background: var(--ow-brand); color: #fff; font-weight: var(--ow-fw-semibold); }
@media (pointer: coarse), (max-width: 575.98px) {
    .ow-timepop { width: min(336px, calc(100vw - 16px)); }
    .ow-timepop__opt { height: 44px; }
}

/* ============================================================
 * DATETIME  —  <x-ow.datetime>  a date field and a time field on one line (public/custom/js/ow-datetime.js)
 * ============================================================ */
.ow-datetime { display: flex; flex-wrap: wrap; gap: var(--ow-sp-2); align-items: stretch; min-width: 0; }
.ow-datetime[hidden] { display: none; }
/* Side by side when there is room; the time drops under the date in a narrow column (a time cut to "08:0" is useless). */
.ow-datetime__date { flex: 1 1 150px; min-width: 0; }
.ow-datetime__time { flex: 1 1 108px; min-width: 0; }
