/* Shared layout behaviour for phones and tablets. */

/* clip, not hidden: hidden on html+body turns body into a scroll container and breaks sticky headers. */
html,
body {
    overflow-x: clip;
}

body.nav-locked {
    overflow: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
svg,
video {
    max-width: 100%;
}

button,
a,
[role="button"] {
    touch-action: manipulation;
}

.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.overflow-x-auto > table {
    min-width: 40rem;
}

/*
 * Sticky identity + Actions columns on horizontally scrolling list tables
 * (same pattern as NDFIS DataView: border-separate, left pin, right pin).
 */
.list-table-scroll {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.list-table-scroll > table.list-table {
    border-collapse: separate;
    border-spacing: 0;
}

.list-table .list-pin-check,
.list-table .list-pin-name,
.list-table .list-pin-actions {
    position: sticky;
    background-color: #fff;
}

.list-table thead .list-pin-check,
.list-table thead .list-pin-name,
.list-table thead .list-pin-actions {
    background-color: #fff;
    z-index: 45;
}

.list-table tbody .list-pin-check,
.list-table tbody .list-pin-name,
.list-table tbody .list-pin-actions {
    z-index: 40;
}

.list-table tbody tr:hover .list-pin-check,
.list-table tbody tr:hover .list-pin-name,
.list-table tbody tr:hover .list-pin-actions {
    background-color: #F8FAFC;
}

.list-table .list-pin-check {
    left: 0;
    z-index: 42;
    box-shadow: 2px 0 6px -2px rgba(15, 23, 42, 0.12);
}

.list-table thead .list-pin-check {
    z-index: 46;
}

.list-table .list-pin-name {
    left: var(--list-pin-name-left, 0);
    min-width: 10rem;
    box-shadow: 2px 0 6px -2px rgba(15, 23, 42, 0.12);
}

.list-table .list-pin-actions {
    right: 0;
    white-space: nowrap;
    box-shadow: -2px 0 6px -2px rgba(15, 23, 42, 0.12);
}

.list-table thead .list-pin-actions {
    z-index: 45;
}

/* Staff / super-admin / customer-account drawer: keep the footer pinned and let the nav list scroll. */
#dashboard-sidebar,
#account-sidebar {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

#dashboard-sidebar nav,
#account-sidebar nav {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--brand) 55%, transparent) transparent;
}

#dashboard-sidebar nav::-webkit-scrollbar,
#account-sidebar nav::-webkit-scrollbar {
    width: 6px;
}

#dashboard-sidebar nav::-webkit-scrollbar-track,
#account-sidebar nav::-webkit-scrollbar-track {
    background: transparent;
    margin-block: 0.5rem;
}

#dashboard-sidebar nav::-webkit-scrollbar-thumb,
#account-sidebar nav::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--brand) 45%, transparent);
    border-radius: 999px;
    border: 1px solid transparent;
    background-clip: padding-box;
    transition: background-color 0.15s ease;
}

#dashboard-sidebar nav::-webkit-scrollbar-thumb:hover,
#account-sidebar nav::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--brand) 75%, transparent);
    background-clip: padding-box;
}

#dashboard-sidebar nav::-webkit-scrollbar-thumb:active,
#account-sidebar nav::-webkit-scrollbar-thumb:active {
    background: var(--brand);
    background-clip: padding-box;
}

#mobile-nav {
    max-height: calc(100dvh - 4rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

@media (max-width: 639px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select,
    textarea {
        font-size: 16px !important;
    }

    .max-w-7xl.px-6,
    .max-w-6xl.px-6,
    .max-w-5xl.px-6,
    .max-w-3xl.px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .rounded-xl.p-6,
    .form-wizard-step-panel {
        padding: 1rem;
    }

    .overflow-x-auto > table th,
    .overflow-x-auto > table td {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Hero search: date/time boxes must not spill out of the card. */
.hero-search-card .hero-dt-group,
.hero-search-card .hero-dt-box {
    min-width: 0;
}

.hero-search-card .hero-dt-native {
    font-size: 16px;
}

@media (max-width: 639px) {
    .hero-search-card .rental-type-btn {
        font-size: 0.8125rem;
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .vehicle-filter-panel {
        left: 0;
        right: auto;
        max-width: calc(100vw - 2rem);
    }
}

@media (min-width: 1024px) {
    #dashboard-sidebar,
    #account-sidebar {
        width: 16rem;
        max-width: none;
        transform: none !important;
        height: 100vh;
        max-height: none;
    }
}
