/**
 * Unified Mobile Responsiveness & UI Standardization
 * Common styles for packages, packagedetail, and packagecategory pages
 * 2024 Enhancement
 */

/* ============================================
   STANDARDIZED BREAKPOINTS
   ============================================ */
/* Mobile: max-width 767px */
/* Tablet: 768px - 991px */
/* Desktop: 992px+ */

/* ============================================
   TOUCH-FRIENDLY TARGETS
   ============================================ */
@media (max-width: 767px) {
    /* Ensure all interactive elements are at least 44x44px */
    button,
    .btn,
    a.btn,
    input[type="submit"],
    input[type="button"],
    .nav-link,
    .sort_result,
    .package_filt input[type="checkbox"],
    .package_filt label,
    .search_result_li {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 15px;
    }
    
    /* Links should have adequate touch area */
    a:not(.btn):not(.nav-link) {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 8px 12px;
    }
    
    /* Filter checkboxes need larger touch targets */
    .package_filt input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 10px;
    }
    
    /* Sort dropdown items */
    .dropdown-menu a,
    .dropdown-menu li {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 12px 15px;
    }
}

/* ============================================
   RESPONSIVE TYPOGRAPHY
   ============================================ */
@media (max-width: 767px) {
    /* Headings */
    h1, .h1 {
        font-size: 28px;
        line-height: 1.3;
    }
    
    h2, .h2, .wk-block-heading {
        font-size: 22px;
        line-height: 1.3;
    }
    
    h3, .h3 {
        font-size: 20px;
        line-height: 1.3;
    }
    
    h4, .h4, .pkg_head_h4 {
        font-size: 18px;
        line-height: 1.4;
    }
    
    /* Body text */
    body, p {
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* Package headings */
    .pkg_heading {
        font-size: 24px !important;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    .results_main_head {
        font-size: 20px;
        line-height: 1.3;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    h1, .h1 {
        font-size: 32px;
    }
    
    .pkg_heading {
        font-size: 32px !important;
    }
}

/* ============================================
   IMAGE RESPONSIVENESS
   ============================================ */
img,
.img-responsive {
    max-width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 767px) {
    /* Package images */
    .pkg_img_wrapper img,
    #bigpic,
    .slider_element img,
    .package_info img {
        max-width: 100%;
        width: 100%;
        height: auto;
    }
    
    /* Thumbnail images */
    #thumbs_list img,
    .slider_element .element_img_wrapper img {
        max-width: 100%;
        height: auto;
    }
    
    /* Gallery images */
    #image-block img {
        width: 100%;
        height: auto;
    }
}

/* ============================================
   FORM IMPROVEMENTS
   ============================================ */
@media (max-width: 767px) {
    /* Input fields - prevent iOS zoom and ensure touch-friendly */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    input[type="datetime-local"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
        min-height: 44px;
        padding: 10px 15px;
        width: 100%;
    }
    
    /* Form groups */
    .form-group {
        margin-bottom: 20px;
    }
    
    /* Labels */
    label,
    .control-label {
        font-size: 14px;
        font-weight: 500;
        margin-bottom: 8px;
        display: block;
    }
    
    /* Full-width inputs on mobile */
    .form-control {
        width: 100%;
        max-width: 100%;
    }
}

/* ============================================
   CARD/GRID LAYOUTS
   ============================================ */
@media (max-width: 767px) {
    /* Consistent padding */
    .pkg_detail_wrapper,
    .package_filter_block,
    .card,
    .pkg_info_row {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    /* Package cards - stack vertically */
    .pkg_detail_wrapper .row.row-equal-height {
        flex-direction: column;
    }
    
    .pkg_detail_wrapper .row.row-equal-height > [class*='col-'] {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Image wrapper */
    .pkg_img_wrapper {
        padding: 15px;
        order: 1;
    }
    
    /* Info wrapper */
    .pkg_info_wrapper {
        padding: 15px;
        order: 2;
    }
    
    /* Price block */
    .pkg_price_block {
        padding: 15px;
        margin-top: 15px;
        background: #F7F7F7;
        border-radius: 4px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .pkg_detail_wrapper,
    .card {
        padding: 20px;
    }
}

@media (min-width: 992px) {
    .pkg_detail_wrapper,
    .card {
        padding: 30px;
    }
}

/* ============================================
   BUTTON IMPROVEMENTS
   ============================================ */
@media (max-width: 767px) {
    /* Full-width buttons on mobile */
    .btn,
    button,
    .button,
    .button-medium {
        width: 100%;
        max-width: 100%;
        margin-bottom: 10px;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    /* Button groups stack vertically */
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 10px;
        border-radius: 4px !important;
    }
    
    /* Inline buttons */
    .pkg_booking_btn_block .btn {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .pkg_booking_btn_block .col-sm-6 {
        width: 100%;
        padding: 0;
        margin-bottom: 10px;
    }
}

/* ============================================
   NAVIGATION MENU MOBILE
   ============================================ */
@media (max-width: 767px) {
    /* Package navigation menu */
    #package_navigation {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 4px;
        margin-top: 15px;
        padding: 10px;
    }
    
    #package_navigation .pkg_info_list {
        flex-direction: column;
        gap: 5px;
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    #package_navigation .pkg_info_list li {
        width: 100%;
        margin: 0;
    }
    
    #package_navigation .pkg_info_list li > a {
        width: 100%;
        padding: 12px 15px;
        display: block;
        border-radius: 4px;
        background: #f8f9fa;
        color: #333333 !important;
        text-align: left;
    }
    
    #package_navigation .pkg_info_list li.active > a {
        background: #379aef;
        color: #fff !important;
    }
    
    /* Hamburger button */
    .navbar-toggle {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
        margin-top: 5px;
    }
    
    .navbar-toggle .icon-bar {
        width: 24px;
        height: 3px;
        background: #fff;
    }
}

/* ============================================
   FILTER SIDEBAR MOBILE
   ============================================ */
@media (max-width: 767px) {
    /* Filter wrapper */
    .category_filters_wrapper {
        margin-bottom: 20px;
        order: 2;
    }
    
    /* Filter blocks */
    .package_filter_block {
        margin-bottom: 15px;
        border-radius: 8px;
        overflow: hidden;
    }
    
    /* Filter header - make it clickable for accordion */
    .pack_filter_head {
        cursor: pointer;
        user-select: none;
        padding: 15px !important;
        background: #f8f9fa;
        border-bottom: 1px solid #dee2e6;
    }
    
    /* Filter content - collapsible */
    .pf_sub_cont {
        padding: 15px !important;
        max-height: none;
        overflow: visible;
    }
    
    /* Filter items */
    .package_filt {
        margin-bottom: 15px;
        padding: 10px 0;
        display: flex;
        align-items: center;
    }
    
    /* Filter checkboxes */
    .package_filt input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 12px;
        flex-shrink: 0;
    }
    
    /* Filter labels */
    .filters_name {
        font-size: 15px;
        flex: 1;
    }
    
    /* Price filter */
    .price_filter_subcont {
        padding: 10px 0;
    }
    
    .price_filter_subcont span {
        font-size: 14px;
        display: block;
        margin-bottom: 5px;
    }
    
    /* Price slider */
    #filter_price_silder {
        margin-top: 15px;
    }
    
    #filter_price_silder .ui-slider-handle {
        width: 24px;
        height: 24px;
        top: -10px;
        margin-left: -12px;
    }
}

/* ============================================
   PACKAGE RESULTS MOBILE
   ============================================ */
@media (max-width: 767px) {
    /* Results header and sort */
    .category_packages_wrapper {
        margin-top: 20px;
    }
    
    .results_main_head {
        margin-bottom: 15px;
        text-align: center;
    }
    
    .package_sort_cont {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 20px;
    }
    
    #package_sort_btn {
        width: 100%;
        text-align: center;
        padding: 12px 15px;
    }
    
    /* Package cards */
    .pkg_detail_wrapper {
        margin-bottom: 20px;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .pkg_info_wrapper .pkg_heading {
        font-size: 18px;
        margin-bottom: 10px;
        line-height: 1.4;
    }
    
    .pkg_info_wrapper .pkg_final_price_block {
        font-size: 24px;
        line-height: 1.3;
    }
    
    /* Price display - ensure it wraps */
    .pkg_final_price {
        white-space: normal;
        word-wrap: break-word;
    }
    
    .price_dtl_txt {
        display: block;
        margin-top: 5px;
        font-size: 12px;
    }
    
    /* Days wrapper */
    .pkg_days_wrapper {
        display: inline-block;
        margin-bottom: 10px;
    }
    
    /* Themes list */
    .pkg_themes_info_list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 10px;
    }
    
    .pkg_themes_info_list li {
        margin-right: 0;
        margin-bottom: 0;
    }
    
    /* Route info */
    .pkg_route_info {
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 10px;
    }
    
    .pkg_route_info .icon-long-arrow-right {
        margin: 0 5px;
    }
    
    /* View Details button */
    .pkg_info_wrapper .button.button-medium {
        width: 100%;
        margin-top: 15px;
    }
}

/* ============================================
   IMAGE GALLERY MOBILE
   ============================================ */
@media (max-width: 767px) {
    /* Main image container */
    #image-block-cont {
        padding: 0 15px;
        margin-bottom: 15px;
    }
    
    #image-block {
        width: 100%;
    }
    
    #image-block img {
        width: 100%;
        height: auto;
        border-radius: 8px;
    }
    
    /* Thumbnails - horizontal scroll */
    #views_block {
        padding: 0 15px;
        margin-bottom: 15px;
    }
    
    #thumbs_list {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding: 10px 0;
    }
    
    #thumbs_list_frame {
        display: inline-flex;
        gap: 10px;
        padding: 0 10px;
    }
    
    #thumbs_list li {
        float: none;
        display: inline-block;
        width: 80px;
        height: 80px;
        margin: 0;
        flex-shrink: 0;
    }
    
    #thumbs_list li img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 4px;
    }
    
    /* Scroll buttons */
    #view_scroll_left,
    #view_scroll_right {
        display: none; /* Hide on mobile, use native scroll */
    }
}

/* ============================================
   BOOKING SIDEBAR MOBILE
   ============================================ */
@media (max-width: 767px) {
    /* Right column - booking info */
    .pb-right-column.package_info {
        position: static;
        margin-top: 20px;
        padding: 0 15px;
    }
    
    .pb-right-column .card {
        position: static;
        padding: 20px;
        border-radius: 8px;
    }
    
    /* Sticky booking sidebar option */
    .pb-right-column.package_info.sticky-mobile {
        position: sticky;
        bottom: 0;
        z-index: 100;
        background: #fff;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        padding: 15px;
        margin: 0;
        border-radius: 8px 8px 0 0;
    }
    
    /* Booking buttons */
    .pkg_booking_btn_block {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }
    
    .book_now_btn,
    .submit_query_btn {
        width: 100%;
        padding: 15px;
        font-size: 16px;
        font-weight: 600;
    }
}

/* ============================================
   ITINERARY TABS MOBILE
   ============================================ */
@media (max-width: 767px) {
    /* Itinerary navigation */
    .itinerary_nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #eee;
    }
    
    .itinerary_nav li {
        float: none;
        display: inline-block;
        margin-right: 10px;
        flex-shrink: 0;
    }
    
    .itinerary_nav li a {
        padding: 10px 15px;
        white-space: nowrap;
        border-radius: 4px;
        min-width: 80px;
        text-align: center;
    }
    
    /* Itinerary content */
    .itinerary_content {
        padding: 15px;
    }
    
    /* Itinerary elements */
    .itinerary_element_head {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .itinerary_element_content {
        font-size: 14px;
    }
}

/* ============================================
   SLIDER CARDS MOBILE
   ============================================ */
@media (max-width: 767px) {
    /* Landing page header background fix */
    #page #header {
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        min-height: 250px !important;
        width: 100% !important;
        overflow: hidden !important;
    }
    
    /* PLAN HOLIDAY button */
    .package_search_xs {
        width: calc(100% - 30px);
        max-width: calc(100% - 30px);
        margin: 20px 15px;
        padding: 15px 20px;
        font-size: 18px;
        font-weight: 700;
        border-radius: 10px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #ffffff;
        border: none;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    
    /* Slider container */
    .wk_slider_container {
        margin-bottom: 30px;
        padding: 0 15px;
    }
    
    /* Slider header */
    .slider-header-modern {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .wk-block-heading {
        font-size: 22px;
        margin-bottom: 10px;
    }
    
    /* Slider row - horizontal scroll, no vertical clip (price visible) */
    .modern-themes-row {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 15px;
        margin: 0 -15px;
        padding-left: 15px;
        padding-right: 15px;
        align-items: flex-start;
    }
    
    /* Slider list */
    .modern-slider-list,
    .wk_package_slider_cont {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 15px;
        padding: 0;
        align-items: flex-start;
    }
    
    /* Slider cards - fixed width so content + price fit */
    .modern-card-item,
    .wk_package_slider_card {
        flex: 0 0 280px !important;
        min-width: 280px !important;
        max-width: 280px !important;
        width: 280px !important;
        margin-right: 0;
    }
    
    /* Card content - reduce padding on mobile */
    .slider_element.card {
        padding: 10px !important;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
    }
    
    /* Ensure images display full width with proper aspect ratio for mobile */
    .element_img_wrapper,
    .modern-image-wrapper {
        width: 100% !important;
        padding-bottom: 70% !important; /* Better aspect ratio for mobile - not too tall */
        height: 0 !important;
        min-height: 0 !important;
        position: relative;
        overflow: hidden;
        border-radius: 8px;
        margin-bottom: 10px !important;
    }
    
    .element_img_wrapper img,
    .modern-image-wrapper img,
    .modern-card-image {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }
    
    /* Reduce card padding on mobile */
    .slider_element.card,
    .card.slider_element.modern-package-card {
        padding: 10px !important;
    }
    
    /* Reduce content spacing */
    .slide_info_block,
    .modern-card-content {
        padding: 0 5px !important;
    }
    
    .slide_title {
        font-size: 14px !important;
        margin-bottom: 6px !important;
    }
    
    .slide_days_wrapper {
        font-size: 11px !important;
        padding: 3px 8px !important;
        margin-bottom: 6px !important;
    }
    
    .slide_themes_images {
        margin-bottom: 6px !important;
    }
    
    /* Card link - no extra height */
    .card-link {
        display: flex;
        flex-direction: column;
        height: auto;
    }
    
    /* Hide hover effects on mobile */
    .card-hover-effect,
    .image-overlay {
        display: none !important;
    }
    
    /* Badge - smaller */
    .card-badge,
    .badge-price {
        font-size: 11px !important;
        padding: 3px 6px !important;
    }
    
    /* Duration - compact */
    .slide_stay_block {
        margin-bottom: 6px !important;
    }
    
    .slide_title {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    /* Theme block wrapper - same as main slider */
    .wk_theme_block_wrapper.modern-themes-wrapper {
        padding: 40px 0 !important;
    }
    
    .modern-themes-container-fluid {
        padding: 0 15px !important;
    }
    
    .wk_slider_container.modern-slider-container {
        margin-bottom: 30px !important;
        padding: 0 !important;
    }
    
    /* Slider navigation buttons */
    .wk_slider_container .bx-wrapper .bx-next,
    .wk_slider_container .bx-wrapper .bx-prev {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .direction_div {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    /* Two cards on tablet – 769+ only; 768 and below use single-card scroll */
    .modern-card-item,
    .wk_package_slider_card {
        flex: 0 0 calc((100% - 24px) / 2);
        min-width: calc((100% - 24px) / 2);
        max-width: calc((100% - 24px) / 2);
        width: calc((100% - 24px) / 2);
    }
}

/* ============================================
   MOBILE CARD FIXES - 768 and below: single-card scroll, price visible
   ============================================ */
@media (max-width: 750px) {
    .modern-themes-row {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .modern-slider-list {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }
    
    .modern-card-item,
    .wk_package_slider_card {
        flex: 0 0 280px !important;
        max-width: 280px !important;
        min-width: 280px !important;
        width: 280px !important;
    }
}

/* ============================================
   HEADER TEXT MOBILE
   ============================================ */
@media (max-width: 767px) {
    .pkg-header-heading {
        font-size: 32px;
        line-height: 1.2;
    }
    
    .pkg-header-desc {
        font-size: 20px;
        line-height: 1.4;
    }
    
    .pkg-header-inner-wrapper {
        padding: 20px 15px;
        margin: 0 15px;
    }
    
    /* Category header mobile */
    .category-header-modern {
        padding: 40px 0 60px;
    }
    
    .category-header-title {
        font-size: 28px;
        line-height: 1.2;
    }
    
    .category-header-subtitle {
        font-size: 16px;
        line-height: 1.4;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .pkg-header-heading {
        font-size: 42px;
    }
    
    .pkg-header-desc {
        font-size: 24px;
    }
}

/* ============================================
   TAB NAVIGATION MOBILE
   ============================================ */
@media (max-width: 767px) {
    /* Tabs */
    .nav-tabs {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        border-bottom: 2px solid #ddd;
        padding-bottom: 0;
    }
    
    .nav-tabs li {
        float: none;
        display: inline-block;
        margin-right: 5px;
        flex-shrink: 0;
    }
    
    .nav-tabs li a {
        padding: 12px 15px;
        white-space: nowrap;
        min-width: 100px;
        text-align: center;
        border-radius: 4px 4px 0 0;
    }
    
    /* Tab content */
    .tab-content {
        padding: 15px;
    }
}

/* ============================================
   SEARCH AUT complete MOBILE
   ============================================ */
@media (max-width: 767px) {
    /* Autocomplete dropdown */
    .location_search_results_ul {
        position: relative !important;
        width: 100%;
        max-height: 250px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 1000;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 4px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        margin-top: 5px;
    }
    
    .search_result_li {
        padding: 15px;
        font-size: 16px;
        border-bottom: 1px solid #eee;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .search_result_li:last-child {
        border-bottom: none;
    }
    
    .search_result_li:active,
    .search_result_li:hover {
        background-color: #f0f0f0;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
/* Prevent horizontal scroll */
@media (max-width: 767px) {
    body {
        overflow-x: hidden;
    }
    
    .container,
    .container-fluid,
    .row {
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* Better spacing on mobile */
@media (max-width: 767px) {
    .margin-btm-30 {
        margin-bottom: 20px;
    }
    
    hr {
        margin: 20px 0;
    }
}

/* Hide desktop-only elements on mobile */
@media (max-width: 767px) {
    .hidden-mobile {
        display: none !important;
    }
}

/* Show mobile-only elements */
@media (min-width: 768px) {
    .visible-mobile {
        display: none !important;
    }
}

/* ============================================
   WHATSAPP BUTTON - PRESERVE GREEN COLOR
   ============================================ */
/* Ensure WhatsApp button maintains its characteristic green color across all pages */
.qwp-btn,
.qwp-support-fixed .qwp-btn,
.btn.qwp-btn,
.qwp-support .btn-qwp-support {
    background-color: #25D366 !important;
    border-color: #25D366 !important;
    color: #ffffff !important;
}

.qwp-btn:hover,
.qwp-support-fixed .qwp-btn:hover,
.btn.qwp-btn:hover,
.qwp-support .btn-qwp-support:hover {
    background-color: #20BA5A !important;
    border-color: #20BA5A !important;
    color: #ffffff !important;
}

.qwp-btn:active,
.qwp-support-fixed .qwp-btn:active,
.btn.qwp-btn:active,
.qwp-support .btn-qwp-support:active {
    background-color: #1DA851 !important;
    border-color: #1DA851 !important;
}

.qwp-btn:focus,
.qwp-support-fixed .qwp-btn:focus,
.btn.qwp-btn:focus,
.qwp-support .btn-qwp-support:focus {
    background-color: #25D366 !important;
    border-color: #25D366 !important;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.25) !important;
}
