/* =============================================================================
   mt-datetime.css — birač datuma i vremena (uz theme/js/mt-datetime.js).

   Boje su iz teme: zlatna #c5a26c, mastilo #191919, ivice #ececec.  Pisano je
   običnim CSS-om, ne Tailwind klasama, jer je `assets/css/style.css` gotov build
   pa nove utility klase u njemu ne postoje.

   Na širini <=767px panel je DONJI LIST preko cijele širine, sa zatamnjenjem i
   krupnim ciljevima za prst; iznad toga je popover zakačen za polje.
   ============================================================================= */

/* ------------------------------------------------------------------ polje */

/* Ćelija nosi Tailwind `flex`, a ta klasa pobjeđuje UA pravilo za `[hidden]` —
   bez ovoga bi skriveno polje povratka i dalje stajalo u redu. */
.mt-dt[hidden] { display: none !important; }

.mt-dt__trigger {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
    color: rgba(25, 25, 25, .45);          /* dok je prazno — kao placeholder */
    line-height: 1.35;
}
.mt-dt.is-filled .mt-dt__trigger { color: #191919; }
.mt-dt__trigger:focus-visible {
    outline: 2px solid #c5a26c;
    outline-offset: 3px;
    border-radius: 3px;
}

/* ------------------------------------------------------------------ panel */

.mt-dt-pop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
}
.mt-dt-pop.is-open { display: block; }

/* Desktop: nema zatamnjenja, samo „hvatač" klika van panela. */
.mt-dt-pop__sheet {
    position: absolute;
    width: 340px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .18);
    padding: 18px;
    animation: mtDtIn .18s cubic-bezier(.4, 0, .2, 1);
}
@keyframes mtDtIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}
.mt-dt-pop__grip { display: none; }

/* Mobilni: donji list preko pune širine + zatamnjenje. */
.mt-dt-pop.is-sheet { background: rgba(15, 16, 20, .55); }
.mt-dt-pop.is-sheet .mt-dt-pop__sheet {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: auto;
    max-width: none;
    border-radius: 22px 22px 0 0;
    padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
    max-height: 88vh;
    overflow-y: auto;
    animation: mtDtUp .24s cubic-bezier(.4, 0, .2, 1);
}
@keyframes mtDtUp {
    from { transform: translateY(100%); }
    to   { transform: none; }
}
.mt-dt-pop.is-sheet .mt-dt-pop__grip {
    display: block;
    width: 44px;
    height: 4px;
    margin: 4px auto 12px;
    border-radius: 999px;
    background: rgba(25, 25, 25, .18);
}
/* Dok je list otvoren strana ispod ne smije da skroluje. */
.mt-dt-lock, .mt-dt-lock body { overflow: hidden; }

/* ----------------------------------------------------------------- zaglavlje */

.mt-dt-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.mt-dt-title {
    flex: 1;
    text-align: center;
    font-weight: 700;
    letter-spacing: .5px;
    color: #191919;
    text-transform: capitalize;
}
.mt-dt-nav {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid #ececec;
    border-radius: 999px;
    background: #fff;
    color: #191919;
    cursor: pointer;
    transition: border-color .2s, color .2s, background-color .2s;
}
.mt-dt-nav svg { width: 16px; height: 16px; }
.mt-dt-nav:hover { border-color: #c5a26c; color: #c5a26c; }

/* --------------------------------------------------------------- prečice */

.mt-dt-quick {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.mt-dt-quick:empty { display: none; }
.mt-dt-chip {
    flex: 1;
    padding: 9px 10px;
    border: 1px solid #ececec;
    border-radius: 999px;
    background: #fff;
    font-size: 14px;
    color: #191919;
    cursor: pointer;
    transition: border-color .2s, color .2s;
}
.mt-dt-chip:hover { border-color: #c5a26c; color: #c5a26c; }

/* --------------------------------------------------------------- kalendar */

.mt-dt-dow, .mt-dt-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.mt-dt-dow {
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: rgba(25, 25, 25, .45);
    text-align: center;
}
.mt-dt-day {
    aspect-ratio: 1;
    min-height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: none;
    font-size: 15px;
    color: #191919;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.mt-dt-day:hover:not(:disabled) { background: rgba(197, 162, 108, .14); }
.mt-dt-day:disabled {
    color: rgba(25, 25, 25, .25);
    cursor: default;
}
.mt-dt-day.is-today { box-shadow: inset 0 0 0 1px #c5a26c; }
.mt-dt-day.is-selected {
    background: #c5a26c;
    color: #fff;
    font-weight: 700;
}

/* ---------------------------------------------------------------- vrijeme */

.mt-dt-timewrap {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #ececec;
}
.mt-dt-timelabel {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(25, 25, 25, .55);
}
.mt-dt-time {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 6px;
}
.mt-dt-col {
    flex: 1;
    max-width: 120px;
    height: 132px;
    overflow-y: auto;
    scroll-snap-type: y proximity;
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* Traka skrola je na mobilnom suvišna i krade prostor. */
    scrollbar-width: thin;
}
.mt-dt-col::-webkit-scrollbar { width: 4px; }
.mt-dt-col::-webkit-scrollbar-thumb { background: rgba(25, 25, 25, .15); border-radius: 999px; }
.mt-dt-colon {
    align-self: center;
    font-weight: 700;
    color: rgba(25, 25, 25, .35);
}
.mt-dt-tick {
    flex: none;
    scroll-snap-align: center;
    padding: 9px 0;
    border: 0;
    border-radius: 8px;
    background: none;
    font-size: 15px;
    color: #191919;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.mt-dt-tick:hover { background: rgba(197, 162, 108, .14); }
.mt-dt-tick.is-selected {
    background: #191919;
    color: #fff;
    font-weight: 700;
}

/* ---------------------------------------------------------------- podnožje */

.mt-dt-foot {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.mt-dt-btn {
    flex: 1;
    height: 44px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background-color .25s, color .25s, border-color .25s;
}
.mt-dt-btn--ghost {
    border: 1px solid #191919;
    background: #fff;
    color: #191919;
}
.mt-dt-btn--ghost:hover { background: #191919; color: #fff; }
.mt-dt-btn--gold {
    border: 1px solid #c5a26c;
    background: #c5a26c;
    color: #fff;
}
.mt-dt-btn--gold:hover { background: #b28f57; border-color: #b28f57; }

/* Na mobilnom su ciljevi krupniji — prst nije miš. */
@media (max-width: 767px) {
    /* Bez `aspect-ratio`: na 375px kvadratna ćelija je ~50px, pa je kalendar
       sam za sebe visok 300px i cijeli list traži skrol da bi se vidjelo
       vrijeme. Fiksna visina drži ćeliju dovoljno velikom za prst (44px). */
    .mt-dt-day { aspect-ratio: auto; height: 44px; min-height: 0; font-size: 16px; }
    .mt-dt-col { height: 150px; }
    .mt-dt-tick { padding: 11px 0; font-size: 16px; }
    .mt-dt-btn { height: 50px; }

    /* „Done" mora ostati na dohvat i kad se sadržaj lista skroluje. */
    .mt-dt-pop.is-sheet .mt-dt-foot {
        position: sticky;
        bottom: 0;
        margin-top: 14px;
        padding: 12px 0 4px;
        background: #fff;
    }
    /* Traka skrola u kolonama vremena je na dodir suvišna i vizuelno gruba. */
    .mt-dt-col { scrollbar-width: none; }
    .mt-dt-col::-webkit-scrollbar { width: 0; }

    /* Dvije uske kolone na sredini širokog lista izgledaju kao da nešto fali —
       ovako popune red i čitaju se kao dva birača. */
    .mt-dt-time { gap: 10px; }
    .mt-dt-col {
        max-width: none;
        padding: 4px;
        border-radius: 12px;
        background: rgba(25, 25, 25, .035);
    }
}

/* Desktop: vrijeme stoji PORED kalendara. Složeno jedno ispod drugog panel je
   ~670px visok, pa se kod polja na sredini ekrana nije uklapao ispod njega i
   prevrtao se preko hero-a. Ovako je ~430px i uvijek stane. */
@media (min-width: 768px) {
    .mt-dt-pop__sheet {
        width: 470px;
        display: grid;
        grid-template-columns: 1fr 122px;
        grid-template-areas: "cal time" "foot foot";
        column-gap: 16px;
    }
    .mt-dt-cal  { grid-area: cal; }
    .mt-dt-foot { grid-area: foot; }
    .mt-dt-timewrap {
        grid-area: time;
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
        border-left: 1px solid #ececec;
        padding-left: 16px;
    }
    .mt-dt-col { height: 268px; max-width: none; }
}
