/* ============================================================
   HUC Date & Time Picker — half-screen bottom drawer
   ============================================================ */

.huc-dtp {
    --huc-dtp-accent: var(--huc-orange-clr, #f97316);
    --huc-dtp-accent-soft: color-mix(in srgb, var(--huc-orange-clr, #f97316) 14%, #fff);
    --huc-dtp-border: var(--huc-outline-stroke, #e5e7eb);
    --huc-dtp-text: var(--huc-darkGray-clr, #1f2937);
    --huc-dtp-muted: var(--huc-gray-clr, #6b7280);
    --huc-dtp-row: 40px;
    --huc-dtp-visible: 5;
    --huc-dtp-wheels-h: calc(var(--huc-dtp-row) * var(--huc-dtp-visible));

    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.huc-dtp.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.huc-dtp[hidden] {
    display: none !important;
}

.huc-dtp.is-open[hidden] {
    display: flex !important;
}

.huc-dtp__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.huc-dtp__sheet {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 28rem;
    height: auto;
    max-height: min(62dvh, 34rem);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 1.15rem 1.15rem 0 0;
    box-shadow: 0 -10px 36px rgba(15, 23, 42, 0.18);
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow: hidden;
}

.huc-dtp.is-open .huc-dtp__sheet {
    transform: translateY(0);
}

.huc-dtp__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem 0.65rem;
    border-bottom: 1px solid var(--huc-dtp-border);
}

.huc-dtp__title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--huc-dtp-text);
}

.huc-dtp__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border: none;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    cursor: pointer;
}

.huc-dtp__body {
    flex: 0 1 auto;
    min-height: 0;
    padding: 0.45rem 0.85rem 0.35rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.huc-dtp__labels,
.huc-dtp__wheels {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.7fr) 0.7rem minmax(0, 0.7fr) minmax(0, 0.75fr);
    column-gap: 0.1rem;
}

.huc-dtp__labels {
    flex: 0 0 auto;
}

.huc-dtp__col-label {
    height: 0.9rem;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 0.9rem;
    text-align: center;
    color: var(--huc-dtp-muted);
}

.huc-dtp__wheels {
    position: relative;
    flex: 0 0 auto;
    height: var(--huc-dtp-wheels-h);
    max-height: var(--huc-dtp-wheels-h);
    overflow: hidden;
}

.huc-dtp__highlight {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: var(--huc-dtp-row);
    margin-top: calc(var(--huc-dtp-row) / -2);
    border-radius: 0.6rem;
    background: var(--huc-dtp-accent-soft);
    pointer-events: none;
    z-index: 0;
}

.huc-dtp__col {
    position: relative;
    z-index: 1;
    min-width: 0;
    /* Critical: allow grid child to shrink so overflow-y can scroll */
    min-height: 0;
    height: var(--huc-dtp-wheels-h);
    max-height: var(--huc-dtp-wheels-h);
    overflow: hidden;
}

.huc-dtp__scroller {
    display: block;
    width: 100%;
    height: var(--huc-dtp-wheels-h);
    max-height: var(--huc-dtp-wheels-h);
    overflow-x: hidden;
    overflow-y: scroll;
    overscroll-behavior: contain;
    touch-action: pan-y;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: relative;
    z-index: 2;
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        #000 16%,
        #000 84%,
        transparent 100%
    );
}

.huc-dtp__scroller::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.huc-dtp__item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--huc-dtp-row);
    min-height: var(--huc-dtp-row);
    max-height: var(--huc-dtp-row);
    box-sizing: border-box;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    color: #9ca3af;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
    flex-shrink: 0;
}

.huc-dtp__item.is-active {
    color: var(--huc-dtp-text);
    font-weight: 800;
}

.huc-dtp__spacer {
    display: block;
    height: calc(var(--huc-dtp-row) * 2);
    min-height: calc(var(--huc-dtp-row) * 2);
    width: 100%;
    pointer-events: none;
    flex-shrink: 0;
}

.huc-dtp__colon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--huc-dtp-wheels-h);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--huc-dtp-text);
    pointer-events: none;
}

.huc-dtp__summary {
    position: relative;
    flex: 0 0 auto;
    margin: 0.15rem 0.85rem 0.65rem;
    padding: 1rem 0.8rem 0.65rem;
    border: 1.5px solid var(--huc-dtp-accent);
    border-radius: 0.6rem;
    background: #fff;
    z-index: 3;
    overflow: visible;
}

.huc-dtp__summary-label {
    position: absolute;
    top: -0.55rem;
    left: 0.7rem;
    padding: 0 0.35rem;
    background: #fff;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
    color: var(--huc-dtp-accent);
    z-index: 1;
}

.huc-dtp__summary-value {
    margin: 0;
    padding-top: 0.15rem;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--huc-dtp-text);
    overflow: visible;
}

.huc-dtp__summary-day {
    margin: 0.15rem 0 0;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--huc-dtp-muted);
}

.huc-dtp__footer {
    flex: 0 0 auto;
    padding: 0 0.85rem 0.9rem;
}

.huc-dtp__continue {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.35rem;
    border: none;
    border-radius: 0.55rem;
    background: linear-gradient(
        135deg,
        var(--huc-orange-clr, #f97316),
        var(--huc-orange-dark-clr, #ea580c)
    );
    color: #fff;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(249, 115, 22, 0.28);
}

body.huc-dtp-open {
    overflow: hidden;
}

@supports not (height: 50dvh) {
    .huc-dtp__sheet {
        max-height: min(62vh, 34rem);
    }
}

@media (min-width: 768px) {
    .huc-dtp {
        align-items: center;
        padding: 1rem;
    }

    .huc-dtp__sheet {
        height: auto;
        max-height: min(70vh, 34rem);
        border-radius: 1rem;
        transform: translateY(0.75rem) scale(0.98);
        opacity: 0;
        box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
    }

    .huc-dtp.is-open .huc-dtp__sheet {
        transform: none;
        opacity: 1;
    }
}
