/*
 * Travel Agency: Tourister
 * Main CSS Styles
 */

:root {
    /* Color Palette */
    --primary: #0a4d68;        /* Deep Blue */
    --primary-light: #088395;
    --secondary: #ff7f50;      /* Coral Accent */
    --text-dark: #333333;
    --text-light: #666666;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #eeeeee;
    --success: #28a745;
    --danger: #dc3545;

    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Montserrat', sans-serif;

    /* Spacing & Borders */
    --container-width: 1200px;
    --radius: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-white);
    /* overflow-x: hidden breaks position:sticky for every descendant, so we
       use overflow-x: clip instead — same visual effect (no horizontal scroll)
       without the scroll-container side-effect. */
    overflow-x: clip;
    max-width: 100vw;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Layout Sections */
section {
    padding: 4rem 0;
}

/* Header & Navigation */
.header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.logo--image {
    padding: 0;
}
.logo--image img {
    display: block;
    max-height: 44px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    align-items: center;
}

/* Top-level list */
.nav-links > ul {
    display: flex;
    gap: 2rem;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    position: relative;
}

.nav-links a,
.nav-links .menu-parent > a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links .menu-parent > a:hover {
    color: var(--primary);
}

/* 1st-level dropdown — opens below the nav item (mirrors sandbox's ul ul) */
.nav-links .has-dropdown .dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 180px;
    width: max-content;
    padding: 0.5rem 0;
    z-index: 200;
    list-style: none;
    border: 1px solid var(--border-color);
}

/* 2nd-level flyout — opens to the right (mirrors sandbox's ul ul ul) */
.nav-links .dropdown .has-dropdown .dropdown {
    top: -0.5rem;
    left: 100%;
    margin-top: 0;
}

/* Items inside any dropdown */
.nav-links .has-dropdown .dropdown > li {
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}
.nav-links .has-dropdown .dropdown > li:last-child { border-bottom: none; }

.nav-links .has-dropdown .dropdown li a {
    display: block;
    padding: 0.55rem 1.1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-links .has-dropdown .dropdown li a:hover {
    background: var(--bg-light);
    color: var(--primary);
}

/* Nested parent item: show a right-arrow caret */
.nav-links .dropdown .has-dropdown > .menu-parent::after {
    content: '›';
    margin-left: auto;
    padding-left: 0.5rem;
    opacity: 0.6;
    font-size: 1rem;
}

/* Open dropdown on hover (desktop) */
.nav-links .has-dropdown:hover > .dropdown {
    display: block;
}

/* Open on checkbox toggle (mobile) */
.nav-links .submenu-toggle:checked ~ .dropdown {
    display: block;
}

/* Label wrapping the parent link (makes whole row clickable on mobile) */
.nav-links .menu-parent {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: var(--font-main);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--bg-white);
}

.btn-primary:hover {
    background-color: var(--primary-light);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--bg-white);
}

/* Hero Section */
.hero {
    height: 80vh;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.3)), url('https://images.unsplash.com/photo-1476514525535-07fb3b4ae5f1?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--bg-white);
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Service Grid Expansion */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); /* Smaller cards for more services */
    gap: 1.5rem;
}

.service-card i {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 1rem;
    display: block;
}

/* Row Headers */
.row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.row-header h2 {
    margin-bottom: 0;
}

.view-all {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

/* Home Blog Row */
.home-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-light);
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    background: var(--bg-white);
}

.service-card h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

/* Tour Cards */
.tour-grid {
    display: grid;
    /* min(350px, 100%) lets the track shrink below 350px when the viewport
       is narrower (e.g. 320px phones) instead of blowing out the layout. */
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap: 2rem;
}

/* Archive page uses denser cards (300px min) — same shrink trick. */
.tour-grid--archive {
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

.tour-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.tour-card:hover {
    transform: translateY(-5px);
}

/* Whole-card link variant — used on the homepage so clicking anywhere on
   the card navigates, not just the small button. */
.tour-card--link {
    display: block;
    color: inherit;
    text-decoration: none;
}
.tour-card--link h3 { color: var(--text-dark); }
.tour-card--link:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.tour-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 1rem;
}

.tour-image {
    height: 250px;
    position: relative;
}

.tour-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tour-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--secondary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tour-content {
    padding: 1.5rem;
}

.tour-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.tour-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Rating Stars — legacy (show page header) */
.rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}
.stars { color: #ffc107; font-size: 0.9rem; }
.rating-count { font-size: 0.8rem; color: var(--text-light); }

/* Tour card star rating — fractional fill via clip */
.tour-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 6px 0 10px;
    font-size: 13px;
}
.tour-stars {
    position: relative;
    display: inline-block;
    font-size: 15px;
    line-height: 1;
    letter-spacing: 1px;
}
.tour-stars__track {
    display: block;
    color: #e2e8f0; /* empty star colour */
}
.tour-stars__fill {
    position: absolute;
    left: 0; top: 0;
    overflow: hidden;
    white-space: nowrap;
    color: #f59e0b; /* filled star colour (amber-400) */
}
.tour-rating-value {
    font-weight: 700;
    color: var(--text);
}
.tour-rating-count {
    color: var(--text-light);
    font-size: 12px;
}

/* SEO Utilities */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Archive / Tours Page */
.archive-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.filter-sidebar {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    height: sticky;
    top: 100px;
}

/* Tablet & phone — sidebar stacks above the tour grid so the grid gets the
   full container width. Without this the 280px sidebar would crush the tour
   grid (which needs ~300px per card) at 320–375px viewports. */
@media (max-width: 992px) {
    .archive-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}
@media (max-width: 480px) {
    .filter-sidebar { padding: 1.25rem; }
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-group h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-option input {
    cursor: pointer;
}

/* Page Header */
.page-header {
    background: var(--primary);
    color: var(--bg-white);
    padding: 4rem 0;
    text-align: center;
}

.page-header h1 {
    margin-bottom: 0;
}

/* Transfers Page */
.booking-widget {
    background: var(--bg-white);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    max-width: 800px;
    margin: -50px auto 4rem;
    position: relative;
    z-index: 10;
}

.booking-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--bg-light);
}

.booking-tab {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.booking-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.booking-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    font-family: var(--font-main);
    font-size: 0.95rem;
    background: var(--bg-white);
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45,156,219,.12);
}
.form-group { margin-bottom: 1rem; }

.vehicle-options {
    margin-top: 3rem;
}

.vehicle-card {
    display: flex;
    gap: 2rem;
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    align-items: center;
}

.vehicle-img {
    width: 200px;
    height: 120px;
    object-fit: contain;
}

.vehicle-info {
    flex: 1;
}

/* Blog Page */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 2.5rem;
}

.blog-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.blog-card:hover {
    transform: translateY(-5px);
}

.blog-image {
    height: 200px;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-content {
    padding: 1.5rem;
}

.blog-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    display: flex;
    gap: 1rem;
}

.blog-content h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.sidebar-widget h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: var(--bg-white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

/* Single Post */
.post-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.75;
}

.post-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}

.post-content a:hover {
    color: var(--secondary);
    text-decoration: none;
}

.post-content p {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    line-height: 1.3;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
    list-style-position: outside;
}

.post-content ul { list-style-type: disc; }
.post-content ol { list-style-type: decimal; }

.post-content blockquote {
    border-left: 4px solid var(--primary, #2563eb);
    padding-left: 1.25rem;
    margin-left: 0;
    margin-right: 0;
    color: var(--text-light, #6b7280);
    font-style: italic;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius, 6px);
}

.post-content hr {
    border: 0;
    border-top: 1px solid var(--border-color, #e5e7eb);
    margin: 2rem 0;
}

/* Tables inside post content */
.post-content .table-responsive {
    width: 100%;
    overflow-x: auto;
    margin: 1.5rem 0;
    -webkit-overflow-scrolling: touch;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.post-content .table-responsive table { margin: 0; }

.post-content table th,
.post-content table td {
    border: 1px solid var(--border-color, #e5e7eb);
    padding: 10px 14px;
    text-align: left;
}

.post-content table th {
    background: var(--bg-light, #f9fafb);
    font-weight: 600;
}

.post-content table tbody tr:nth-child(even) { background: #fafafa; }
.post-content table tbody tr:hover { background: #f0f7ff; }

/* Clearfix for floated images */
.post-content::after {
    content: "";
    display: table;
    clear: both;
}

/* ==========================================================================
   Block Editor Layouts (mirrors sandbox style.css — keep in sync)
   ========================================================================== */

.block-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin: 1rem 0;
    width: 100%;
}

.block-col {
    position: relative;
    min-width: 0; /* prevent flex overflow */
}

@media (max-width: 768px) {
    .block-row { flex-direction: column; }
    .block-col { width: 100% !important; flex: 1 1 100% !important; }
}

/* Resizable images (alignment floats) */
.resizable-wrapper {
    display: block;
    position: relative;
    max-width: 100%;
    margin: 1rem 0;
}

.resizable-wrapper img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: top;
    margin: 0;
}

.resizable-wrapper.align-left  { float: left;  margin-right: 15px; margin-bottom: 10px; }
.resizable-wrapper.align-center { display: block; margin: 10px auto; text-align: center; }
.resizable-wrapper.align-right { float: right; margin-left: 15px;  margin-bottom: 10px; }

/* Embed blocks (video, iframe — 16:9) */
.embed-block { margin: 1.5rem 0; }

.embed-responsive {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.embed-responsive iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

.embed-block[data-provider="Twitter"] .embed-responsive {
    padding-bottom: 0;
    height: auto;
    background: transparent;
}

/* ==========================================================================
   End Block Editor Layouts
   ========================================================================== */

.post-header {
    text-align: center;
    margin-bottom: 3rem;
}

.post-featured-image {
    width: 100%;
    height: 450px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

/* Tour Detail Page */
.tour-info {
    min-width: 0;
}
.tour-detail-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
}

.itinerary-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
}

.itinerary-header {
    background: var(--bg-light);
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.itinerary-toggle {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}
.itinerary-toggle::before { content: '+'; }
.itinerary-item.open .itinerary-toggle::before { content: '−'; }

.itinerary-item.open .itinerary-header {
    border-bottom: 1px solid var(--border-color);
}

.itinerary-content {
    padding: 1.5rem;
    display: none;
}
.itinerary-item.open .itinerary-content { display: block; }

/* Aside stretches by default (grid `align-items: stretch`); we want that
   because position:sticky on a child can only stick for as long as its
   containing block is in view. The long left column (gallery/overview/
   itinerary) gives the sticky booking form plenty of track to scroll
   against. */
.tour-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.tour-related {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.booking-sidebar {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

/* Sticky opts-in via body.sticky-sidebar (Tour Settings toggle) and only on
   desktop — on tablet/phone the aside stacks under the info column, where
   sticky would just block content. */
@media (min-width: 1025px) {
    body.sticky-sidebar .booking-sidebar {
        position: sticky;
        top: 100px;
    }
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.gallery-item {
    height: 150px;
    border-radius: var(--radius);
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 992px) {
    .tour-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer */
.footer {
    background-color: var(--primary);
    color: var(--bg-white);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-heading {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsive */
/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 1.5rem;
}

.lang-switcher a {
    color: var(--text-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.lang-switcher a.active {
    color: var(--primary);
    background: var(--bg-light);
}

/* Standard Blog Layout */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    margin-top: 2rem;
}

.blog-main {
    /* Wide area for cards */
}

.blog-sidebar {
    /* Narrow area for widgets */
}

.blog-main .blog-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

@media (max-width: 992px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
}

/* ── Mobile nav ──────────────────────────────────────────────────── */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    flex-direction: column;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .header .nav-toggle { display: flex !important; }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: var(--shadow);
        z-index: 999;
    }
    .nav-links.open { display: block; }

    /* Stack menu items vertically on mobile */
    .nav-links > ul {
        flex-direction: column;
        gap: 0;
        padding: 0.75rem 0;
    }
    .nav-links li {
        width: 100%;
    }
    .nav-links a,
    .nav-links .menu-parent {
        display: block;
        padding: 0.65rem 1.5rem;
    }
    /* Show submenus inline on mobile */
    .nav-links .has-dropdown .dropdown {
        position: static;
        box-shadow: none;
        border-radius: 0;
        border-left: 3px solid var(--primary);
        margin-left: 1rem;
        padding: 0;
        display: none; /* still toggled by checkbox */
    }
    .nav-links .has-dropdown:hover .dropdown {
        display: none; /* disable hover on mobile */
    }
    .nav-links .submenu-toggle:checked ~ .dropdown {
        display: block;
    }

    .header-actions {
        display: none;
    }

    /* Guarantee header items fit on smallest devices */
    .container { padding: 0 0.75rem; }
    .nav { gap: 0.5rem; }
    .logo {
        font-size: 1.15rem;
        min-width: 0;
        flex: 1 1 auto;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .header .nav-toggle {
        flex: 0 0 auto;
        margin-left: auto;
    }
}

@media (max-width: 360px) {
    .container { padding: 0 0.5rem; }
    .logo { font-size: 1rem; }
}

/* ── Flash alert messages ────────────────────────────────────────── */
.alert {
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ── Booking inquiry: promo + referrer row ──────────────────────── */
.bk-codes {
    margin-top: 1rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.9rem;
}
.bk-codes__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}
.bk-codes__field { flex: 1 1 140px; min-width: 0; }
.bk-codes__apply { flex: 0 0 auto; }
.bk-codes__field label,
.bk-codes__apply label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.bk-codes__opt {
    font-weight: 400;
    color: var(--text-light);
    font-size: 0.8rem;
}
.bk-codes__field input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-transform: uppercase;
    font-family: monospace;
    letter-spacing: 0.05em;
    font-size: 0.95rem;
    line-height: 1.2;
    box-sizing: border-box;
}
.bk-codes__apply .btn {
    padding: 0.55rem 1rem;
    white-space: nowrap;
}
.bk-codes__feedback {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    display: none;
}

/* ── Session messages (CSS-only dismissible) ─────────────────────── */
.alert-wrap { margin-bottom: 1rem; }
.alert-toggle { position: absolute; opacity: 0; pointer-events: none; }
.msg {
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
}
.msg-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.msg-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-close {
    cursor: pointer;
    font-weight: bold;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 0.25rem;
    opacity: 0.55;
    user-select: none;
}
.alert-close:hover { opacity: 1; }
.alert-toggle:checked + .msg { display: none; }

/* ── Pagination ──────────────────────────────────────────────────── */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}
.pagination a:hover { background: var(--primary); color: white; }
.pagination .current-page { background: var(--primary); color: white; border-color: var(--primary); }

/* ── Language dropdown switcher ──────────────────────────────────── */
.lang-dropdown {
    position: relative;
}
.lang-current {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius);
    user-select: none;
    color: var(--text-dark);
}
.lang-current:hover { background: var(--bg-light); }
.caret { font-size: 0.7rem; opacity: 0.6; }
.lang-dropdown-list {
    display: none;
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 130px;
    padding: 0.4rem 0;
    z-index: 300;
    list-style: none;
    margin: 0;
}
.lang-dropdown-list li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
}
.lang-dropdown-list li a:hover {
    background: var(--bg-light);
    color: var(--primary);
}
/* Open on checkbox toggle */
#lang-toggle:checked ~ .lang-dropdown-list { display: block; }
.lang-dropdown:focus-within .lang-dropdown-list { display: block; }

/* ── Currency switcher ───────────────────────────────────────────── */
.curr-dropdown { position: relative; }
.curr-current {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius);
    user-select: none;
    color: var(--text-dark);
}
.curr-current:hover { background: var(--bg-light); }
.curr-symbol { font-size: 1rem; }
.curr-dropdown-list {
    display: none;
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 170px;
    padding: 0.4rem 0;
    z-index: 300;
    list-style: none;
    margin: 0;
}
.curr-dropdown-list li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
    white-space: nowrap;
}
.curr-dropdown-list li a:hover { background: var(--bg-light); color: var(--primary); }
.curr-dropdown-list li a.active { color: var(--primary); }
.curr-opt-symbol { width: 16px; text-align: center; font-size: 1rem; }
.curr-opt-name { font-weight: 400; color: var(--text-light); font-size: 0.8rem; margin-left: auto; }
#curr-toggle:checked ~ .curr-dropdown-list { display: block; }
.curr-dropdown:focus-within .curr-dropdown-list { display: block; }
.header-actions { display: flex; align-items: center; gap: 0.5rem; }

/* ── Floating buttons (scroll-to-top + admin edit) ───────────────── */
.floating-buttons {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
#scrollToTopBtn {
    display: none;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    transition: opacity .3s, transform .2s;
    align-items: center;
    justify-content: center;
}
#scrollToTopBtn:hover { transform: translateY(-2px); opacity: .9; }
.fab {
    display: flex;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    transition: transform .2s;
    text-decoration: none;
}
.fab:hover { transform: translateY(-2px); }
.fab-edit {
    background: #f59e0b;
    color: #fff;
}

/* ── Auth pages (login / signup / password) ──────────────────────── */
.login-wrapper {
    max-width: 420px;
    margin: 4rem auto;
    padding: 0 1rem;
}
.sidebar-box {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
    font-size: 1.5rem;
}
.login-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-light);
}
.login-link {
    color: var(--primary);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
}
.login-link:hover { color: var(--primary-light); text-decoration: underline; }
.btn-block {
    width: 100%;
    display: block;
    text-align: center;
    margin-top: 1rem;
    padding: 0.85rem;
    font-size: 1rem;
}

/* Password field with show/hide toggle */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
}
.password-field input {
    flex: 1;
    padding-right: 2.75rem !important;
}
.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    line-height: 1;
    transition: color 0.15s;
}
.password-toggle:hover { color: var(--primary); }

/* ── Booking widget ────────────────────────────────────────────────────── */
.bk-type-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}
.bk-type-tab {
    background: none;
    border: none;
    padding: 0.6rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.bk-type-tab:not(:last-child) { border-right: 1px solid var(--border-color); }
.bk-type-tab.active {
    background: var(--primary);
    color: #fff;
}
.bk-pane { display: none; }
.bk-pane.active { display: block; }

.bk-pax-stepper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 4px;
}
.bk-pax-btn {
    width: 40px;
    flex-shrink: 0;
    background: var(--bg-light);
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.55rem 0;
    color: var(--text);
    transition: background 0.15s;
}
.bk-pax-btn:hover:not(:disabled) { background: var(--border-color); }
.bk-pax-btn:disabled { opacity: .4; cursor: default; }
.bk-pax-stepper input[type="number"] {
    flex: 1;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.55rem 0;
    background: #fff;
    -moz-appearance: textfield;
}
.bk-pax-stepper input[type="number"]::-webkit-outer-spin-button,
.bk-pax-stepper input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

.bk-price-summary {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
}
.bk-price-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 6px;
}
.bk-price-total {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 1.4rem;
    color: var(--text);
}
.bk-price-total strong { font-weight: 800; }
.bk-price-sep { color: var(--text-light); }
.bk-pax-hint {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}
.bk-no-price {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 13px;
    color: var(--text-light);
    margin-top: 0.5rem;
    text-align: center;
}

/* ── Gallery lightbox ─────────────────────────────────────────────────── */
#lb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
#lb-img-wrap {
    max-width: 90vw;
    max-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
#lb-img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    cursor: zoom-out;
}
#lb-close {
    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: .8;
    transition: opacity .15s;
}
#lb-close:hover { opacity: 1; }
#lb-prev, #lb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
#lb-prev { left: 1.25rem; }
#lb-next { right: 1.25rem; }
#lb-prev:hover, #lb-next:hover { background: rgba(255,255,255,.25); }
#lb-counter {
    color: rgba(255,255,255,.65);
    font-size: 13px;
    margin-top: 0.75rem;
}
/* Make main gallery image look clickable */
.tour-gallery__main img { cursor: zoom-in; }

/* ── Contact — booking inquiry summary ────────────────────────────────── */
.bk-inquiry-summary {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.bk-inquiry-summary__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #2563eb;
    margin-bottom: 0.9rem;
}
.bk-inquiry-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 5px 0;
    border-bottom: 1px solid #dbeafe;
    font-size: 14px;
}
.bk-inquiry-row:last-child { border-bottom: none; }
.bk-inquiry-row span { color: var(--text-light); }
.bk-inquiry-total { font-size: 1.1rem; color: var(--primary); }

/* ── Tour detail — media tabs ──────────────────────────────────────────── */
.tour-media-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 2px solid var(--border-color);
}
.tour-media-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.tour-media-tab.active,
.tour-media-tab:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tour-media-pane { display: none; }
.tour-media-pane.active,
.tour-media-pane.no-tabs { display: block; }

/* ── Tour detail — gallery with main + thumbnails ──────────────────────── */
.tour-gallery {
    margin-bottom: 2rem;
}
.tour-gallery__main {
    width: 100%;
    aspect-ratio: 1200 / 800;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-light);
    margin-bottom: 0.6rem;
}
.tour-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}
.tour-gallery__thumbs-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}
.tour-gallery__thumbs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    /* Hide scrollbar but keep functionality */
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: 4px; /* small buffer */
    flex: 1;
}
.tour-gallery__thumbs::-webkit-scrollbar {
    display: none;
}
.tour-gallery__arrow {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    flex-shrink: 0;
    box-shadow: var(--shadow);
    font-size: 1.5rem;
    line-height: 1;
    transition: var(--transition);
}
.tour-gallery__arrow:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.tour-gallery__arrow:disabled {
    opacity: 0.3;
    cursor: default;
}
.tour-gallery__thumb {
    width: 80px;
    height: 53px; /* Fixed height based on 80px width and 1200/800 ratio */
    border-radius: calc(var(--radius) - 2px);
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    background: none;
    cursor: pointer;
    transition: border-color 0.15s, opacity 0.15s;
    flex: 0 0 80px; /* Do not grow, do not shrink, fixed at 80px */
}
.tour-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tour-gallery__thumb.active {
    border-color: var(--primary);
}
.tour-gallery__thumb:not(.active):hover {
    opacity: 0.8;
    border-color: var(--border-color);
}

/* ── Tour detail — video embed 16:9 ───────────────────────────────────── */
.tour-video-embed,
.tour-map-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: #f0f2f5;
    margin-bottom: 2rem;
}
.tour-video-embed {
    background: #000;
}
.tour-video-embed iframe,
.tour-map-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ==========================================================================
   Mobile responsiveness — consolidated breakpoints
   ========================================================================== */

/* Tablet ≤ 992px */
@media (max-width: 992px) {
    .hero { height: auto; min-height: 60vh; padding: 4rem 0; }
    .hero-content h1 { font-size: 2.5rem; }
    .hero-content p { font-size: 1.1rem; }

    /* Tour-single sidebar already collapses via .tour-detail-grid (set above
       at 992px). Make sure related-tours card and booking-sidebar use full
       width and aren't sticky on the small layout. */
    .tour-sidebar { gap: 1.5rem; }
}

/* Phone ≤ 768px */
@media (max-width: 768px) {
    section { padding: 3rem 0; }
    .page-header { padding: 2.5rem 0; }
    .page-header h1 { font-size: 1.75rem; }

    .hero { min-height: 50vh; padding: 3rem 0; }
    .hero-content h1 { font-size: 2rem; line-height: 1.2; }
    .hero-content p { font-size: 1rem; }
    .hero-btns { flex-wrap: wrap; }
    .hero-btns .btn { flex: 1 1 auto; min-width: 0; }

    /* Row headers (home page section heads) — wrap so "View all" doesn't get
       squeezed off-screen next to long titles. */
    .row-header { flex-wrap: wrap; gap: 0.75rem; }

    /* Transfers — booking widget */
    .booking-widget { padding: 1.5rem; margin: -30px 1rem 3rem; }
    .booking-tabs { flex-wrap: wrap; gap: 0; }
    .booking-tab { flex: 1 1 auto; padding: 0.75rem 0.75rem; font-size: 0.9rem; text-align: center; }
    .booking-form { grid-template-columns: 1fr; gap: 1rem; }

    /* Transfers — vehicle list */
    .vehicle-card {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
        text-align: left;
    }
    .vehicle-img { width: 100%; height: 180px; object-fit: cover; border-radius: var(--radius); }
    .vehicle-card .vehicle-price { text-align: left !important; }

    /* Tour-single — dense info pills (rendered with inline style 1fr 1fr) */
    .tour-info > .overview > div[style*="grid-template-columns:1fr 1fr"],
    .tour-info > .overview > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Contact form — name/email row collapses to single column on mobile */
    .contact-form form > div[style*="grid-template-columns:1fr 1fr"],
    .contact-form form > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    /* Checkout — your-details (name/email) row */
    .checkout-form section > div[style*="grid-template-columns:1fr 1fr"],
    .checkout-form section > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Booking sidebar (tour-single) — drop heavy padding on phones */
    .booking-sidebar { padding: 1.25rem; }

    /* Gallery on tour-single (3-col) → 2-col on phones */
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }

    /* Tours archive — sort dropdown + count line wraps cleanly */
    .tour-results .results-header { flex-wrap: wrap; gap: 0.75rem; }

    /* Show currency + language switchers inside the open hamburger menu so
       mobile users keep access to them. The default rule above hid them.
       The .nav-links dropdown is itself position:absolute;top:100%, so we
       stack .header-actions just under it as a sibling absolute panel. */
    .nav-links.open ~ .header-actions {
        display: flex;
        position: absolute;
        top: 100%;
        right: 0;
        background: white;
        padding: 0.6rem 1rem;
        border-bottom-left-radius: var(--radius);
        box-shadow: var(--shadow);
        z-index: 1001;
        gap: 0.75rem;
        flex-wrap: wrap;
        margin-right: 0;
    }
    /* Header-actions inner switchers shouldn't keep their right margin in this
       compact panel. */
    .nav-links.open ~ .header-actions .lang-switcher { margin-right: 0; }
}

/* Small phone ≤ 480px */
@media (max-width: 480px) {
    .container { padding: 0 1rem; }

    .hero-content h1 { font-size: 1.65rem; }
    .hero-content p { font-size: 0.95rem; }
    .hero-btns { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    .hero-btns .btn { text-align: center; }

    .page-header { padding: 2rem 0; }
    .page-header h1 { font-size: 1.5rem; }

    .booking-widget { padding: 1rem; margin: -20px 0.5rem 2rem; border-radius: var(--radius); }
    .booking-tab { font-size: 0.85rem; padding: 0.6rem 0.5rem; }

    /* Tour card content — tighten footer so price + button fit one line */
    .tour-content { padding: 1.25rem; }
    .tour-card .tour-footer { flex-wrap: wrap; gap: 0.5rem; }
    .tour-card .tour-footer .btn { flex: 1 1 auto; text-align: center; }

    /* Filter sidebar fits cleanly */
    .filter-group h4 { font-size: 0.95rem; }

    /* Pagination — chip padding */
    .pagination a, .pagination span { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
}

/* Very small ≤ 360px (tighten further so 320–360px iPhone SE-class devices
   still render the tours grid and core forms without overflow). */
@media (max-width: 360px) {
    .tour-image { height: 200px; }
    .booking-tabs { font-size: 0.8rem; }
    .booking-tab { padding: 0.5rem 0.4rem; }
    .filter-sidebar { padding: 1rem; }
}
