/**
 * Al Nadir Tourism – Responsive Improvements v2.0.0
 *
 * Loaded after style.css and main.css.
 * Overrides and extensions for:
 *   • Mobile nav drawer
 *   • Header improvements
 *   • Tablet & mobile responsive fixes
 *   • Container adjustments for 320-480px
 *   • Hero trust badge responsive layout
 */

/* =====================================================
   CONTAINER — TIGHTER PADDING ON SMALL SCREENS
   ===================================================== */
@media (max-width: 400px) {
    .container,
    .container--narrow {
        padding: 0 1rem;
    }
}

/* =====================================================
   HEADER — GENERAL IMPROVEMENTS
   ===================================================== */

/* Remove dropdown arrow from pseudo-element; now injected via JS sibling span */
.primary-nav li.menu-item-has-children > a::before {
    display: none;
}

/* Desktop dropdown caret span (sibling of <a>, not inside it) */
.nav-caret {
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    user-select: none;
    margin-left: 0.2em;
    vertical-align: middle;
    display: inline-block;
    line-height: 1;
    transition: color 0.2s;
}

/* Style parent li to lay out link + caret inline */
.primary-nav > li.menu-item-has-children {
    display: flex;
    align-items: center;
}

.primary-nav > li.menu-item-has-children > a {
    flex: 0 1 auto;
}

/* Caret turns gold on hover/active */
.primary-nav > li.menu-item-has-children:hover .nav-caret,
.primary-nav > li.current-menu-item .nav-caret {
    color: var(--color-gold);
}

/* Hide "Book Now" only on narrowest phones; keep on tablet+ */
@media (max-width: 639px) {
    .header-book-btn {
        display: none;
    }
}

/* Top bar: hide hours text on mobile, keep phone+email */
@media (max-width: 639px) {
    .header-top-bar__hours {
        display: none;
    }
    .header-top-bar__contact {
        gap: 1rem;
    }
}

/* =====================================================
   HAMBURGER — ANIMATED → X
   ===================================================== */
.mobile-menu-toggle {
    display: none; /* shown in media query */
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    cursor: pointer;
    background: none;
    border: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-white);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.2s ease;
    transform-origin: center;
}

/* Morph to × when open */
.mobile-menu-toggle.is-active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.mobile-menu-toggle.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .mobile-menu-toggle { display: flex; }
}

/* =====================================================
   MOBILE NAV — FULL-HEIGHT DRAWER
   ===================================================== */

/* Semi-transparent backdrop */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(10, 22, 40, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.mobile-nav-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Drawer panel */
.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    width: min(360px, 90vw);
    background: var(--color-navy);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0.38s;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    /* Prevent keyboard tab reach while closed */
    visibility: hidden;
    pointer-events: none;
}

.mobile-nav.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0s;
}

/* Drawer header row */
.mobile-nav__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
    flex-shrink: 0;
}

.mobile-nav__brand .custom-logo {
    max-height: 44px;
    width: auto;
}

.mobile-nav__brand .site-logo__name {
    font-size: 1.1rem;
    line-height: 1.15;
}

/* Close button */
.mobile-nav__close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.2);
    color: var(--color-white);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.mobile-nav__close:hover,
.mobile-nav__close:focus-visible {
    background: var(--color-gold);
    color: var(--color-navy);
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

/* Scrollable menu area */
.mobile-nav__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0;
}

/* Menu list */
.mobile-nav__menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav__menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-nav__menu li:last-child {
    border-bottom: none;
}

/* Row wrapping link + expand toggle */
.mobile-sub-row {
    display: flex;
    align-items: center;
}

.mobile-nav__menu a {
    display: block;
    flex: 1;
    padding: 0.9rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s, padding-left 0.2s;
    text-decoration: none;
}

.mobile-nav__menu a:hover,
.mobile-nav__menu .current-menu-item > a,
.mobile-nav__menu .current-menu-item > .mobile-sub-row > a {
    color: var(--color-gold);
    padding-left: 1.875rem;
}

/* Expand/collapse toggle for sub-menus */
.mobile-sub-toggle {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s;
}

.mobile-sub-toggle:hover,
.mobile-sub-toggle:focus-visible {
    color: var(--color-gold);
    outline: none;
}

.mobile-sub-toggle i {
    transition: transform 0.3s ease;
}

.mobile-sub-toggle.is-open i {
    transform: rotate(180deg);
}

/* Second-level sub-menu */
.mobile-nav__menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.2);
}

.mobile-nav__menu .sub-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.mobile-nav__menu .sub-menu a {
    padding-left: 2.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.mobile-nav__menu .sub-menu a:hover {
    color: var(--color-gold);
    padding-left: 3rem;
}

/* Drawer footer CTA buttons */
.mobile-nav__footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(201, 168, 76, 0.15);
    flex-shrink: 0;
}

.mobile-nav__cta {
    flex: 1;
    justify-content: center;
}

/* =====================================================
   HERO SECTION — MOBILE FIXES
   ===================================================== */

/* Trust badges row: responsive wrap at bottom of hero */
.hero-trust-badges {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 0 1rem;
    flex-wrap: wrap;
}

/* Badge dividers: hide on small screens where we wrap */
@media (max-width: 480px) {
    .hero-trust-badges {
        gap: 1rem 1.5rem;
        bottom: 1.25rem;
    }
    .hero-trust-divider {
        display: none;
    }
    .hero-content__title {
        font-size: clamp(2.25rem, 9vw, 4rem);
    }
    .hero-slider-controls {
        bottom: 6.5rem; /* lift above trust badges when they wrap */
    }
}

@media (max-width: 375px) {
    .hero-trust-badges {
        bottom: 0.75rem;
        gap: 0.5rem 1rem;
    }
    .hero-content__desc {
        font-size: 0.9375rem;
    }
    .hero-content__actions {
        gap: 0.75rem;
    }
    .btn--lg {
        padding: 1rem 2rem;
        font-size: 0.9375rem;
    }
}

/* Fix hero slider arrow size on mobile */
@media (max-width: 480px) {
    .hero-slider-arrow {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .hero-slider-arrows {
        padding: 0 0.75rem;
    }
}

/* =====================================================
   ABOUT SECTION — TABLET IMPROVEMENTS
   ===================================================== */
@media (max-width: 1024px) {
    /* Don't outright hide the image; stack it and resize it */
    .about-section__images {
        display: block !important;
        max-width: 600px;
        margin: 0 auto;
    }

    .about-section__img-main img {
        height: 380px;
    }

    /* Keep accent image but reposition it to not overflow */
    .about-section__img-accent {
        right: -1rem;
        bottom: -2rem;
        width: 160px;
    }
    .about-section__img-accent img {
        height: 130px;
    }

    .about-badge {
        left: -1rem;
        width: 90px;
        height: 90px;
    }
    .about-badge__number {
        font-size: 1.5rem;
    }
    .about-badge__text {
        font-size: 0.5625rem;
    }
}

@media (max-width: 768px) {
    .about-section__images {
        display: none !important; /* hide on small mobile to save space */
    }
}

/* =====================================================
   PACKAGES GRID — TABLET IMPROVEMENTS
   ===================================================== */
@media (max-width: 1100px) and (min-width: 769px) {
    .packages-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .packages-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

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

/* =====================================================
   DESTINATIONS GRID — TABLET IMPROVEMENTS
   ===================================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    .destinations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .destination-card:first-child {
        grid-row: 1 / 3;
    }
    .destination-card__image {
        height: 260px;
    }
    .destination-card:first-child .destination-card__image {
        min-height: 540px;
        height: 100%;
    }
}

/* =====================================================
   WHY CHOOSE US — TABLET
   ===================================================== */
@media (max-width: 768px) {
    .why-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto;
    }
}

/* =====================================================
   SERVICES GRID — TABLET
   ===================================================== */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}
@media (max-width: 400px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   STATS SECTION
   ===================================================== */
@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem 1rem;
    }
    .stat-item__number {
        font-size: clamp(2.25rem, 8vw, 3.5rem);
    }
}

/* =====================================================
   FAQs SECTION — TABLET IMPROVEMENTS
   ===================================================== */
@media (max-width: 1024px) {
    .faqs-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .faqs-content__image {
        display: block !important;
        max-width: 560px;
        margin: 0 auto;
    }
    .faqs-content__image img {
        height: 320px;
    }
}

@media (max-width: 640px) {
    .faqs-content__image {
        display: none !important;
    }
}

/* =====================================================
   GALLERY GRID — TABLET + MOBILE
   ===================================================== */
@media (max-width: 1024px) and (min-width: 641px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 200px;
    }
    .gallery-item:nth-child(1) {
        grid-column: 1 / 2;
        grid-row: auto;
    }
    .gallery-item:nth-child(6) {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
    }
    .gallery-item:nth-child(1),
    .gallery-item:nth-child(6) {
        grid-column: auto;
        grid-row: auto;
    }
}

@media (max-width: 400px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 220px;
    }
}

/* =====================================================
   TESTIMONIALS — MOBILE
   ===================================================== */
@media (max-width: 639px) {
    .testimonial-card {
        padding: 1.75rem 1.25rem;
    }
}

/* =====================================================
   BLOG GRID — TABLET
   ===================================================== */
@media (max-width: 1024px) and (min-width: 641px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* =====================================================
   CONTACT GRID
   ===================================================== */
@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   ABOUT FEATURES — MOBILE
   ===================================================== */
@media (max-width: 480px) {
    .about-features {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   FOOTER
   ===================================================== */
@media (max-width: 1200px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .footer-bottom .container {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    .footer-bottom__links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
}

/* =====================================================
   NEWSLETTER SECTION — MOBILE
   ===================================================== */
@media (max-width: 640px) {
    .newsletter-inner {
        flex-direction: column;
        text-align: center;
    }
    .newsletter-form {
        max-width: 100%;
        width: 100%;
    }
    .newsletter-form input {
        width: 100%;
        border-radius: var(--radius-md);
        margin-bottom: 0.75rem;
    }
    .newsletter-form .btn {
        width: 100%;
        justify-content: center;
        border-radius: var(--radius-md);
    }
}

/* =====================================================
   FLOATING BUTTONS — MOBILE
   ===================================================== */
@media (max-width: 480px) {
    .floating-buttons {
        right: 1rem;
        bottom: 1.25rem;
    }
    .floating-btn {
        width: 46px;
        height: 46px;
        font-size: 1.1rem;
    }
}

/* =====================================================
   HERO SEARCH BAR — TABLET + MOBILE
   ===================================================== */
@media (max-width: 768px) {
    .hero-search__box {
        flex-direction: column;
        gap: 0.875rem;
        padding: 1.5rem;
    }
    .hero-search__field {
        min-width: auto;
        width: 100%;
    }
    .hero-search__box .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-search {
        padding: 0 1rem;
    }
    .hero-search__box {
        padding: 1.25rem 1rem;
    }
}

/* =====================================================
   SECTION PADDING — MOBILE REDUCE
   ===================================================== */
@media (max-width: 640px) {
    .section,
    .about-section,
    .packages-section,
    .why-section,
    .destinations-section,
    .services-section,
    .gallery-section,
    .testimonials-section,
    .faqs-section,
    .blog-section,
    .cta-section,
    .stats-section {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }
    .stats-section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* =====================================================
   SECTION HEADER — MOBILE EYEBROW LINES
   ===================================================== */
@media (max-width: 400px) {
    .section-header__eyebrow::before,
    .section-header__eyebrow::after {
        width: 16px;
        margin: 0 6px;
    }
}

/* =====================================================
   REVIEWS GRID
   ===================================================== */
@media (max-width: 768px) {
    .reviews-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   PACKAGE FILTER TABS — MOBILE
   ===================================================== */
@media (max-width: 480px) {
    .packages-filters {
        gap: 0.5rem;
    }
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
}

/* =====================================================
   BREADCRUMBS — MOBILE OVERFLOW FIX
   ===================================================== */
.breadcrumbs__inner {
    flex-wrap: wrap;
}

/* =====================================================
   SEARCH OVERLAY — MOBILE FOCUS
   ===================================================== */
@media (max-width: 640px) {
    .search-overlay__input {
        font-size: clamp(1.25rem, 6vw, 2rem);
    }
}

/* =====================================================
   GENERAL: PREVENT HORIZONTAL OVERFLOW
   ===================================================== */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Ensure any section doesn't cause horizontal scroll */
.hero-section,
.about-section,
.packages-section,
.destinations-section,
.services-section,
.gallery-section,
.testimonials-section,
.blog-section,
.cta-section,
.stats-section,
.faqs-section,
.newsletter-section,
.site-footer {
    overflow-x: hidden;
}

/* =====================================================
   KEYBOARD FOCUS STYLES (Accessibility)
   ===================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
    border-radius: 2px;
}

/* =====================================================
   PRINT — HIDE MOBILE NAV OVERLAY
   ===================================================== */
@media print {
    .mobile-nav,
    .mobile-nav-overlay,
    .mobile-menu-toggle {
        display: none !important;
    }
}

/* =====================================================
   HERO TRUST BADGES — Base Styles
   (replacing the inline-style version in hero.php)
   ===================================================== */
.hero-trust-badge {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.hero-trust-badge__number {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-gold);
    line-height: 1;
    margin: 0 0 0.25rem;
}

.hero-trust-badge__suffix {
    font-size: 1rem;
}

.hero-trust-badge__label {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0;
}

.hero-trust-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .hero-trust-badge__number {
        font-size: 1.5rem;
    }
    .hero-trust-badge__label {
        font-size: 0.6875rem;
    }
}
