/* Mobile Header Styles */

/* Hide mobile header by default (show only on mobile) */
.custom-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    direction: rtl;
    width: 100%;
}

/* Mobile header bar */
.cmh-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    height: 60px;
}

/* Hamburger menu button */
.cmh-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.cmh-toggle:hover {
    background-color: #f5f5f5;
}

.cmh-toggle:focus {
    outline: 2px solid #2d61e9;
    outline-offset: 2px;
}

/* Hamburger icon */
.cmh-hamburger {
    display: block;
    width: 20px;
    height: 2px;
    background: #333;
    position: relative;
    transition: all 0.3s ease;
}

.cmh-hamburger::before,
.cmh-hamburger::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: #333;
    transition: all 0.3s ease;
}

.cmh-hamburger::before {
    top: -6px;
}

.cmh-hamburger::after {
    bottom: -6px;
}

/* Hamburger animation when menu is open */
.cmh-menu-open .cmh-hamburger {
    background: transparent;
}

.cmh-menu-open .cmh-hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.cmh-menu-open .cmh-hamburger::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Logo */
.cmh-logo {
    text-decoration: none;
    color: #2d61e9;
    font-weight: bold;
    font-size: 20px;
}

.cmh-logo img {
    height: 40px;
    width: auto;
}

/* Menu overlay */
.cmh-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    width: 100%;
    height: 100vh;
    cursor: pointer; /* Indicate that overlay is clickable */
}

.cmh-menu-overlay.cmh-active {
    opacity: 1;
    visibility: visible;
}

/* Menu container should not inherit cursor pointer */
.cmh-menu-container {
    cursor: default;
}

.cmh-menu-overlay.cmh-active {
    opacity: 1;
    visibility: visible;
}

/* Menu container */
.cmh-menu-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.cmh-menu-overlay.cmh-active .cmh-menu-container {
    transform: translateX(0);
}

/* Menu header with title and close button */
.cmh-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.cmh-menu-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Close button */
.cmh-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 16px;
}

.cmh-close:hover {
    background-color: #e9ecef;
    color: #333;
}

.cmh-close:focus {
    outline: 2px solid #2d61e9;
    outline-offset: 2px;
    background-color: #e9ecef;
}

/* Menu list */
.cmh-menu {
    flex: 1;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-y: auto;
}

/* Menu items */
.cmh-menu li {
    border-bottom: 1px solid #f0f0f0;
}

.cmh-menu li:last-child {
    border-bottom: none;
}

.cmh-menu a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}

.cmh-menu a:hover {
    background-color: #f8f9fa;
    border-right-color: #2d61e9;
    color: #2d61e9;
}

/* Dropdown functionality */
.cmh-has-dropdown {
    position: relative;
}

.cmh-dropdown-toggle {
    width: 100%;
    background: none;
    border: none;
    text-align: right;
    padding: 15px 20px;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cmh-dropdown-toggle:hover {
    background-color: #f8f9fa;
    border-right-color: #2d61e9;
    color: #2d61e9;
}

.cmh-dropdown-toggle:focus {
    outline: 2px solid #2d61e9;
    outline-offset: -2px;
}

.cmh-caret {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.cmh-dropdown-toggle[aria-expanded="true"] .cmh-caret {
    transform: rotate(180deg);
}

/* Dropdown menu */
.cmh-dropdown {
    max-height: 0;
    overflow: hidden;
    background-color: #f8f9fa;
    transition: max-height 0.3s ease;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cmh-dropdown.cmh-show {
    max-height: 400px;
}

.cmh-dropdown li {
    border-bottom: 1px solid #e9ecef;
}

.cmh-dropdown li:last-child {
    border-bottom: none;
}

.cmh-dropdown a {
    padding: 12px 40px;
    font-size: 14px;
    color: #666;
    background-color: transparent;
    border-right: 3px solid transparent;
}

.cmh-dropdown a:hover {
    background-color: #e9ecef;
    color: #2d61e9;
    border-right-color: #2d61e9;
}

/* Media queries for responsive behavior */
@media (max-width: 991px) {
    /* Show mobile header on tablets and phones */
    .custom-mobile-header {
        display: block !important;
    }
    
    /* Hide desktop header on mobile */
    .header-top-area {
        display: none !important;
    }
    
    /* Hide bootstrap navbar on mobile */
    .navbar {
        display: none !important;
    }
    
    /* Add top padding to body to account for fixed mobile header */
    body {
        padding-top: 60px !important;
    }
    
    /* Ensure content doesn't hide behind mobile header */
    .contact-hero,
    .hero-section,
    .about-hero,
    .hero-projects {
        margin-top: 60px;
        padding-top: 80px !important;
    }
}

@media (max-width: 480px) {
    /* Adjust menu width for smaller screens */
    .cmh-menu-container {
        width: 100%;
    }
}

/* Prevent body scroll when menu is open */
body.cmh-menu-open {
    overflow: hidden;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .cmh-hamburger,
    .cmh-hamburger::before,
    .cmh-hamburger::after,
    .cmh-menu-overlay,
    .cmh-menu,
    .cmh-caret,
    .cmh-dropdown {
        transition: none;
    }
}

/* Focus styles for better accessibility */
.cmh-menu a:focus,
.cmh-dropdown a:focus {
    outline: 2px solid #2d61e9;
    outline-offset: -2px;
    background-color: #f8f9fa;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cmh-menu-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .cmh-menu {
        border: 2px solid #000;
    }
}

/* Additional mobile-specific fixes */
@media (max-width: 991px) {
    /* Ensure mobile header doesn't conflict with existing elements */
    .header-top-area,
    .navbar-default,
    .navbar-collapse {
        display: none !important;
    }
    
    /* Reset any existing mobile menu styles that might conflict */
    .navbar-toggle {
        display: none !important;
    }
    
    /* Fix for contact page specific elements */
    .contact-page .contact-hero {
        padding-top: 120px !important;
    }
    
    /* Ensure footer and other elements don't have z-index conflicts */
    footer {
        z-index: 1;
    }
    
    /* Fix for any existing modals or overlays */
    .modal,
    .modal-backdrop {
        z-index: 1050;
    }
}

/* Menu footer with cancel button */
.cmh-menu-footer {
    padding: 15px 20px 20px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.cmh-cancel-btn {
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    color: #666;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cmh-cancel-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
    color: #333;
}

.cmh-cancel-btn:focus {
    outline: 2px solid #2d61e9;
    outline-offset: 2px;
    background: #f5f5f5;
}

.cmh-cancel-btn i {
    font-size: 12px;
}

/* Mobile Responsive Fixes for Forms and Content */
@media (max-width: 768px) {
    /* Fix text justification and spacing issues */
    body {
        text-align: justify;
        line-height: 1.6;
        font-size: 14px;
    }
    
    /* Header text improvements */
    .hero-text h1 {
        font-size: 28px !important;
        line-height: 1.3 !important;
        margin-bottom: 15px !important;
        text-align: center !important;
    }
    
    .hero-text p {
        font-size: 16px !important;
        line-height: 1.5 !important;
        margin-bottom: 20px !important;
        text-align: center !important;
    }
    
    /* Section titles and content */
    .section-title h2 {
        font-size: 24px !important;
        line-height: 1.4 !important;
        margin-bottom: 20px !important;
        text-align: center !important;
    }
    
    .section-title p {
        font-size: 15px !important;
        line-height: 1.6 !important;
        text-align: justify !important;
        margin-bottom: 25px !important;
    }
    
    /* Content paragraphs */
    p {
        text-align: justify !important;
        line-height: 1.7 !important;
        margin-bottom: 20px !important;
        font-size: 14px !important;
    }
    
    /* Services content */
    .about-content h3 {
        font-size: 20px !important;
        line-height: 1.4 !important;
        margin-bottom: 20px !important;
        text-align: center !important;
    }
    
    .about-content div {
        margin-bottom: 20px !important;
        padding: 10px !important;
        line-height: 1.6 !important;
        text-align: justify !important;
    }
    
    /* Form container improvements */
    .feature-sec .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    .feature-sec .col-md-10 {
        padding: 0 10px !important;
    }
    
    .feature-sec .col-md-8 {
        padding: 0 !important;
    }
    
    /* Form styling improvements */
    .feature-sec form > div[style*="background"] {
        background: rgba(255,255,255,0.95) !important;
        padding: 25px 20px !important;
        border-radius: 15px !important;
        margin: 0 !important;
        box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    }
    
    /* Form inputs */
    .feature-sec input,
    .feature-sec select,
    .feature-sec textarea {
        width: 100% !important;
        padding: 15px !important;
        margin-bottom: 15px !important;
        border: 1px solid #ddd !important;
        border-radius: 8px !important;
        font-size: 14px !important;
        background: #fff !important;
        color: #333 !important;
        box-sizing: border-box !important;
        direction: rtl !important;
        text-align: right !important;
    }
    
    .feature-sec input:focus,
    .feature-sec select:focus,
    .feature-sec textarea:focus {
        border-color: #2d61e9 !important;
        box-shadow: 0 0 10px rgba(45, 97, 233, 0.3) !important;
        outline: none !important;
    }
    
    /* Form rows */
    .feature-sec .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .feature-sec .col-md-6,
    .feature-sec .col-md-12 {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* Submit button */
    .feature-sec button[type="submit"] {
        width: 100% !important;
        padding: 15px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
        margin-top: 10px !important;
        background: #2d61e9 !important;
        color: #fff !important;
        border: none !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
    }
    
    .feature-sec button[type="submit"]:hover {
        background: #1a4cb8 !important;
        transform: translateY(-2px) !important;
    }
    
    /* Form headings */
    .feature-sec h2 {
        font-size: 22px !important;
        line-height: 1.4 !important;
        margin-bottom: 15px !important;
        text-align: center !important;
    }
    
    .feature-sec p {
        font-size: 14px !important;
        line-height: 1.6 !important;
        text-align: center !important;
        margin-bottom: 25px !important;
    }
    
    /* Contact info */
    .feature-sec .col-md-12:last-child p {
        font-size: 13px !important;
        line-height: 1.5 !important;
        text-align: center !important;
        margin-bottom: 10px !important;
    }
    
    .feature-sec .col-md-12:last-child div {
        text-align: center !important;
    }
    
    .feature-sec .col-md-12:last-child a {
        display: inline-block !important;
        margin: 5px 10px !important;
        font-size: 16px !important;
        text-decoration: none !important;
    }
    
    /* Attraction cards mobile fixes */
    .attraction-card {
        height: 250px !important;
        margin-bottom: 20px !important;
    }
    
    .attraction-overlay h4 {
        font-size: 16px !important;
        line-height: 1.3 !important;
        margin: 8px 0 !important;
    }
    
    .attraction-overlay p {
        font-size: 12px !important;
        line-height: 1.4 !important;
        text-align: center !important;
    }
    
    /* Tour packages mobile */
    .text-center[style*="padding"] {
        padding: 20px 15px !important;
        height: auto !important;
        min-height: 180px !important;
    }
    
    .text-center h4 {
        font-size: 16px !important;
        line-height: 1.3 !important;
        margin-bottom: 10px !important;
    }
    
    .text-center p {
        font-size: 12px !important;
        line-height: 1.4 !important;
        text-align: center !important;
        margin-bottom: 10px !important;
    }
    
    /* Activities section mobile */
    .activities-list div {
        margin-bottom: 15px !important;
        padding: 12px !important;
        line-height: 1.5 !important;
        font-size: 13px !important;
        text-align: justify !important;
    }
    
    /* Breadcrumb mobile */
    .breadcrumb {
        font-size: 12px !important;
        padding: 8px 15px !important;
    }
    
    .breadcrumb li {
        font-size: 12px !important;
    }
    
    /* Service callouts mobile */
    .service-callouts .col-sm-6,
    .service-callouts .col-md-3,
    .service-callouts .col-md-4 {
        margin-bottom: 20px !important;
        padding: 0 10px !important;
    }
    
    .single-service {
        padding: 20px 15px !important;
        text-align: center !important;
    }
    
    .single-service h4 {
        font-size: 16px !important;
        line-height: 1.3 !important;
        margin: 10px 0 !important;
    }
    
    .single-service p {
        font-size: 13px !important;
        line-height: 1.5 !important;
        text-align: center !important;
        margin-bottom: 0 !important;
    }
    
    /* Footer mobile fixes */
    .footer-section h3,
    .footer-section h4 {
        font-size: 18px !important;
        line-height: 1.4 !important;
        margin-bottom: 15px !important;
        text-align: center !important;
    }
    
    .footer-section p {
        font-size: 13px !important;
        line-height: 1.6 !important;
        text-align: justify !important;
        margin-bottom: 15px !important;
    }
    
    .footer-section ul li {
        margin-bottom: 8px !important;
        text-align: center !important;
    }
    
    .footer-section ul li a {
        font-size: 13px !important;
        line-height: 1.5 !important;
    }
    
    /* General spacing improvements */
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .row {
        margin-left: -10px !important;
        margin-right: -10px !important;
    }
    
    .col-sm-6,
    .col-md-3,
    .col-md-4,
    .col-md-6,
    .col-md-8,
    .col-md-10,
    .col-md-12 {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* Text alignment fixes */
    .text-center {
        text-align: center !important;
    }
    
    /* Ensure RTL direction */
    html,
    body {
        direction: rtl !important;
        text-align: right !important;
    }
    
    /* Fix any left-aligned text */
    * {
        text-align: inherit !important;
    }
    
    /* Navigation mobile improvements */
    .navbar-nav {
        text-align: center !important;
    }
    
    .navbar-nav li a {
        text-align: center !important;
        padding: 10px 15px !important;
    }
    
    .dropdown-menu {
        text-align: center !important;
    }
    
    .dropdown-menu li a {
        text-align: center !important;
        padding: 8px 15px !important;
    }
}

/* For very small screens */
@media (max-width: 375px) {
    .cmh-bar {
        padding: 8px 12px;
    }
    
    .cmh-logo {
        font-size: 18px;
    }
    
    .cmh-menu a {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .cmh-dropdown a {
        padding: 10px 30px;
        font-size: 13px;
    }
    
    .cmh-menu-container {
        width: 100%;
    }
    
    .cmh-menu-header {
        padding: 15px 15px 12px 15px;
    }
    
    .cmh-menu-footer {
        padding: 12px 15px 15px 15px;
    }
}