/* ==========================================================================
   TO LIBYA - DEDICATED MOBILE & RESPONSIVE STYLESHEET (mobile.css)
   Completely optimized for world-class mobile user experience (UX/UI)
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. GLOBAL MOBILE RESETS & NUMBER SPINNER REMOVAL
   -------------------------------------------------------------------------- */
html,
body {
  max-width: 100vw;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* Completely remove native number input spinner buttons across all browsers */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
  display: none !important;
}

input[type="number"] {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

/* Prevent auto-zooming on iOS Safari when tapping inputs (>= 16px font size) */
@media screen and (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Tactile touch feedback for mobile buttons & interactive cards */
@media (hover: none) and (pointer: coarse) {
  .btn:active,
  .preset-chip:active,
  .gender-option-card:active,
  .route-card-item:active,
  .method-card:active,
  .floating-action-btn:active,
  .footer-link:active {
    transform: scale(0.97) !important;
    transition: transform 0.1s ease !important;
  }
}

/* --------------------------------------------------------------------------
   02. CONTAINER & GENERAL SPACING ON MOBILE (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .container {
    padding-inline: 16px !important;
  }

  .section {
    padding-block: 36px !important;
  }

  .section-header {
    margin-bottom: 22px !important;
  }

  .section-title {
    font-size: 1.6rem !important;
    line-height: 1.3 !important;
  }

  .section-subtitle {
    font-size: 0.92rem !important;
    line-height: 1.6 !important;
  }
}

/* --------------------------------------------------------------------------
   03. HEADER & NAVIGATION ON MOBILE
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .header-container {
    height: 60px !important;
    padding-inline: 14px !important;
  }

  .brand-logo-emblem {
    width: 36px !important;
    height: 36px !important;
  }

  .brand-logo-title {
    font-size: 1.3rem !important;
  }

  .brand-logo-subtitle {
    font-size: 0.68rem !important;
  }

  .theme-toggle-btn,
  .hamburger-btn {
    width: 40px !important;
    height: 40px !important;
  }
}

/* --------------------------------------------------------------------------
   04. HERO SECTION ON MOBILE - BUTTONS STRICTLY SIDE BY SIDE
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .hero-section {
    min-height: calc(100svh - 60px) !important;
    padding-block: 16px 20px !important;
  }

  .hero-grid {
    gap: 18px !important;
  }

  .hero-content {
    gap: 12px !important;
    text-align: right !important;
  }

  .hero-badge-wrap {
    margin-bottom: 2px !important;
  }

  .hero-badge {
    font-size: 0.76rem !important;
    padding: 5px 12px !important;
    line-height: 1.4 !important;
  }

  .hero-title {
    font-size: clamp(1.7rem, 6.5vw, 2.25rem) !important;
    line-height: 1.26 !important;
  }

  .hero-description {
    font-size: 0.9rem !important;
    line-height: 1.62 !important;
  }

  /* HERO BUTTONS STRICTLY SIDE-BY-SIDE ON MOBILE */
  .hero-cta-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 8px !important;
  }

  .hero-cta-group .btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    min-height: 44px !important;
    padding: 10px 8px !important;
    font-size: 0.84rem !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 6px !important;
    box-sizing: border-box !important;
  }

  .hero-cta-group .btn svg {
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0 !important;
  }

  /* Hero Trust Bar on Mobile */
  .hero-trust-bar {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-top: 8px !important;
    padding-top: 8px !important;
  }

  .trust-stat-item {
    padding: 6px 8px !important;
    gap: 8px !important;
  }

  .trust-stat-icon {
    width: 28px !important;
    height: 28px !important;
  }

  .trust-stat-icon svg {
    width: 15px !important;
    height: 15px !important;
  }

  .trust-stat-value {
    font-size: 0.86rem !important;
  }

  .trust-stat-label {
    font-size: 0.68rem !important;
  }
}

/* Ultra small mobile screens (e.g. iPhone SE, <= 380px) */
@media (max-width: 380px) {
  .hero-cta-group {
    gap: 6px !important;
  }

  .hero-cta-group .btn {
    font-size: 0.76rem !important;
    padding: 9px 5px !important;
    gap: 4px !important;
    min-height: 42px !important;
  }

  .hero-cta-group .btn svg {
    width: 13px !important;
    height: 13px !important;
  }
}

/* --------------------------------------------------------------------------
   05. FINDER SECTION (محدد المسار) ON MOBILE
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .finder-card {
    padding: 18px 14px !important;
    border-radius: 16px !important;
  }

  /* Smooth Horizontal Scroll for Presets on Mobile */
  .finder-presets-bar {
    margin-bottom: 14px !important;
  }

  .presets-title {
    font-size: 0.76rem !important;
    margin-bottom: 6px !important;
  }

  .presets-pills-wrap {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 8px !important;
    padding-bottom: 6px !important;
  }

  .presets-pills-wrap::-webkit-scrollbar {
    display: none !important;
  }

  .preset-chip {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 6px 12px !important;
    font-size: 0.78rem !important;
    border-radius: 9999px !important;
  }

  /* Form Layout */
  .finder-form-grid,
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 13px !important;
  }

  .gender-options-grid,
  .pill-group {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .gender-option-card,
  .pill-content {
    min-height: 48px !important;
    padding: 10px 10px !important;
    font-size: 0.92rem !important;
    border-radius: 10px !important;
    justify-content: center !important;
  }

  .form-input,
  .form-select {
    min-height: 46px !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
  }

  .btn-submit {
    min-height: 48px !important;
    padding: 11px 18px !important;
    font-size: 0.98rem !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35) !important;
  }

  /* Result Card on Mobile */
  .result-card {
    padding: 18px 14px !important;
    border-radius: 16px !important;
    margin-top: 16px !important;
  }

  .result-status-title {
    font-size: 1.25rem !important;
  }

  .result-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 9px !important;
    width: 100% !important;
  }

  .result-actions .btn {
    width: 100% !important;
    min-height: 46px !important;
    border-radius: 10px !important;
  }
}

/* --------------------------------------------------------------------------
   06. TRAVEL METHODS & DESTINATION CARDS ON MOBILE
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .travel-methods-grid,
  .methods-grid,
  .features-grid,
  .airports-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .method-card,
  .airport-card,
  .feature-box {
    padding: 16px 14px !important;
    border-radius: 14px !important;
  }

  /* Destination Routes Grid */
  .routes-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .route-card-item {
    padding: 16px 14px !important;
    border-radius: 14px !important;
  }

  /* Overland Travel Section */
  .land-card-layout {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 18px 14px !important;
    border-radius: 16px !important;
  }

  .customs-box {
    padding: 14px !important;
  }

  .fees-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .fee-item {
    padding: 10px 8px !important;
  }

  .fee-amount {
    font-size: 1.25rem !important;
  }

  /* Family Card */
  .family-card {
    padding: 18px 14px !important;
    border-radius: 16px !important;
  }

  .family-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .family-title {
    font-size: 1.55rem !important;
  }

  /* Family Badges Equal & Single Line on Mobile */
  .family-badge-wrap {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 2px !important;
    width: fit-content !important;
  }

  .badge-cairo-only,
  .family-badge-wrap .section-tag {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 5px 12px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    width: fit-content !important;
    margin: 0 !important;
    line-height: 1 !important;
    border-radius: 9999px !important;
  }

  .badge-cairo-only svg {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0 !important;
  }

  .family-docs-box {
    padding: 14px !important;
  }

  .family-cta-group,
  .land-cta-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 9px !important;
    width: 100% !important;
  }

  .family-cta-group .btn,
  .land-cta-group .btn {
    width: 100% !important;
    min-height: 46px !important;
    border-radius: 10px !important;
  }
}

/* Tablet view adjustment (480px to 768px) */
@media (min-width: 480px) and (max-width: 768px) {
  .routes-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .family-cta-group,
  .land-cta-group {
    flex-direction: row !important;
  }

  .family-cta-group .btn,
  .land-cta-group .btn {
    flex: 1 1 0 !important;
  }
}

/* --------------------------------------------------------------------------
   07. FINAL CTA BANNER ON MOBILE
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .final-cta-card {
    padding: 24px 16px !important;
    border-radius: 18px !important;
  }

  .final-cta-title {
    font-size: 1.5rem !important;
  }

  .final-cta-desc {
    font-size: 0.9rem !important;
  }

  .final-cta-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 9px !important;
    width: 100% !important;
  }

  .final-cta-buttons .btn {
    width: 100% !important;
    min-height: 46px !important;
    border-radius: 10px !important;
  }
}

/* --------------------------------------------------------------------------
   08. COMPACT & HIGH-UX MOBILE FOOTER (صغر الفوتر في الموبايل)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .footer {
    padding-top: 24px !important;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; /* Prevents floating buttons from covering content */
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .footer-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    text-align: center !important;
  }

  /* Footer Brand & Description */
  .footer-brand {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 6px !important;
  }

  .footer-brand .brand-logo {
    justify-content: center !important;
  }

  .footer-brand .brand-logo-emblem {
    width: 36px !important;
    height: 36px !important;
  }

  .footer-brand .brand-logo-title {
    font-size: 1.35rem !important;
  }

  .footer-desc {
    font-size: 0.82rem !important;
    line-height: 1.58 !important;
    margin-top: 4px !important;
    max-width: 320px !important;
    margin-inline: auto !important;
    color: #94A3B8 !important;
  }

  /* Titles in Footer */
  .footer-col-title {
    font-size: 0.92rem !important;
    font-weight: 800 !important;
    margin-bottom: 8px !important;
    text-align: center !important;
    color: #E2E8F0 !important;
    position: relative !important;
    display: inline-block !important;
  }

  .footer-col-title::after {
    content: '' !important;
    display: block !important;
    width: 22px !important;
    height: 2px !important;
    background: var(--accent) !important;
    margin: 4px auto 0 !important;
    border-radius: 2px !important;
  }

  /* Quick links as a compact 3-column chip grid (Takes 2 neat rows instead of 6 tall lines) */
  .footer-links {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px 6px !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
  }

  .footer-link {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    padding: 7px 4px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    border-radius: 8px !important;
    display: block !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: #CBD5E1 !important;
    transition: all var(--transition-fast) !important;
  }

  .footer-link:active {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
  }

  /* Official Contacts List as compact centered pill cards */
  .footer-contact-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    max-width: 320px !important;
    margin-inline: auto !important;
    padding: 0 !important;
    margin: 0 auto !important;
    list-style: none !important;
  }

  .footer-contact-item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    font-size: 0.82rem !important;
    padding: 7px 12px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 8px !important;
    color: #CBD5E1 !important;
  }

  .footer-contact-item svg {
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0 !important;
    fill: var(--accent) !important;
  }

  /* Disclaimer Box */
  .footer-disclaimer-wrap {
    margin-top: 12px !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    text-align: center !important;
  }

  .footer-disclaimer-text {
    font-size: 0.73rem !important;
    line-height: 1.52 !important;
    color: #94A3B8 !important;
  }

  /* Footer Bottom Centered & Compact */
  .footer-bottom {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 0.78rem !important;
    color: #64748B !important;
    gap: 4px !important;
  }
}

/* --------------------------------------------------------------------------
   09. FLOATING ACTION BUTTONS ON MOBILE
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Hide separate sticky bar so it never collides with floating buttons */
  .mobile-bottom-bar {
    display: none !important;
  }

  .floating-action-btn {
    bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    width: 48px !important;
    height: 48px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
    z-index: 9999 !important;
  }

  .floating-action-btn svg {
    width: 22px !important;
    height: 22px !important;
  }

  .floating-call-btn {
    right: 16px !important;
  }

  .floating-whatsapp-btn {
    left: 16px !important;
  }
}

/* --------------------------------------------------------------------------
   10. TOAST NOTIFICATION ON MOBILE
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .toast-msg {
    top: 16px !important;
    bottom: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 32px) !important;
    max-width: 360px !important;
    font-size: 0.85rem !important;
    padding: 10px 16px !important;
    border-radius: 12px !important;
    z-index: 10000 !important;
  }
}
