/* ========================================
    HoraPrevia date picker (widget-datepicker.js): a field like the widget's others, and a
    calendar like the booking one. Used in the widget and in the customers' app, so every
    colour has a fallback (the app's page has no .hp-widget-root greys).
    ======================================== */
.hp-widget-datepick {
    position: relative;
    min-width: 0;
}
.hp-widget-datepick-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    box-sizing: border-box;
    border: 1px solid var(--hp-g200, #E3E6EB);
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 0.875rem;
    color: var(--hp-g900, #18202D);
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    text-align: left;
}
.hp-widget-datepick-btn svg {
    flex-shrink: 0;
    color: var(--hp-primary-ink);
}
.hp-widget-datepick-btn:hover,
.hp-widget-datepick-btn[aria-expanded="true"] {
    border-color: var(--hp-primary);
}
.hp-widget-datepick-btn:focus-visible,
.hp-widget-datepick-btn[aria-expanded="true"] {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--hp-primary-rgb), 0.12);
}
.hp-widget-datepick-pop {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    width: 272px;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid var(--hp-g200, #E3E6EB);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16);
}
.hp-widget-datepick-pop[hidden] {
    display: none;
}
.hp-widget-datepick-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.hp-widget-datepick-head b {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--hp-g900, #18202D);
}
.hp-widget-datepick-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--hp-g200, #E3E6EB);
    border-radius: 8px;
    background: #fff;
    color: var(--hp-g700, #3C4555);
    cursor: pointer;
}
.hp-widget-datepick-nav:hover:not(:disabled) {
    border-color: var(--hp-primary);
    color: var(--hp-primary-ink);
}
.hp-widget-datepick-nav:disabled {
    opacity: 0.4;
    cursor: default;
}
.hp-widget-datepick-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}
.hp-widget-datepick-wd {
    padding: 4px 0;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--hp-g400, #9AA1AD);
    text-transform: uppercase;
}
.hp-widget-datepick-day {
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    font-size: 0.8125rem;
    color: var(--hp-g900, #18202D);
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}
.hp-widget-datepick-day:hover:not(:disabled) {
    background: rgba(var(--hp-primary-rgb), 0.12);
    color: var(--hp-primary-ink);
}
.hp-widget-datepick-day.today {
    font-weight: 700;
    color: var(--hp-primary-ink);
}
.hp-widget-datepick-day.selected,
.hp-widget-datepick-day.selected:hover {
    background: var(--hp-primary);
    color: var(--hp-on-primary);
    font-weight: 600;
}
.hp-widget-datepick-day:disabled {
    color: var(--hp-g400, #9AA1AD);
    opacity: 0.5;
    cursor: default;
}
.hp-widget-datepick-day:focus-visible,
.hp-widget-datepick-nav:focus-visible {
    outline: 2px solid var(--hp-primary);
    outline-offset: 1px;
}

/* the title opens the months, then the years */
.hp-widget-datepick-title {
    padding: 4px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--hp-g900, #18202D);
    cursor: pointer;
}
.hp-widget-datepick-title:hover {
    background: rgba(var(--hp-primary-rgb, 74, 123, 167), 0.10);
    color: var(--hp-primary-ink, #4878A3);
}
/* months and years: three per row */
.hp-widget-datepick-grid-wide {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.hp-widget-datepick-cell {
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font: inherit;
    font-size: 0.8125rem;
    color: var(--hp-g900, #18202D);
    cursor: pointer;
}
.hp-widget-datepick-cell:hover:not(:disabled) {
    background: rgba(var(--hp-primary-rgb, 74, 123, 167), 0.12);
    color: var(--hp-primary-ink, #4878A3);
}
.hp-widget-datepick-cell.selected {
    background: var(--hp-primary, #4A7BA7);
    color: var(--hp-on-primary, #fff);
    font-weight: 600;
}
.hp-widget-datepick-cell:disabled {
    color: var(--hp-g400, #9AA1AD);
    opacity: 0.5;
    cursor: default;
}
