/* ==========================================================================
   KhmerRide Responsive Stylesheet (screen.css)
   Handles all mobile, tablet, and responsive screen viewports.
   ========================================================================== */

/* Global variable adjustments on smaller screens */
html {
  overflow-x: hidden;
}

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

.container,
.grid-2,
.grid-2 > *,
.custom-form,
.info-card {
  min-width: 0;
}

@media (max-width: 768px) {
  :root {
    --gutter: 20px;
  }
}

@media (max-width: 480px) {
  :root {
    --gutter: 16px;
  }
}

/* --------------------------------------------------------------------------
   Toggle checkbox and label styling hidden on desktop
   -------------------------------------------------------------------------- */
.nav-toggle {
  display: none;
}
.nav-toggle-label {
  display: none;
}
.nav-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .nav {
    height: 68px;
    padding: 0;
  }
  .nav .container {
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    gap: 0;
  }
  
  .nav-logo {
    order: 1;
    min-width: 0;
    font-size: 24px;
    letter-spacing: 2px;
    white-space: nowrap;
  }
  .nav-logo .logo-sub {
    font-size: 9px;
    margin-left: 6px;
    padding-left: 6px;
  }

  .nav-call {
    order: 2;
    margin-left: auto;
    margin-right: 16px;
    padding: 8px 16px;
    font-size: 12px;
    gap: 6px;
  }

  /* Show hamburger button label */
  .nav-toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    cursor: pointer;
    order: 3;
    position: relative;
    z-index: 1001;
  }
  
  /* Draw the three hamburger lines */
  .nav-toggle-label span,
  .nav-toggle-label span::before,
  .nav-toggle-label span::after {
    display: block;
    background: #0a0a0a;
    height: 2px;
    width: 22px;
    position: absolute;
    transition: transform 0.3s ease, background 0.3s ease, top 0.3s ease;
  }
  
  .nav-toggle-label span::before {
    content: '';
    top: -6px;
  }
  
  .nav-toggle-label span::after {
    content: '';
    top: 6px;
  }
  
  /* Animate to X close symbol when checked */
  .nav-toggle:checked ~ .nav-toggle-label span {
    background: transparent;
  }
  
  .nav-toggle:checked ~ .nav-toggle-label span::before {
    transform: rotate(45deg);
    top: 0;
  }
  
  .nav-toggle:checked ~ .nav-toggle-label span::after {
    transform: rotate(-45deg);
    top: 0;
  }

  /* Backdrop overlay */
  .nav-backdrop {
    display: block;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 998;
  }
  
  .nav-toggle:checked ~ .nav-backdrop {
    opacity: 1;
    visibility: visible;
  }

  /* Nav Menu Drawer Overlay */
  .nav-menu {
    position: fixed;
    top: 68px; /* Below the navbar */
    left: -100%;
    width: 280px;
    height: calc(100vh - 68px);
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 32px var(--gutter);
    gap: 20px;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.08);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    margin: 0;
    overflow-y: auto;
    border-right: 1px solid rgba(10, 10, 10, 0.05);
    display: flex;
  }
  
  /* Slide out menu when checked */
  .nav-toggle:checked ~ .nav-menu {
    left: 0;
  }
  
  .nav-menu li {
    width: 100%;
    flex-shrink: 0;
  }
  
  .nav-menu a {
    font-size: 15px;
    font-weight: 600;
    padding: 10px 0;
    display: block;
    width: 100%;
    border-bottom: 1px solid rgba(10, 10, 10, 0.05);
    color: rgba(10, 10, 10, 0.65);
    background: none !important;
    border-radius: 0 !important;
    letter-spacing: 0.5px;
  }
  
  .nav-menu a:hover {
    color: #e8b84b;
  }
  
  .nav-menu a[style*="color"] {
    color: #e8b84b !important;
    border-bottom-color: rgba(232, 184, 75, 0.3);
  }
}

@media (max-width: 560px) {
  .nav-call {
    width: 38px;
    height: 38px;
    justify-content: center;
    padding: 0;
    font-size: 0;
    margin-right: 12px;
    flex-shrink: 0;
  }
  .nav-call i {
    font-size: 18px !important;
  }
}

@media (max-width: 380px) {
  .nav-logo {
    font-size: 21px;
    letter-spacing: 1.5px;
  }
  .nav-logo .logo-sub {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   2. HERO SECTION (.hero)
   Stacks the layout, updates font sizes, and adjusts heights
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .hero-left {
    padding: 56px var(--gutter);
    align-items: center;
    text-align: center;
  }
  .hero-left::after {
    display: none; /* Disable the desktop skew angle separator */
  }
  .hero h1 {
    font-size: clamp(38px, 7vw, 60px);
    margin-bottom: 20px;
  }
  .hero p {
    margin: 0 auto 28px;
    max-width: 480px;
  }
  .hero-btns {
    justify-content: center;
    width: 100%;
  }
  .hero-badge {
    position: static;
    margin-top: 24px;
    justify-content: center;
  }
  .hero-right {
    height: 320px;
  }
}

@media (max-width: 480px) {
  .hero-btns {
    flex-direction: column;
    gap: 10px;
  }
  .btn-primary, .btn-ghost {
    width: 100%;
    text-align: center;
  }
  .hero-right {
    height: 240px;
  }
}

/* --------------------------------------------------------------------------
   3. BOOKING STRIP (.book-strip)
   Stacks booking fields gracefully
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .book-strip {
    grid-template-columns: 1fr 1fr;
    padding: 12px var(--gutter);
    gap: 12px;
    margin: 0 var(--gutter);
    border-radius: 4px;
  }
  .book-field {
    border-right: none;
    border-bottom: 1px solid rgba(10, 10, 10, 0.1);
    padding: 10px 0;
  }
  .book-btn {
    grid-column: span 2;
    padding: 16px;
    text-align: center;
    font-size: 18px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .book-strip {
    grid-template-columns: 1fr;
    margin: 16px var(--gutter) 0;
  }
  .book-field:last-of-type {
    border-bottom: none;
  }
  .book-btn {
    grid-column: span 1;
  }
}

/* --------------------------------------------------------------------------
   4. STATS/NUMBERS (.numbers)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .numbers {
    grid-template-columns: repeat(2, 1fr);
  }
  .num-item {
    padding: 24px var(--gutter);
    border-right: none;
    border-bottom: 1px solid rgba(10, 10, 10, 0.08);
  }
  .num-item:nth-child(odd) {
    border-right: 1px solid rgba(10, 10, 10, 0.08);
  }
  .num-item:nth-child(3), .num-item:nth-child(4) {
    border-bottom: none;
  }
}

@media (max-width: 480px) {
  .num-val {
    font-size: 44px;
  }
  .num-label {
    font-size: 11px;
  }
}

/* --------------------------------------------------------------------------
   5. POPULAR ROUTES (.routes-grid)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .routes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .routes-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   6. FLEET GRID (.fleet-grid)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .fleet-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    background: transparent;
  }
}

@media (max-width: 768px) {
  .fleet-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .fleet-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin: 0;
    margin-bottom: 20px;
    padding: 16px;
    background: #f5f6f8;
    border-radius: 4px;
  }
  .fleet-card {
    padding: 24px;
  }
}

/* --------------------------------------------------------------------------
   7. PROCESS/STEPS (.process-grid)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .process-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .process-grid::before {
    display: none; /* Remove desktop connector line */
  }
  .step {
    position: relative;
    padding-left: 56px;
  }
  .step-circle {
    position: absolute;
    left: 0;
    top: -4px;
    margin-bottom: 0;
  }
}

/* --------------------------------------------------------------------------
   8. REVIEWS (.reviews-grid)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .reviews-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .review-big {
    padding: 24px;
  }
  .review-small {
    padding: 24px;
  }
}

/* --------------------------------------------------------------------------
   9. CTA BAR (.cta-bar)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .cta-bar {
    flex-direction: column;
    text-align: center;
    padding: 40px var(--gutter);
  }
  .cta-bar h2 {
    font-size: 38px;
  }
  .cta-actions {
    width: 100%;
    flex-direction: column;
    gap: 12px;
  }
  .cta-btn {
    width: 100%;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   10. FOOTER (.footer)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
  .footer-desc {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
}

/* --------------------------------------------------------------------------
   11. SECTION HEADERS & GENERAL UTILITIES
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 32px;
  }
  .section-title {
    font-size: 36px !important;
  }
  .page-header {
    padding: 80px var(--gutter) 48px;
  }
  .page-header h1 {
    font-size: clamp(42px, 15vw, 64px);
    line-height: 0.95;
  }
  .page-header p {
    font-size: 15px;
  }
  .page-section, .page-section-dark {
    padding: 56px 0;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 32px !important;
  }
  .page-header {
    padding: 64px var(--gutter) 40px;
  }
  .page-section,
  .page-section-dark {
    padding: 44px 0;
  }
}

/* --------------------------------------------------------------------------
   12. SUBPAGES INLINE GRIDS AND SPECIFIC OVERRIDES
   Targeting inline grids by giving them CSS rules with !important or class hooks
   -------------------------------------------------------------------------- */

/* Responsive classes for the inline styled grids in HTML files */
.tour-packages-grid,
.guides-grid-4,
.guides-grid-2,
.benefits-grid,
.features-grid-2 {
  display: grid !important;
}

/* 4-column guide grid (Visas, Money, etc.) on Travel Guides page */
@media (max-width: 992px) {
  .guides-grid-4 {
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
  }
}
@media (max-width: 600px) {
  .guides-grid-4 {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* 2-column guide/packages grids on Travel Guides & Private Tours */
@media (max-width: 768px) {
  .guides-grid-2,
  .tour-packages-grid,
  .features-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .svc {
    padding: 24px !important;
  }
}

/* Private Tours now uses photo destination cards instead of the old inline price grid. */
.tour-packages-grid {
  display: none !important;
}

@media (max-width: 992px) {
  .tour-destination-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tour-page-layout {
    grid-template-columns: 1fr;
  }
  .tour-sidebar {
    position: static;
  }
  .tour-detail-head {
    flex-direction: column;
  }
  .tour-rate-note {
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .tour-destination-grid,
  .tour-option-grid,
  .tour-itinerary-list,
  .tour-inclusion-grid {
    grid-template-columns: 1fr;
  }
  .tour-destination-card {
    min-height: 260px;
  }
  .tour-detail-panel {
    padding: 22px;
  }
  .tour-detail-head h3 {
    font-size: 34px;
  }
  .tour-content-block h3 {
    font-size: 32px;
  }
  .tour-sidebar-panel,
  .tour-itinerary-card {
    padding: 20px;
  }
}

/* 3-column benefits grid on City to City page */
@media (max-width: 992px) {
  .benefits-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
  }
}
@media (max-width: 768px) {
  .benefits-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

/* Keep tables in normal flow on desktop; enable horizontal scroll only on small screens. */
.table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: visible;
  margin: 20px 0;
  border: 1px solid rgba(10, 10, 10, 0.08);
  background: #fff;
  border-radius: 4px;
}
.price-table {
  margin: 0 !important;
  min-width: 0;
}

@media (max-width: 768px) {
  .table-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin: 18px 0 28px;
  }
  .price-table {
    min-width: 560px; /* Keep columns readable; wrapper handles horizontal scroll. */
  }
  .price-table th,
  .price-table td {
    padding: 14px 16px;
    white-space: nowrap;
  }
}

/* --------------------------------------------------------------------------
   SEARCH WIDGET — Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .sw-tabs { overflow-x: auto; }
  .sw-tab { padding: 14px 16px; font-size: 13px; white-space: nowrap; }
  .sw-tab i { font-size: 17px; }
  .sw-row { flex-direction: column; gap: 8px; }
  .sw-field { min-height: 48px; }
  .sw-btn { min-height: 48px; width: 100%; }
  .sw-subtabs { flex-wrap: wrap; }
}

/* --------------------------------------------------------------------------
   13. BOOKING FORM (.custom-form) — Mobile
   Reduces padding so form content isn't cramped on narrow screens.
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .custom-form {
    padding: 28px 24px;
    width: 100%;
  }
  .form-title {
    font-size: 28px;
    margin-bottom: 20px;
  }
  .form-control {
    width: 100%;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .info-card {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .custom-form {
    padding: 20px 16px;
  }
  .form-title {
    font-size: 24px;
  }
  .form-btn {
    padding: 13px 16px;
    font-size: 18px;
  }
  .info-card {
    padding: 20px;
  }
  .footer-social {
    justify-content: center;
  }
}
