* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Toolbar */
#toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    z-index: 10;
    flex-shrink: 0;
}

.brand-logos {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    width: auto;
}

.brand-logo-biketours {
    height: 35px;
}

.brand-link:hover {
    opacity: 0.8;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tour-count {
    font-size: 16px;
    color: #666;
    background: #f0f2f5;
    padding: 5px 12px;
    border-radius: 14px;
}

.toolbar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background: #fff;
    cursor: pointer;
    appearance: menulist;
    -webkit-appearance: menulist;
    position: relative;
    z-index: 1;
    min-height: 40px;
}

/* Custom color-coded dropdown */
.custom-select {
    position: relative;
    display: inline-block;
    min-width: 160px;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.custom-select-trigger:hover {
    border-color: #bbb;
}

.custom-select.open .custom-select-trigger {
    border-color: #999;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #999;
    border-top: none;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
}

.custom-select.open .custom-select-options {
    display: block;
}

.custom-select-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.custom-select-option:hover {
    background: #f0f4ff;
}

.custom-select-option.selected {
    background: #e3f2fd;
}

.opt-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.trigger-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 4px;
}

.btn-toggle {
    padding: 8px 18px;
    border: 1px solid #4A90D9;
    border-radius: 6px;
    background: #fff;
    color: #4A90D9;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toggle.active {
    background: #4A90D9;
    color: #fff;
}

/* Map container */
#mapContainer {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

#map {
    flex: 1;
    height: 100%;
}

/* Sidebar */
#sidebar {
    width: 380px;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    overflow-y: auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

#sidebar.sidebar-hidden {
    width: 0;
    overflow: hidden;
    border: none;
}

.sidebar-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.sidebar-close:hover {
    background: #f0f0f0;
}

/* Sidebar content */
.tour-detail {
    padding: 20px;
}

.tour-detail h2 {
    font-size: 18px;
    color: #1a1a1a;
    margin-bottom: 4px;
    padding-right: 32px;
}

.tour-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0 16px;
}

.tour-badge {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.badge-type-bike { background: #F5E6D8; color: #8B4513; }
.badge-type-day-tour { background: #E8F5E0; color: #3D6B1E; }
.badge-type-bike-boat { background: #E1F5FE; color: #0277BD; }
.badge-difficulty { background: #E8F5E9; color: #2E7D32; }
.badge-duration { background: #F3E5F5; color: #6A1B9A; }
.badge-rating { background: #FFF8E1; color: #F57F17; }

.tour-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 16px;
}

.tour-section {
    margin-bottom: 16px;
}

.tour-section h3 {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tour-cities {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #444;
    margin-bottom: 12px;
}

.tour-cities .arrow {
    color: #999;
}

/* Pricing table */
.price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.price-table th {
    text-align: left;
    padding: 6px 8px;
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.price-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
    color: #444;
}

.price-table .price-value {
    font-weight: 600;
    color: #2E7D32;
}

/* Itinerary */
.itinerary-day {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.itinerary-day:last-child { border-bottom: none; }

.day-number {
    font-weight: 600;
    font-style: italic;
    color: #4A90D9;
    min-width: 48px;
}

.day-title { flex: 1; color: #333; }

.day-distance {
    color: #666;
    white-space: nowrap;
}

.tour-link {
    display: block;
    margin: 16px auto 0;
    padding: 12px 24px;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.tour-link-biketours {
    background: #001549;
}
.tour-link-biketours:hover {
    background: #00103a;
}

/* Tour list (cluster click) */
.tour-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 12px;
}

.tour-list-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.tour-list-item:hover {
    background: #f5f8ff;
}

.tour-list-thumb {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.tour-list-info {
    flex: 1;
    min-width: 0;
}

.tour-list-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 4px;
}

.tour-list-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.tour-list-price {
    font-size: 13px;
    font-weight: 600;
    color: #2E7D32;
}

/* InfoWindow */
.info-window {
    max-width: 260px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.info-window h3 {
    font-size: 14px;
    margin-bottom: 4px;
    color: #1a1a1a;
}

.info-window .info-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.info-window .info-price {
    font-size: 13px;
    font-weight: 600;
    color: #2E7D32;
}

/* Responsive */
@media (max-width: 768px) {
    #toolbar {
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }

    .toolbar-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    #sidebar {
        position: fixed;
        right: 0;
        top: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        z-index: 9999;
        box-shadow: none;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        overflow-y: scroll;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    #sidebar .tour-detail {
        padding-bottom: 100px;
    }

    #sidebar.sidebar-hidden {
        transform: translateX(100%);
        overflow: hidden;
    }
}
