/********** Template CSS **********/
:root {
    --primary: #D81324;
    --secondary: #0B2154;
    --light: #F2F2F2;
    --dark: #111111;
}

/* Z-INDEX HIERARCHY - FIXED */
/* 
   1-999: Normal content
   1000-4999: Navigation, dropdowns
   5000-7999: Modals, overlays
   8000-9999: Important UI elements
   10000+: Chat buttons, critical UI
*/

.bg-custom {
    background-color: rgb(244, 250, 255) !important;
}

.bg-footer-style {
    background: linear-gradient(rgba(0, 0, 0, .9), rgba(0, 0, 0, .9)), url(../img/two-vans.jpg) center center no-repeat;
    background-size: cover;
}

/* FIXED WhatsApp Chat Button - Higher Z-Index */
.whatsapp-chat { 
    position: fixed !important; 
    bottom: 20px !important; 
    left: 20px !important; 
    z-index: 10000 !important; /* Higher than booking forms and modals */
    pointer-events: auto !important;
    touch-action: auto !important;
} 

.whatsapp-chat img { 
    width: 50px !important; 
    height: 50px !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
    transition: transform 0.2s ease !important;
}

.whatsapp-chat:hover img {
    transform: scale(1.1) !important;
}

/* Mobile WhatsApp adjustments */
@media (max-width: 768px) {
    .whatsapp-chat {
        bottom: 15px !important;
        left: 15px !important;
        z-index: 10000 !important;
    }
    
    .whatsapp-chat img {
        width: 45px !important;
        height: 45px !important;
    }
}

/* Extra small mobile */
@media (max-width: 480px) {
    .whatsapp-chat {
        bottom: 10px !important;
        left: 10px !important;
    }
    
    .whatsapp-chat img {
        width: 40px !important;
        height: 40px !important;
    }
}

/* Ensure WhatsApp doesn't conflict with Dialogflow */
.whatsapp-chat {
    /* Position on opposite side from Dialogflow */
    left: 20px !important;
    right: auto !important;
}

.fw-medium {
    font-weight: 600 !important;
}

.back-to-top {
    position: fixed;
    display: none;
    right: 45px;
    bottom: 45px;
    z-index: 9999; /* Below chat buttons but above content */
}

/*** Spinner ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999; /* Highest priority for loading */
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}

/*** Button ***/
.btn {
    font-weight: 500;
    text-transform: uppercase;
    transition: .5s;
}

.btn.btn-primary,
.btn.btn-secondary {
    color: #FFFFFF;
}

.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-lg-square {
    width: 48px;
    height: 48px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
    border-radius: 2px;
}

img {
    vertical-align: middle;
    border: 0;
}

/*** Navbar ***/
.navbar .dropdown-toggle::after {
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    vertical-align: middle;
    margin-left: 8px;
}

.navbar-light .navbar-nav .nav-link {
    margin-right: 30px;
    padding: 25px 0;
    color: #FFFFFF;
    font-size: 15px;
    text-transform: uppercase;
    outline: none;
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link.active {
    color: var(--primary);
}

@media (max-width: 991.98px) {
    .navbar-light .navbar-nav .nav-link  {
        margin-right: 0;
        padding: 10px 0;
    }

    .navbar-light .navbar-nav {
        border-top: 1px solid #EEEEEE;
    }
}

.navbar-light .navbar-brand,
.navbar-light a.btn {
    height: 75px;
}

.navbar-light .navbar-nav .nav-link {
    color: var(--dark);
    font-weight: 500;
}

.navbar-light.sticky-top {
    top: -100px;
    transition: .5s;
    z-index: 1030; /* Bootstrap navbar z-index */
}

@media (min-width: 992px) {
    .navbar .nav-item .dropdown-menu {
        display: block;
        border: none;
        margin-top: 0;
        top: 150%;
        opacity: 0;
        visibility: hidden;
        transition: .5s;
        z-index: 1040; /* Above navbar */
    }

    .navbar .nav-item:hover .dropdown-menu {
        top: 100%;
        visibility: visible;
        transition: .5s;
        opacity: 1;
    }
}

/*** Header ***/
.carousel-caption {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .7);
    z-index: 1;
}

.carousel-control-prev,
.carousel-control-next {
    width: 10%;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
}

/* Styles for larger screens */
#header-carousel .carousel-item {
    position: relative;
    height: 600px; /* Adjust the height as needed */
}

#header-carousel .carousel-item img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    #header-carousel .carousel-item {
        position: relative;
        min-height: 450px;
    }
    
    #header-carousel .carousel-item img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.page-header {
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

.page-header-inner {
    background: rgba(0, 0, 0, .7);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--light);
}

/*** Facts ***/
.fact {
    background: linear-gradient(rgba(0, 0, 0, .7), rgba(0, 0, 0, .7)), url(../img/two-vans.jpg);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

/*** Service ***/
.service .nav .nav-link {
    background: var(--light);
    transition: .5s;
}

.service .nav .nav-link.active {
    background: var(--primary);
}

.service .nav .nav-link.active h4 {
    color: #FFFFFF !important;
}

/* FIXED Booking Section with Proper Z-Index */
.booking {
    background: linear-gradient(rgba(0, 0, 0, .7), rgba(0, 0, 0, .7)), url(../img/london.jpg) center center no-repeat;
    background-size: cover;
    position: relative;
    z-index: 1; /* Lower than chat buttons */
}

/* FIXED Bootstrap DateTimePicker Z-Index */
.bootstrap-datetimepicker-widget.bottom {
    top: auto !important;
    z-index: 5000 !important; /* High enough to appear above booking form but below chat */
}

.bootstrap-datetimepicker-widget.dropdown-menu {
    z-index: 5000 !important;
    position: absolute !important;
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
    pointer-events: auto !important;
}

.bootstrap-datetimepicker-widget .table * {
    border-bottom-width: 0px;
}

.bootstrap-datetimepicker-widget .table th {
    font-weight: 500;
}

.bootstrap-datetimepicker-widget.dropdown-menu {
    padding: 10px;
    border-radius: 2px;
}

.bootstrap-datetimepicker-widget table td.active,
.bootstrap-datetimepicker-widget table td.active:hover {
    background: var(--primary);
}

.bootstrap-datetimepicker-widget table td.today::before {
    border-bottom-color: var(--primary);
}

/* FIXED Modal Z-Index */
.modal {
    z-index: 6000 !important; /* Above datepicker but below chat */
}

.modal-backdrop {
    z-index: 5999 !important;
}

/* Price Modal specific fixes */
#price_summary.modal {
    z-index: 6000 !important;
}

#price_summary .modal-dialog {
    z-index: 6001 !important;
    position: relative;
}

/*** Team ***/
.team-item .team-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    transform: scale(0);
    transition: .5s;
}

.team-item:hover .team-overlay {
    transform: scale(1);
}

.team-item .team-overlay .btn {
    color: var(--primary);
    background: #FFFFFF;
}

.team-item .team-overlay .btn:hover {
    color: #FFFFFF;
    background: var(--secondary)
}

/*** Testimonial ***/
.testimonial-carousel .owl-item .testimonial-text,
.testimonial-carousel .owl-item.center .testimonial-text * {
    transition: .5s;
}

.testimonial-carousel .owl-item.center .testimonial-text {
    background: var(--primary) !important;
}

.testimonial-carousel .owl-item.center .testimonial-text * {
    color: #FFFFFF !important;
}

.testimonial-carousel .owl-dots {
    margin-top: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.testimonial-carousel .owl-dot {
    position: relative;
    display: inline-block;
    margin: 0 5px;
    width: 15px;
    height: 15px;
    border: 1px solid #CCCCCC;
    transition: .5s;
}

.testimonial-carousel .owl-dot.active {
    background: var(--primary);
    border-color: var(--primary);
}

/*** Footer ***/
.footer {
    background: linear-gradient(rgba(0, 0, 0, .9), rgba(0, 0, 0, .9)), url(../img/two-vans.jpg) center center no-repeat;
    background-size: cover;
}

.footer .btn.btn-social {
    margin-right: 5px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light);
    border: 1px solid #FFFFFF;
    border-radius: 35px;
    transition: .3s;
}

.footer .btn.btn-social:hover {
    color: var(--primary);
}

.footer .btn.btn-link {
    display: block;
    margin-bottom: 5px;
    padding: 0;
    text-align: left;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: normal;
    text-transform: capitalize;
    transition: .3s;
}

.footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 10px;
}

.footer .btn.btn-link:hover {
    letter-spacing: 1px;
    box-shadow: none;
}

/* adding this for the footer element*/
.footer .footer-btn-link {
    display: block;
    margin-bottom: 5px;
    padding: 0;
    text-align: left;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: normal;
    text-transform: capitalize;
    transition: .3s;
}

.footer .footer-btn-link::before {
    content: none; /* Removes the icon */
}

.footer .footer-btn-link:hover {
    letter-spacing: 1px;
    box-shadow: none;
    text-decoration: underline;
}

.footer .copyright {
    padding: 25px 0;
    font-size: 15px;
    border-top: 1px solid rgba(256, 256, 256, .1);
}

.footer .copyright a {
    color: var(--light);
}

.footer .footer-menu a {
    margin-right: 15px;
    padding-right: 15px;
    border-right: 1px solid rgba(255, 255, 255, .3);
}

.footer .footer-menu a:last-child {
    margin-right: 0;
    padding-right: 0;
    border-right: none;
}

/* Default styles */
.booking .bg-footer-style {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Styles for smaller screens */
@media (max-width: 767px) {
    .booking .bg-footer-style {
        text-align: left;
    }
}

.logo {
    max-width: 200px; /* Adjust the width as needed */
    height: auto; /* Maintain the aspect ratio */
    margin-right: 10px; /* Adjust the spacing between the logo and text */
    vertical-align: middle; /* Align the logo vertically with the text */
}

.accordion-collapse {
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    overflow: hidden;
}

.accordion-collapse.collapsing {
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    max-height: 0;
    padding: 0;
}

.accordion-collapse.show {
    transition: max-height 0.4s ease-in, padding 0.4s ease-in;
}

.accordion-button::after {
    transition: transform 0.4s ease;
}

.accordion-button.collapsed::after {
    transform: rotate(0deg);
}

.accordion-button:not(.collapsed)::after {
    transform: rotate(180deg);
}

.selectboxItem {
    border-radius: 5px;
    padding: 6px;
    text-align: center;
    background-color: #fff;
    color: #424242;
    border: 1px solid #172646;
    cursor: pointer;
    position: relative; /* For proper z-index stacking */
    z-index: 100; /* Above background but below modals */
}

label {
    display: inline-block;
    max-width: 100%;
}

.selectboxItem img {
    border-radius: 8px;
    cursor: pointer !important;
}

input[type="radio"], input[type="checkbox"] {
    margin: 4px 0 0;
    margin-top: 1px \9;
    line-height: normal;
}

input[type="checkbox"], input[type="radio"] {
    box-sizing: border-box;
    padding: 0;
}

.selectIcon {
    letter-spacing: 2px;
    font-size: 70px;
    margin-left: 4px;
    font-weight: normal;
    cursor: pointer;
}

/* COMPREHENSIVE MOBILE TOUCH FIXES */
/* Basic mobile touch improvements */
@media (max-width: 768px) {
    /* Ensure minimum touch target sizes */
    button, .btn, input[type="submit"], input[type="button"] {
        min-height: 44px !important;
        min-width: 44px !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
    
    /* Improve form control touch targets */
    input[type="text"], input[type="email"], input[type="tel"], 
    select, textarea {
        min-height: 44px !important;
        font-size: 16px !important; /* Prevents iOS zoom */
        touch-action: manipulation;
    }
    
    /* Better radio button and checkbox visibility */
    input[type="radio"], input[type="checkbox"] {
        min-width: 20px !important;
        min-height: 20px !important;
        touch-action: manipulation;
    }
    
    /* Improve selectbox items for mobile */
    .selectboxItem {
        min-height: 60px;
        padding: 15px 10px;
        touch-action: manipulation;
        cursor: pointer;
    }
    
    /* Ensure labels are clickable */
    label {
        cursor: pointer;
        touch-action: manipulation;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Date picker improvements */
    .input-group-text {
        min-width: 50px !important;
        min-height: 50px !important;
        touch-action: manipulation;
        cursor: pointer;
    }
    
    /* Back to top button */
    .back-to-top {
        min-width: 50px !important;
        min-height: 50px !important;
        touch-action: manipulation;
        z-index: 9999 !important; /* Below chat buttons */
    }
    
    /* Dropdown toggle improvements */
    .dropdown-toggle {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Visual feedback for selected items */
    .selectboxItem:active {
        background-color: rgba(216, 19, 36, 0.1);
        transform: scale(0.98);
        transition: all 0.1s ease;
    }
    
    /* Better touch feedback for buttons */
    button:active, .btn:active, input[type="submit"]:active {
        transform: scale(0.98);
        transition: all 0.1s ease;
    }
    
    /* Enhanced selectboxItem styling */
    .selectboxItem {
        margin-bottom: 10px;
        border-radius: 8px;
        transition: all 0.2s ease;
    }
    
    /* Form input improvements */
    .form-control {
        border-radius: 8px;
        border: 2px solid #e0e0e0;
        transition: border-color 0.2s ease;
        z-index: 100; /* Above background */
        position: relative;
    }
    
    .form-control:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 0.2rem rgba(216, 19, 36, 0.25);
        z-index: 101 !important; /* Higher when focused */
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    input, select, textarea {
        -webkit-appearance: none;
        border-radius: 0;
    }
    
    /* Prevent iOS zoom on form focus */
    input[type="text"], input[type="email"], input[type="tel"], 
    input[type="number"], textarea, select {
        font-size: 16px !important;
    }
    
    /* Fix iOS select styling */
    select {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 8px center;
        background-repeat: no-repeat;
        background-size: 16px 12px;
        padding-right: 40px;
    }
}

/* General mobile touch enhancements */
@media (max-width: 768px) {
    /* Improve touch targets for all interactive elements */
    a, button, input, select, textarea, label {
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
    
    /* Better spacing for form groups */
    .form-group {
        margin-bottom: 20px;
    }
    
    /* Enhanced card and container spacing */
    .card, .bg-custom {
        padding: 20px;
        border-radius: 15px;
    }
    
    /* Modal improvements for mobile */
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-content {
        border-radius: 15px;
    }
    
    /* Navigation improvements */
    .navbar-toggler {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Service tab buttons mobile optimization */
    .service .nav .nav-link {
        min-height: 60px;
        padding: 15px;
        margin-bottom: 10px;
        border-radius: 10px;
    }
    
    /* Testimonial carousel touch improvements */
    .owl-carousel {
        touch-action: pan-y;
    }
    
    /* WhatsApp chat button optimization */
    .whatsapp-chat {
        padding: 10px;
        min-width: 50px;
        min-height: 50px;
    }
    
    .whatsapp-chat img {
        width: 45px !important;
        height: 45px !important;
    }
}

/* Extra small devices optimization */
@media (max-width: 480px) {
    .selectboxItem {
        padding: 20px 15px;
        margin-bottom: 15px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    h1, h2, h3, h4, h5 {
        line-height: 1.3;
    }
    
    /* Container padding adjustments */
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* FIXED: Prevent overlays from blocking chat buttons */
@media (max-width: 768px) {
    /* Force form controls to be above background but below chat */
    input[type="text"], 
    input[type="email"], 
    input[type="tel"],
    select,
    textarea,
    button,
    .btn {
        pointer-events: auto !important;
        z-index: 1000 !important;
        position: relative !important;
    }
    
    /* Force form controls to be above background */
    .form-control {
        z-index: 1001 !important;
        position: relative !important;
        background-color: white !important;
        border: 2px solid #007bff !important;
    }
    
    /* Ensure selectbox items are clickable */
    .selectboxItem {
        pointer-events: auto !important;
        z-index: 1002 !important;
        position: relative !important;
        cursor: pointer !important;
    }
    
    /* Fix for any potential overlay blocking elements */
    .carousel-inner::before,
    .carousel-inner::after,
    .modal-backdrop,
    .overlay {
        pointer-events: none !important;
    }
    
    /* FIXED: Postcode inputs with proper z-index */
    #pickup_location,
    #dropoff_location {
        z-index: 1003 !important;
        position: relative !important;
        pointer-events: auto !important;
        background: white !important;
        border: 3px solid #007bff !important;
        min-height: 50px !important;
        font-size: 16px !important;
        touch-action: manipulation !important;
    }
    
    /* Force container to not block touches */
    .carousel-inner,
    .carousel-caption,
    .bg-custom {
        pointer-events: auto !important;
    }
    
    /* Visual feedback for mobile radio button touches */
    .selectboxItem.touch-feedback {
        background-color: rgba(216, 19, 36, 0.1) !important;
        transform: scale(0.98) !important;
        transition: all 0.1s ease !important;
    }
}

/* GLOBAL CALENDAR Z-INDEX FIX */
.bootstrap-datetimepicker-widget {
    z-index: 5000 !important; /* Below chat buttons but above everything else */
    position: absolute !important;
}

.bootstrap-datetimepicker-widget.dropdown-menu {
    z-index: 5000 !important;
    position: absolute !important;
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
}

.bootstrap-datetimepicker-widget table {
    background: white !important;
}

/* Ensure calendar appears above form fields */
.tempusdominus-bootstrap-4 .bootstrap-datetimepicker-widget {
    z-index: 5000 !important;
}

/* FIXED: Dialogflow specific mobile styles to prevent full screen takeover */
@media (max-width: 768px) {
    /* Override any full-screen Dialogflow styles */
    df-messenger {
        position: fixed !important;
        bottom: 15px !important;
        right: 15px !important;
        top: auto !important;
        left: auto !important;
        width: 300px !important;
        height: 400px !important;
        max-width: 300px !important;
        max-height: 400px !important;
        transform: none !important;
    }
    
    /* Ensure chat window respects size limits */
    df-messenger-chat {
        max-height: 350px !important;
        overflow-y: auto !important;
        width: 100% !important;
    }
    
    /* Chat bubble positioning */
    df-messenger-chat-bubble {
        position: relative !important;
        width: auto !important;
        height: auto !important;
    }
}

/* FIXED: Additional protection against overlay issues */
.chat-widget-container {
    position: fixed !important;
    z-index: 10001 !important;
    pointer-events: auto !important;
}

.whatsapp-container {
    position: fixed !important;
    z-index: 10000 !important;
    pointer-events: auto !important;
}