/* ================================================================
   AVESTA TRAVEL - Global Custom Timepicker (Modern Wheel Edition)
================================================================ */

:root {
    --avtp-bg: #ffffff;
    --avtp-text: var(--gray-900, #0f172a);
    --avtp-text-muted: var(--gray-500, #64748b);
    --avtp-primary: var(--primary, #e85d04);
    --avtp-primary-glow: var(--primary-glow, rgba(232, 93, 4, 0.15));
    --avtp-border: var(--gray-200, #e2e8f0);
    --avtp-shadow: 0 20px 60px rgba(0, 0, 0, 0.14), 0 4px 16px rgba(0, 0, 0, 0.06);
    --avtp-radius: 16px;
    --avtp-font-display: var(--font-display, 'Outfit', 'Inter', sans-serif);
    --avtp-font-body: var(--font-body, 'Inter', sans-serif);
    --avtp-ease: var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.avtp-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.avtp-trigger {
    width: 100%;
    padding: 12px 42px 12px 16px;
    border: 1.5px solid var(--avtp-border);
    border-radius: 12px;
    background: var(--gray-50, #f8fafc);
    font-family: var(--avtp-font-body);
    font-size: 0.95rem;
    color: var(--avtp-text);
    cursor: pointer;
    outline: none;
    transition: all 0.2s var(--avtp-ease);
    text-align: left;
    appearance: none;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.avtp-trigger:hover {
    border-color: var(--gray-300, #cbd5e1);
    background: #ffffff;
}

.avtp-trigger:focus,
.avtp-trigger.open {
    border-color: var(--avtp-primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--avtp-primary-glow);
    transform: translateY(-1px);
}

.avtp-trigger.has-value {
    color: var(--avtp-text);
    font-weight: 600;
}

.avtp-trigger.placeholder-text {
    color: var(--gray-400, #94a3b8);
}

.avtp-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400, #94a3b8);
    pointer-events: none;
    transition: all 0.2s var(--avtp-ease);
}

.avtp-trigger.open ~ .avtp-icon {
    color: var(--avtp-primary);
    transform: translateY(-50%) rotate(180deg);
}

.avtp-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 9999;
    width: 280px;
    background: var(--avtp-bg);
    border: 1px solid var(--avtp-border);
    border-radius: var(--avtp-radius);
    box-shadow: var(--avtp-shadow);
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top left;
    pointer-events: none;
    transition: opacity 0.25s var(--avtp-ease), transform 0.3s var(--avtp-ease);
    overflow: hidden;
}

.avtp-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.avtp-panel.avtp-portaled {
    position: fixed;
    z-index: 15060;
}

/* -- Wheel UI Structure -- */

.avtp-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.avtp-title {
    font-family: var(--avtp-font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--avtp-text);
    letter-spacing: -0.01em;
}

.avtp-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    background: var(--gray-100, #f1f5f9);
    color: var(--avtp-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.avtp-close:hover {
    background: var(--gray-200, #e2e8f0);
    color: var(--avtp-text);
}

.avtp-body {
    position: relative;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 220px;
    background: #ffffff;
    user-select: none;
}

.avtp-wheels-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.avtp-wheel {
    flex: 1;
    height: 100%;
    overflow-y: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
}

.avtp-wheel::-webkit-scrollbar {
    display: none;
}

.avtp-wheel-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.avtp-wheel-inner::before,
.avtp-wheel-inner::after {
    content: '';
    display: block;
    height: 85px;
    width: 100%;
    min-height: 85px;
}

.avtp-wheel-item {
    height: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-family: var(--avtp-font-display);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--avtp-text-muted);
    scroll-snap-align: center;
    transition: color 0.2s, transform 0.2s;
    cursor: pointer;
}

.avtp-wheel-item.active {
    color: var(--avtp-text);
    font-weight: 700;
    transform: scale(1.15);
}

.avtp-wheel-sep {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--avtp-text);
    padding: 0 4px;
}

/* -- Selection & Masks -- */

.avtp-selection-highlight {
    position: absolute;
    top: 50%;
    left: 12px;
    right: 12px;
    height: 50px;
    transform: translateY(-50%);
    background: var(--gray-50, #f8fafc);
    border-radius: 12px;
    pointer-events: none;
    z-index: 1;
    border: 1px solid var(--gray-100, #f1f5f9);
}

.avtp-wheel-mask {
    position: absolute;
    left: 0;
    right: 0;
    height: 85px;
    pointer-events: none;
    z-index: 3;
}

.avtp-wheel-mask-top {
    top: 0;
    background: linear-gradient(to bottom,
        rgba(255,255,255,1) 0%,
        rgba(255,255,255,0.8) 50%,
        rgba(255,255,255,0) 100%);
}

.avtp-wheel-mask-bottom {
    bottom: 0;
    background: linear-gradient(to top,
        rgba(255,255,255,1) 0%,
        rgba(255,255,255,0.8) 50%,
        rgba(255,255,255,0) 100%);
}

.avtp-footer {
    padding: 12px 20px 20px;
    display: flex;
    gap: 10px;
}

.avtp-btn {
    flex: 1;
    padding: 10px;
    border-radius: 12px;
    font-family: var(--avtp-font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avtp-btn-secondary {
    background: var(--gray-100, #f1f5f9);
    color: var(--avtp-text);
}

.avtp-btn-secondary:hover {
    background: var(--gray-200, #e2e8f0);
}

.avtp-btn-primary {
    background: var(--avtp-primary);
    color: #ffffff;
}

.avtp-btn-primary:hover {
    background: var(--avtp-primary);
    filter: brightness(0.9);
    box-shadow: 0 4px 12px var(--avtp-primary-glow);
}

/* -- Mobile Sheet Styles -- */

.avtp-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 15000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.avtp-backdrop.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    html.av-picker-mobile-open,
    body.av-picker-mobile-open {
        overflow: hidden !important;
        overscroll-behavior: none !important;
    }

    .avtp-backdrop {
        top: var(--av-picker-vv-top, 0px) !important;
        bottom: auto !important;
        height: var(--av-picker-vv-height, 100dvh) !important;
        min-height: var(--av-picker-vv-height, 100dvh) !important;
        width: 100vw !important;
        background: rgba(15, 23, 42, 0.52);
        overscroll-behavior: none;
    }

    .avtp-panel.avtp-mobile-sheet {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: var(--av-picker-vv-bottom, 0px) !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: min(calc(var(--av-picker-vv-height, 100dvh) - 12px), 560px);
        border-radius: 24px 24px 0 0;
        transform: translateY(100%) !important;
        transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1) !important;
        overflow: hidden;
        overscroll-behavior: contain;
    }

    .avtp-panel.avtp-mobile-sheet.open {
        transform: translateY(0) !important;
    }

    .avtp-panel.avtp-mobile-sheet::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        width: 40px;
        height: 4px;
        background: var(--gray-200, #e2e8f0);
        border-radius: 2px;
        transform: translateX(-50%);
    }

    .avtp-header {
        padding: 24px 20px 12px;
    }

    .avtp-footer {
        padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    }
}
