/* Mobile Responsive Enhancements */

/* Header Responsive */
@media (max-width: 991px) {
    .header .branding .logo img {
        max-height: 70px;
        width: 6rem;
    }
    
    .header .branding {
        padding: 10px 0;
    }
}

@media (max-width: 768px) {
    .header .branding .logo img {
        max-height: 60px;
        width: 5rem;
    }
}

/* Hero Section - Carousel Responsive */
@media (max-width: 991px) {
    .hero .carousel-item img {
        height: 400px !important;
    }
    
    .hero .carousel-caption {
        padding: 20px !important;
        bottom: 15% !important;
    }
    
    .hero .carousel-caption h1 {
        font-size: 2.5rem !important;
    }
    
    .hero .carousel-caption p {
        font-size: 1.1rem !important;
    }
}

@media (max-width: 768px) {
    .hero .carousel-item img {
        height: 300px !important;
    }
    
    .hero .carousel-caption {
        padding: 15px !important;
        bottom: 10% !important;
    }
    
    .hero .carousel-caption h1 {
        font-size: 1.8rem !important;
    }
    
    .hero .carousel-caption p {
        font-size: 1rem !important;
        margin-top: 10px !important;
    }
}

@media (max-width: 576px) {
    .hero .carousel-item img {
        height: 250px !important;
    }
    
    .hero .carousel-caption h1 {
        font-size: 1.5rem !important;
    }
    
    .hero .carousel-caption p {
        font-size: 0.9rem !important;
        display: none; /* Hide subtitle on very small screens */
    }
}

/* Filter Section Responsive */
@media (max-width: 768px) {
    .section h3 {
        font-size: 1.3rem;
        margin-bottom: 15px !important;
    }
    
    .d-flex.flex-wrap.gap-2 {
        justify-content: center;
    }
    
    .btn-outline-primary {
        font-size: 0.9rem;
        padding: 8px 16px;
    }
}

/* Package Cards Responsive */
@media (max-width: 991px) {
    .package-card {
        margin-bottom: 20px;
    }
    
    .package-content h3 {
        font-size: 1.2rem;
    }
    
    .package-content .price {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .packages-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .package-image {
        height: 180px;
    }
    
    .package-content {
        padding: 20px;
    }
}

/* Carousel Navigation Responsive */
@media (max-width: 991px) {
    #popularPackagesCarousel .carousel-control-prev,
    #popularPackagesCarousel .carousel-control-next {
        width: 40px !important;
        height: 40px !important;
        left: -50px !important;
    }
    
    #popularPackagesCarousel .carousel-control-next {
        right: -50px !important;
    }
}

@media (max-width: 768px) {
    #popularPackagesCarousel .carousel-control-prev,
    #popularPackagesCarousel .carousel-control-next {
        display: none !important; /* Hide on mobile, use swipe */
    }
    
    .carousel-indicators {
        margin-top: 20px !important;
    }
}

/* Package Types Grid Responsive */
@media (max-width: 991px) {
    .types-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .types-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .type-card {
        padding: 25px;
    }
    
    .type-card h3 {
        font-size: 1.3rem;
    }
}

/* Destinations List Responsive */
@media (max-width: 768px) {
    .destinations-list {
        gap: 10px;
    }
    
    .destination-item {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* Call to Action Section Responsive */
@media (max-width: 768px) {
    .section h2 {
        font-size: 1.8rem !important;
    }
    
    .section p {
        font-size: 1rem !important;
    }
    
    .d-flex.justify-content-center.gap-3 {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-lg {
        width: 100%;
        max-width: 300px;
    }
}

/* Footer Responsive */
@media (max-width: 991px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .footer-section {
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 30px 0 15px;
    }
    
    .footer-section h3 {
        font-size: 1.2rem;
    }
    
    .footer-section p {
        font-size: 0.9rem;
    }
}

/* Booking Form Responsive */
@media (max-width: 768px) {
    .booking-form {
        padding: 20px;
        margin: 30px 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px;
        font-size: 14px;
    }
    
    .btn-primary {
        padding: 12px 20px;
        font-size: 14px;
        width: 100%;
    }
}

/* Contact Info Responsive */
@media (max-width: 768px) {
    .contact-info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .contact-card {
        padding: 20px;
    }
}

/* General Section Padding Responsive */
@media (max-width: 768px) {
    .section {
        padding: 40px 0;
    }
    
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 576px) {
    .section {
        padding: 30px 0;
    }
    
    .section h2 {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Fix carousel indicators on mobile */
@media (max-width: 768px) {
    .carousel-indicators button {
        width: 10px !important;
        height: 10px !important;
    }
}

/* Improve touch targets for mobile */
@media (max-width: 768px) {
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-outline-primary {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    a.destination-item {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* Mobile menu adjustments if needed */
@media (max-width: 1199px) {
    .navmenu ul {
        padding: 15px 10px;
    }
    
    .navmenu a {
        padding: 12px 20px;
        font-size: 16px;
    }
}

/* Mobile Hamburger Menu Styles */
.mobile-nav-toggle {
    display: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--nav-color);
    background: none;
    border: none;
    padding: 10px;
    z-index: 1001;
}

@media (max-width: 1199px) {
    .mobile-nav-toggle {
        display: block;
    }
    
    .navmenu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--nav-mobile-background-color);
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.3s ease-in-out;
        z-index: 1000;
        overflow-y: auto;
        padding-top: 60px;
    }
    
    .navmenu.mobile-nav-active {
        right: 0;
    }
    
    .navmenu ul {
        display: flex;
        flex-direction: column;
        padding: 20px;
        margin: 0;
        list-style: none;
    }
    
    .navmenu li {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .navmenu a {
        display: block;
        padding: 15px 20px;
        color: var(--nav-dropdown-color);
        text-decoration: none;
        border-radius: 5px;
        transition: background 0.3s;
    }
    
    .navmenu a:hover,
    .navmenu a.active {
        background: var(--accent-color);
        color: white;
    }
    
    .navmenu .btn-primary {
        margin-top: 10px;
        text-align: center;
    }
    
    /* Overlay when menu is open */
    body.mobile-nav-active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    /* Close button in menu */
    .mobile-nav-toggle.mobile-nav-close {
        position: fixed;
        top: 15px;
        right: 15px;
        color: var(--nav-color);
        z-index: 1001;
    }
}

@media (max-width: 768px) {
    .navmenu {
        width: 260px;
    }
}

@media (max-width: 576px) {
    .navmenu {
        width: 240px;
    }
    
    .navmenu a {
        padding: 12px 15px;
        font-size: 15px;
    }
}


/* Package Details Page Layout Fix */

/* Desktop Layout - Side by Side */
@media (min-width: 992px) {
    .section > .container > div[style*="grid-template-columns: 1fr 400px"] {
        display: grid;
        grid-template-columns: 1fr 400px;
        gap: 40px;
        align-items: start;
    }
}

/* Tablet and Mobile Layout - Stacked */
@media (max-width: 991px) {
    .section > .container > div[style*="grid-template-columns: 1fr 400px"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 30px;
    }
    
    /* Package Details First */
    .section > .container > div[style*="grid-template-columns: 1fr 400px"] > div:first-child {
        order: 1;
        width: 100%;
    }
    
    /* Booking Form Second */
    .section > .container > div[style*="grid-template-columns: 1fr 400px"] > div:last-child {
        order: 2;
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .section > .container > div[style*="grid-template-columns: 1fr 400px"] {
        gap: 25px;
    }
    
    .section > .container > div[style*="grid-template-columns: 1fr 400px"] > div:last-child {
        max-width: 100%;
    }
}

/* Ensure proper spacing for mobile */
@media (max-width: 991px) {
    .section {
        padding: 30px 0;
    }
    
    .section .container {
        padding: 0 15px;
    }
}

/* Package Image Responsive Heights */
@media (max-width: 991px) {
    .section > .container > div > div > div[style*="height: 300px"] {
        height: 250px !important;
        margin: 15px 0 !important;
    }
}

@media (max-width: 768px) {
    .section > .container > div > div > div[style*="height: 300px"] {
        height: 220px !important;
    }
}

@media (max-width: 576px) {
    .section > .container > div > div > div[style*="height: 300px"] {
        height: 200px !important;
    }
}

/* Package Title Responsive */
@media (max-width: 991px) {
    .section h1 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
}

@media (max-width: 768px) {
    .section h1 {
        font-size: 1.6rem;
    }
}

@media (max-width: 576px) {
    .section h1 {
        font-size: 1.4rem;
    }
}

/* Package Details Box */
@media (max-width: 991px) {
    .section div[style*="background: white"][style*="padding: 30px"] {
        padding: 25px !important;
        margin: 15px 0 !important;
    }
}

@media (max-width: 768px) {
    .section div[style*="background: white"][style*="padding: 30px"] {
        padding: 20px !important;
    }
}

@media (max-width: 576px) {
    .section div[style*="background: white"][style*="padding: 30px"] {
        padding: 15px !important;
    }
}

/* Package Info Grid */
@media (max-width: 768px) {
    .section div[style*="grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))"] {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
        margin: 20px 0 !important;
    }
    
    .section div[style*="grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))"] > div {
        background: #f8f9fa;
        padding: 12px;
        border-radius: 8px;
    }
    
    .section div[style*="grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))"] h4 {
        font-size: 0.95rem;
        margin-bottom: 8px !important;
    }
    
    .section div[style*="grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))"] p {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .section div[style*="grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}

/* Package Details Headings */
@media (max-width: 768px) {
    .section h2[style*="color: #667eea"] {
        font-size: 1.4rem;
    }
    
    .section h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .section h2[style*="color: #667eea"] {
        font-size: 1.3rem;
    }
    
    .section h3 {
        font-size: 1.1rem;
    }
}

/* Inclusions/Exclusions Lists */
@media (max-width: 768px) {
    .section ul[style*="list-style-type: none"] li {
        font-size: 0.9rem;
        margin-bottom: 8px !important;
    }
}

@media (max-width: 576px) {
    .section ul[style*="list-style-type: none"] li {
        font-size: 0.85rem;
    }
}

/* Booking Form Styling */
@media (max-width: 991px) {
    .booking-form {
        margin-top: 20px !important;
    }
}

@media (max-width: 768px) {
    .booking-form {
        padding: 25px !important;
    }
    
    .booking-form h3 {
        font-size: 1.4rem;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .booking-form {
        padding: 20px !important;
        border-radius: 8px;
    }
    
    .booking-form h3 {
        font-size: 1.3rem;
    }
}

/* Form Fields Mobile Optimization */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
}

/* Adults/Children Grid Fix */
@media (max-width: 576px) {
    .booking-form div[style*="grid-template-columns: 1fr 1fr"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
}

/* Submit Button */
@media (max-width: 768px) {
    .btn-primary[style*="width: 100%"] {
        padding: 14px 20px;
        font-size: 16px;
        margin-top: 10px;
    }
}

@media (max-width: 576px) {
    .btn-primary[style*="width: 100%"] {
        padding: 13px 18px;
        font-size: 15px;
    }
}

/* Alert Messages */
@media (max-width: 768px) {
    .alert {
        padding: 12px;
        font-size: 0.9rem;
        margin-bottom: 15px;
        border-radius: 6px;
    }
}

/* Error Messages */
.form-group span[style*="color: red"] {
    display: block;
    margin-top: 4px;
    font-size: 12px !important;
}

@media (max-width: 576px) {
    .form-group span[style*="color: red"] {
        font-size: 11px !important;
    }
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 991px) {
    body {
        overflow-x: hidden;
    }
    
    .section .container {
        overflow-x: hidden;
    }
}

/* Better Image Styling on Mobile */
@media (max-width: 768px) {
    .section img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
    }
}

/* Landscape Mode Optimization */
@media (max-width: 991px) and (orientation: landscape) {
    .section > .container > div[style*="grid-template-columns: 1fr 400px"] > div > div[style*="height: 300px"] {
        height: 200px !important;
    }
}