/* =========================================
   Safari Tanzanie - Editorial Cartography
   Mobile-First Responsive Design
   ========================================= */

/* CSS Variables - Safari Palette */
:root {
    --safari-ocre: #C4A35A;
    --safari-brun: #5D4037;
    --safari-vert: #6B8E23;
    --safari-beige: #F5F0E1;
    --safari-sable: #E8D5B7;

    --safari-dark: #2C1810;
    --safari-light: #FFFBF5;
    --safari-accent: #D4845A;

    /* Typography */
    --font-display: 'Crimson Pro', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, system-ui, sans-serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(93, 64, 55, 0.08);
    --shadow-md: 0 4px 12px rgba(93, 64, 55, 0.12);
    --shadow-lg: 0 12px 24px rgba(93, 64, 55, 0.16);
    --shadow-xl: 0 20px 40px rgba(93, 64, 55, 0.2);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-expand: 350ms cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Layout - Mobile defaults */
    --banner-height: 48px;
    --panel-width: 100%;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--safari-brun);
    background: var(--safari-beige);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   Fixed Top Banner
   ========================================= */

.safari-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--banner-height);
    background: linear-gradient(135deg, var(--safari-dark) 0%, #3D2518 60%, var(--safari-brun) 100%);
    z-index: 2000;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(44, 24, 16, 0.3);
}

.banner-ornament {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--safari-ocre) 0%,
        var(--safari-vert) 30%,
        var(--safari-ocre) 60%,
        var(--safari-accent) 100%);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0 var(--space-md);
    width: 100%;
}

.banner-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.banner-title-accent {
    color: var(--safari-ocre);
    font-weight: 400;
}

.banner-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    display: none;
}

.banner-stats {
    display: none;
    align-items: center;
    gap: var(--space-sm);
}

.banner-stat {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.banner-stat-value {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--safari-ocre);
    line-height: 1;
}

.banner-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.6);
}

.banner-stat-sep {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--safari-ocre);
    opacity: 0.5;
}

/* Hidden on mobile by default */
.banner-dates,
.banner-info {
    display: none;
    font-family: var(--font-display);
    white-space: nowrap;
}

.banner-dates {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.75);
    font-style: italic;
}

.banner-info {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* =========================================
   Safari Container (below banner)
   ========================================= */

.safari-container {
    position: relative;
    height: calc(100dvh - var(--banner-height));
    width: 100vw;
    margin-top: var(--banner-height);
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

/* =========================================
   Map (fullscreen behind panel)
   ========================================= */

.safari-map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: var(--safari-beige);
}

/* Leaflet Overrides */
.leaflet-container {
    font-family: var(--font-body);
    background: #E8DCC8;
}

/* Move zoom controls to top-right to avoid panel overlap */
.leaflet-top.leaflet-left {
    left: auto;
    right: 10px;
}

.leaflet-top.leaflet-left .leaflet-control {
    margin-left: 0;
    margin-right: 0;
}

.leaflet-popup-content-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    min-width: 220px;
}

.safari-popup {
    padding: var(--space-md);
}

.safari-popup-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.safari-popup-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--safari-ocre) 0%, var(--safari-accent) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.safari-popup-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--safari-brun);
    line-height: 1.3;
    margin: 0;
}

.safari-popup-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    font-size: 0.813rem;
}

.safari-popup-row {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--safari-brun);
}

.safari-popup-row svg {
    flex-shrink: 0;
    stroke: var(--safari-ocre);
}

.safari-popup-label {
    font-weight: 500;
    color: var(--safari-brun);
    opacity: 0.6;
}

/* =========================================
   Bottom Sheet Handle (mobile)
   ========================================= */

.bottom-sheet-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    cursor: grab;
    touch-action: none;
    flex-shrink: 0;
    -webkit-user-select: none;
    user-select: none;
}

.bottom-sheet-handle:active {
    cursor: grabbing;
}

.bottom-sheet-handle-bar {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(93, 64, 55, 0.25);
    transition: background var(--transition-fast);
}

.bottom-sheet-handle:hover .bottom-sheet-handle-bar {
    background: rgba(93, 64, 55, 0.4);
}

/* =========================================
   Floating Panel / Bottom Sheet
   ========================================= */

/* Mobile: Bottom sheet fixed at bottom */
.safari-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-height: calc(100dvh - var(--banner-height) - 0.5rem);
    background: rgba(255, 251, 245, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px 16px 0 0;
    border: 1px solid rgba(196, 163, 90, 0.2);
    border-bottom: none;
    box-shadow: 0 -4px 24px rgba(44, 24, 16, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 350ms cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
    will-change: transform;
}

/* Bottom sheet states (mobile) */
.safari-panel.panel--peek {
    transform: translateY(calc(100% - 100px));
}

.safari-panel.panel--half {
    transform: translateY(calc(100% - 50dvh));
}

.safari-panel.panel--full {
    transform: translateY(0);
}

/* Disable transition during drag */
.safari-panel.dragging {
    transition: none;
}

/* Panel Header */
.panel-header {
    padding: var(--space-sm) var(--space-md) var(--space-xs);
    border-bottom: 1px solid rgba(196, 163, 90, 0.15);
    position: relative;
    flex-shrink: 0;
}

.panel-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--safari-brun);
    line-height: 1;
    margin-bottom: 0.2rem;
}

.panel-subtitle {
    font-size: 0.75rem;
    color: var(--safari-brun);
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Hide desktop panel-toggle on mobile */
.panel-toggle {
    display: none;
    position: absolute;
    top: 50%;
    right: var(--space-md);
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(196, 163, 90, 0.1);
    border: 1px solid rgba(196, 163, 90, 0.2);
    border-radius: 8px;
    color: var(--safari-brun);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.panel-toggle:hover {
    background: rgba(196, 163, 90, 0.2);
    color: var(--safari-ocre);
}

.panel-toggle svg {
    transition: transform var(--transition-base);
}

.safari-panel.collapsed .panel-toggle svg {
    transform: rotate(180deg);
}

/* Floating re-open button — hidden on mobile, shown on desktop when collapsed */
.panel-reopen {
    display: none;
    position: absolute;
    top: var(--space-lg);
    left: var(--space-lg);
    width: 44px;
    height: 44px;
    background: rgba(255, 251, 245, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(196, 163, 90, 0.25);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    color: var(--safari-brun);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all var(--transition-base);
}

.panel-reopen:hover {
    background: rgba(255, 251, 245, 1);
    box-shadow: var(--shadow-lg);
    color: var(--safari-ocre);
}

/* =========================================
   Panel Tabs Navigation
   ========================================= */

.panel-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(196, 163, 90, 0.15);
    padding: 0 var(--space-xs);
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}

.panel-tabs::-webkit-scrollbar {
    display: none;
}

.panel-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-xs) var(--space-xs);
    min-width: 44px;
    min-height: 44px;
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--safari-brun);
    opacity: 0.5;
    cursor: pointer;
    transition: all var(--transition-base);
}

.panel-tab svg {
    width: 18px;
    height: 18px;
}

.panel-tab:hover {
    opacity: 0.75;
}

.panel-tab--active {
    opacity: 1;
    border-bottom-color: var(--safari-ocre);
    color: var(--safari-ocre);
}

/* Hide tab labels on mobile — icons only */
.panel-tab-label {
    display: none;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* =========================================
   Panel Content
   ========================================= */

.panel-content {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-md);
    scrollbar-width: thin;
    scrollbar-color: var(--safari-ocre) transparent;
    overscroll-behavior: contain;
}

.panel-content::-webkit-scrollbar {
    width: 5px;
}

.panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
    background: var(--safari-ocre);
    border-radius: 3px;
}

.panel-content--active {
    display: flex;
}

/* Itinerary panel: day-cards handles its own padding and scroll */
.panel-content[data-panel-id="itinerary"] {
    padding: 0;
    overflow-y: hidden;
}

/* Day Cards Container */
.day-cards {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-sm);
    scrollbar-width: thin;
    scrollbar-color: var(--safari-ocre) transparent;
    overscroll-behavior: contain;
}

.day-cards::-webkit-scrollbar {
    width: 5px;
}

.day-cards::-webkit-scrollbar-track {
    background: transparent;
}

.day-cards::-webkit-scrollbar-thumb {
    background: var(--safari-ocre);
    border-radius: 3px;
}

/* =========================================
   Day Card
   ========================================= */

.day-card {
    background: white;
    border: 1px solid rgba(93, 64, 55, 0.08);
    border-radius: 12px;
    margin-bottom: var(--space-xs);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    animation: slideInCard var(--transition-slow) backwards;
}

@keyframes slideInCard {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.day-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--safari-ocre), var(--safari-accent));
    transform: scaleY(0);
    transform-origin: top;
    transition: transform var(--transition-base);
}

.day-card:hover::before,
.day-card.active::before {
    transform: scaleY(1);
}

.day-card:hover {
    border-color: rgba(196, 163, 90, 0.3);
    box-shadow: var(--shadow-md);
}

.day-card.active {
    background: linear-gradient(135deg, #FFFBF5 0%, #F5F0E1 100%);
    border-color: var(--safari-ocre);
    box-shadow: 0 4px 16px rgba(196, 163, 90, 0.2);
}

/* Day Card Summary (always visible row) */
.day-card-summary {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-md);
    min-height: 44px;
}

/* Day Card Number */
.day-card-number {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--safari-ocre) 0%, var(--safari-accent) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.day-card:hover .day-card-number,
.day-card.active .day-card-number {
    transform: scale(1.08);
    box-shadow: var(--shadow-md);
}

/* Day Card Content */
.day-card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.day-card-title {
    font-family: var(--font-display);
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--safari-brun);
    line-height: 1.25;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.7rem;
    color: var(--safari-brun);
    opacity: 0.6;
}

.day-card-distance {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--safari-vert);
    font-weight: 500;
    opacity: 1;
}

.day-card-distance svg {
    stroke: var(--safari-vert);
}

.day-card-accommodation {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chevron (expand indicator) */
.day-card-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    min-width: 24px;
    opacity: 0.3;
    transition: all var(--transition-base);
}

.day-card-chevron svg {
    stroke: var(--safari-ocre);
    transition: transform var(--transition-base);
}

.day-card:hover .day-card-chevron {
    opacity: 0.6;
}

.day-card.active .day-card-chevron {
    opacity: 1;
}

.day-card.expanded .day-card-chevron svg {
    transform: rotate(180deg);
}

/* =========================================
   Day Card Expanded Details
   ========================================= */

.day-card-details {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--transition-expand), opacity var(--transition-expand);
    opacity: 0;
}

.day-card.expanded .day-card-details {
    grid-template-rows: 1fr;
    opacity: 1;
}

.day-card-details-inner {
    overflow: hidden;
}

.day-card.expanded .day-card-details-inner {
    overflow-y: auto;
    max-height: 40vh;
    scrollbar-width: thin;
    scrollbar-color: var(--safari-ocre) transparent;
    padding-bottom: var(--space-xs);
}

.day-card-details-inner::-webkit-scrollbar {
    width: 4px;
}

.day-card-details-inner::-webkit-scrollbar-thumb {
    background: var(--safari-ocre);
    border-radius: 2px;
}

.detail-section {
    padding: 0 var(--space-md) var(--space-sm);
}

.detail-section:first-child {
    padding-top: 0;
    border-top: 1px solid rgba(196, 163, 90, 0.1);
    margin-top: 0;
    padding-top: var(--space-sm);
}

.detail-description {
    font-size: 0.788rem;
    line-height: 1.65;
    color: var(--safari-brun);
    opacity: 0.8;
    margin-top: var(--space-xs);
}

.detail-description p {
    margin: 0 0 0.4em;
}

.detail-description p:last-child {
    margin-bottom: 0;
}

.detail-heading {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-body);
    font-size: 0.675rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--safari-ocre);
    margin-bottom: var(--space-xs);
}

.detail-heading svg {
    stroke: var(--safari-ocre);
    flex-shrink: 0;
}

/* Activities */
.detail-activities {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.detail-activities li {
    font-size: 0.775rem;
    color: var(--safari-brun);
    padding-left: var(--space-md);
    position: relative;
    line-height: 1.4;
}

.detail-activities li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--safari-vert);
}

/* Wildlife Tags */
.detail-wildlife-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.wildlife-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: linear-gradient(135deg, rgba(107, 142, 35, 0.08), rgba(107, 142, 35, 0.15));
    border: 1px solid rgba(107, 142, 35, 0.2);
    border-radius: 20px;
    font-size: 0.675rem;
    font-weight: 500;
    color: var(--safari-vert);
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    cursor: default;
    text-overflow: ellipsis;
}

/* Highlights */
.detail-highlights {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.detail-highlights li {
    font-size: 0.775rem;
    color: var(--safari-brun);
    padding-left: var(--space-md);
    position: relative;
    line-height: 1.4;
}

.detail-highlights li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.35em;
    width: 6px;
    height: 6px;
    background: var(--safari-ocre);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* Accommodation detail */
.detail-accommodation {
    background: rgba(196, 163, 90, 0.05);
    border-radius: 8px;
    padding: var(--space-sm) var(--space-md) !important;
    margin: 0 var(--space-sm) var(--space-xs);
}

/* =========================================
   Image Gallery
   ========================================= */

.detail-gallery-section {
    padding: 0 !important;
}

.detail-gallery {
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(196, 163, 90, 0.1);
}

.detail-gallery-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
}

.detail-gallery-track::-webkit-scrollbar {
    display: none;
}

.detail-gallery-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

.detail-gallery-slide img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

/* Gallery Arrow Buttons — always visible on mobile (no hover) */
.detail-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(calc(-50% - 8px));
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 50%;
    color: var(--safari-brun);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    z-index: 2;
    opacity: 0.8;
}

.detail-gallery-arrow:hover {
    background: white;
    box-shadow: var(--shadow-md);
    color: var(--safari-ocre);
    opacity: 1;
}

.detail-gallery-prev {
    left: 6px;
}

.detail-gallery-next {
    right: 6px;
}

.detail-gallery-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: var(--space-xs) 0;
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
}

.detail-gallery-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(93, 64, 55, 0.2);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.detail-gallery-dot.active {
    background: var(--safari-ocre);
    border-color: var(--safari-ocre);
    transform: scale(1.2);
}

.detail-accommodation-name {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--safari-brun);
    margin-bottom: 0.25rem;
}

.detail-accommodation-desc {
    font-size: 0.725rem;
    line-height: 1.5;
    color: var(--safari-brun);
    opacity: 0.7;
}

/* =========================================
   Info Sections (collapsible)
   ========================================= */

.info-section {
    background: white;
    border: 1px solid rgba(93, 64, 55, 0.08);
    border-radius: 12px;
    margin-bottom: var(--space-xs);
    overflow: hidden;
    flex-shrink: 0;
}

.info-section-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    min-height: 44px;
}

.info-section-header h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--safari-brun);
    flex: 1;
    margin: 0;
}

.info-section-header svg {
    opacity: 0.3;
    transition: transform var(--transition-base);
    flex-shrink: 0;
}

.info-section-header:hover {
    background: rgba(196, 163, 90, 0.05);
}

.info-section-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--transition-expand);
}

.info-section--expanded .info-section-body {
    grid-template-rows: 1fr;
}

.info-section--expanded .info-section-header svg {
    transform: rotate(180deg);
}

.info-section--expanded .info-section-header {
    background: rgba(196, 163, 90, 0.05);
}

.info-section-content {
    overflow: hidden;
    padding: 0 var(--space-md);
    font-size: 0.788rem;
    line-height: 1.6;
    color: var(--safari-brun);
}

.info-section-content > :first-child {
    padding-top: var(--space-sm);
}

.info-section-content > :last-child {
    padding-bottom: var(--space-sm);
}

/* =========================================
   Info Components
   ========================================= */

/* Info List */
.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.info-list li {
    padding-left: var(--space-md);
    position: relative;
    line-height: 1.4;
}

.info-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--safari-vert);
}

/* Info Warning */
.info-warning {
    background: rgba(212, 132, 90, 0.1);
    border-left: 3px solid var(--safari-accent);
    border-radius: 0 8px 8px 0;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.775rem;
    margin: var(--space-xs) 0;
    display: flex;
    align-items: flex-start;
    gap: var(--space-xs);
}

.info-warning svg {
    flex-shrink: 0;
    stroke: var(--safari-accent);
    width: 16px;
    height: 16px;
    margin-top: 0.1em;
}

/* Info Key-Value */
.info-kv {
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: 0.375rem 0;
    border-bottom: 1px solid rgba(93, 64, 55, 0.06);
}

.info-kv:last-child {
    border-bottom: none;
}

.info-kv-key {
    opacity: 0.7;
}

.info-kv-value {
    font-weight: 500;
    text-align: right;
}

/* Info Table */
.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.725rem;
}

.info-table th {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.625rem;
    color: var(--safari-ocre);
    padding: var(--space-xs) var(--space-xs);
    border-bottom: 2px solid rgba(196, 163, 90, 0.2);
    text-align: left;
}

.info-table td {
    padding: var(--space-xs) var(--space-xs);
    border-bottom: 1px solid rgba(93, 64, 55, 0.06);
}

.info-table tr:last-child td {
    border-bottom: none;
}

/* =========================================
   Contact Card
   ========================================= */

.contact-card {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(93, 64, 55, 0.06);
}

.contact-card:last-child {
    border-bottom: none;
}

.contact-card a {
    color: var(--safari-ocre);
    text-decoration: none;
    font-weight: 500;
}

.contact-card a:hover {
    text-decoration: underline;
}

.contact-name {
    font-weight: 500;
}

.contact-lang {
    font-size: 0.675rem;
    background: rgba(107, 142, 35, 0.1);
    color: var(--safari-vert);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
}

/* =========================================
   Checklist
   ========================================= */

.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.25rem 0;
    font-size: 0.775rem;
}

.checklist-item::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--safari-ocre);
    border-radius: 3px;
    flex-shrink: 0;
}

.checklist-category {
    font-size: 0.675rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--safari-ocre);
    font-weight: 700;
    margin-top: var(--space-sm);
    margin-bottom: var(--space-xs);
}

/* =========================================
   Info Link
   ========================================= */

.info-link {
    color: var(--safari-ocre);
    text-decoration: none;
    border-bottom: 1px dashed rgba(196, 163, 90, 0.4);
}

.info-link:hover {
    border-bottom-style: solid;
}

.info-note {
    font-size: 0.725rem;
    color: var(--safari-brun);
    opacity: 0.6;
    margin-top: var(--space-sm);
    line-height: 1.5;
}

/* =========================================
   Custom Marker Styles
   ========================================= */

.safari-marker {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--safari-ocre) 0%, var(--safari-accent) 100%);
    border: 3px solid white;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    transition: all var(--transition-base);
    cursor: pointer;
}

.safari-marker:hover {
    transform: scale(1.2);
    box-shadow: var(--shadow-lg);
    z-index: 1000 !important;
}

.safari-marker.active {
    transform: scale(1.25);
    box-shadow: 0 0 0 4px rgba(196, 163, 90, 0.4), var(--shadow-lg);
    background: linear-gradient(135deg, var(--safari-vert) 0%, #7BA328 100%);
    border-color: white;
}

.safari-marker.highlighted {
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(196, 163, 90, 0.3), var(--shadow-lg);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(196, 163, 90, 0.3), var(--shadow-lg);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(196, 163, 90, 0.1), var(--shadow-lg);
    }
}

/* Route Line Styles */
.leaflet-interactive {
    stroke: var(--safari-ocre);
    stroke-width: 3;
    stroke-dasharray: 8, 8;
    stroke-linecap: round;
    opacity: 0.7;
    transition: all var(--transition-base);
}

.leaflet-interactive:hover {
    stroke-width: 4;
    opacity: 1;
}

/* =========================================
   Animations
   ========================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* =========================================
   TABLET — min-width: 768px
   Also applies on desktop devices (hover + fine pointer)
   to prevent mobile layout on narrow desktop viewports
   ========================================= */

@media (min-width: 768px), ((hover: hover) and (pointer: fine)) {
    :root {
        --banner-height: 56px;
        --panel-width: 350px;
    }

    .banner-content {
        gap: var(--space-md);
        padding: 0 var(--space-lg);
    }

    .banner-title {
        font-size: 1.25rem;
    }

    .banner-stat-value {
        font-size: 1.125rem;
    }

    .banner-divider {
        display: block;
    }

    .banner-stats {
        display: flex;
    }

    .banner-dates {
        display: block;
    }

    /* Panel becomes side-positioned overlay */
    .safari-panel {
        position: absolute;
        top: var(--space-md);
        left: var(--space-md);
        bottom: var(--space-md);
        right: auto;
        width: var(--panel-width);
        max-height: none;
        border-radius: 16px;
        border: 1px solid rgba(196, 163, 90, 0.2);
        border-bottom: 1px solid rgba(196, 163, 90, 0.2);
        box-shadow: var(--shadow-xl);
        transform: none;
        background: rgba(255, 251, 245, 0.92);
    }

    /* Disable bottom sheet states on tablet+ */
    .safari-panel.panel--peek,
    .safari-panel.panel--half,
    .safari-panel.panel--full {
        transform: none;
    }

    .safari-panel.collapsed {
        transform: translateX(calc(-100% - var(--space-md)));
        opacity: 0;
        pointer-events: none;
    }

    /* Hide bottom sheet handle on tablet+ */
    .bottom-sheet-handle {
        display: none;
    }

    /* Show panel toggle button */
    .panel-toggle {
        display: flex;
    }

    /* Show reopen button when collapsed */
    .safari-panel.collapsed ~ .panel-reopen {
        display: flex;
    }

    /* Panel header with more padding */
    .panel-header {
        padding: var(--space-md) var(--space-lg) var(--space-sm);
    }

    .panel-title {
        font-size: 1.375rem;
    }

    /* Show tab labels — wrap on two lines (4 + 3) */
    .panel-tab-label {
        display: block;
    }

    .panel-tab {
        padding: var(--space-sm) var(--space-xs);
        flex: 1 1 calc(100% / 4);
        min-width: 0;
    }

    .panel-tabs {
        padding: 0 var(--space-sm);
        flex-wrap: wrap;
        overflow-x: visible;
    }

    /* Day cards larger padding */
    .day-cards {
        padding: var(--space-md);
    }

    .day-card {
        margin-bottom: var(--space-sm);
    }

    .day-card-summary {
        gap: var(--space-md);
        padding: var(--space-md) var(--space-md) var(--space-md) var(--space-lg);
    }

    .day-card-number {
        width: 44px;
        height: 44px;
        min-width: 44px;
        font-size: 1.25rem;
    }

    .day-card-title {
        font-size: 1rem;
    }

    .day-card-meta {
        font-size: 0.75rem;
    }

    .day-card.expanded .day-card-details-inner {
        max-height: 50vh;
    }

    .detail-section {
        padding: 0 var(--space-lg) var(--space-md);
    }

    .detail-description {
        font-size: 0.813rem;
    }

    .detail-heading {
        font-size: 0.7rem;
    }

    .detail-activities li,
    .detail-highlights li {
        font-size: 0.8rem;
    }

    .wildlife-tag {
        font-size: 0.7rem;
    }

    .detail-gallery-slide img {
        height: 160px;
    }

    .detail-gallery-arrow {
        opacity: 0;
    }

    .detail-gallery:hover .detail-gallery-arrow {
        opacity: 1;
    }

    .detail-accommodation-name {
        font-size: 0.9rem;
    }

    .detail-accommodation-desc {
        font-size: 0.75rem;
    }

    /* Info sections */
    .info-section-header {
        padding: var(--space-md) var(--space-lg);
    }

    .info-section-header h3 {
        font-size: 1.1rem;
    }

    .info-section-content {
        padding: 0 var(--space-lg);
        font-size: 0.813rem;
    }

    .info-section-content > :last-child {
        padding-bottom: var(--space-md);
    }

    .info-warning {
        font-size: 0.8rem;
    }

    .info-table {
        font-size: 0.75rem;
    }

    .info-table th {
        font-size: 0.65rem;
        padding: var(--space-xs) var(--space-sm);
    }

    .info-table td {
        padding: var(--space-xs) var(--space-sm);
    }

    .checklist-item {
        font-size: 0.8rem;
    }

    .checklist-category {
        font-size: 0.7rem;
    }

    .contact-lang {
        font-size: 0.7rem;
    }

    .info-note {
        font-size: 0.75rem;
    }

    .detail-accommodation {
        margin: 0 var(--space-md) var(--space-sm);
        padding: var(--space-md) var(--space-lg) !important;
    }

    /* Popup */
    .safari-popup {
        padding: var(--space-lg);
    }

    .safari-popup-number {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .safari-popup-title {
        font-size: 1.25rem;
    }

    .safari-popup-info {
        font-size: 0.875rem;
    }

    .leaflet-popup-content {
        min-width: 280px;
    }

    .panel-content {
        padding: var(--space-md);
    }
}

/* =========================================
   DESKTOP — min-width: 1024px
   ========================================= */

@media (min-width: 1024px) {
    :root {
        --banner-height: 64px;
        --panel-width: 400px;
    }

    .banner-content {
        gap: var(--space-lg);
        padding: 0 var(--space-xl);
    }

    .banner-title {
        font-size: 1.5rem;
    }

    .banner-divider {
        height: 28px;
    }

    .banner-stat-value {
        font-size: 1.375rem;
    }

    .banner-stat-label {
        font-size: 0.75rem;
    }

    .banner-stat {
        gap: 0.375rem;
    }

    .banner-dates {
        display: block;
    }

    .banner-info {
        display: block;
    }

    /* Panel position tweaks */
    .safari-panel {
        top: var(--space-lg);
        left: var(--space-lg);
        bottom: var(--space-lg);
    }

    .safari-panel.collapsed {
        transform: translateX(calc(-100% - var(--space-lg)));
    }

    .panel-header {
        padding: var(--space-lg) var(--space-lg) var(--space-md);
    }

    .panel-subtitle {
        font-size: 0.8rem;
    }

    .panel-toggle {
        width: 32px;
        height: 32px;
    }
}

/* =========================================
   Print Styles
   ========================================= */

@media print {
    .safari-banner {
        position: relative;
        background: white;
        color: black;
        box-shadow: none;
    }

    .safari-panel {
        position: relative;
        width: 100%;
        box-shadow: none;
        transform: none;
    }

    .panel-toggle,
    .bottom-sheet-handle {
        display: none;
    }

    .day-card {
        page-break-inside: avoid;
    }

    .day-card-details {
        max-height: none;
        opacity: 1;
    }
}

/* =========================================
   Reduced Motion
   ========================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}