/* Mobile Fixes for YOW Website */

/* =================================
   Fix Horizontal Scroll on Mobile
   ================================= */

/* Prevent horizontal scroll on all devices */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

body {
  position: relative !important;
}

/* Keep preloader but ensure it doesn't block content */
#preloader {
  position: fixed !important;
  z-index: 99999 !important;
}

/* Ensure all containers don't overflow */
.container, .container-fluid {
  overflow-x: hidden !important;
}

/* Only apply max-width constraint on specific elements, not everything */
img, video, iframe, embed, object {
  max-width: 100%;
}

/* Fix any elements that might cause horizontal scroll - ONLY on mobile */
@media (max-width: 767px) {
  .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
  }
}


/* =================================
   Mobile Navigation Fixes
   ================================= */

/* Hide mobile menu login/logout on desktop - show only on mobile */
@media (min-width: 992px) {
  .nav-custom-menu.navbar-nav > li:last-child {
    display: none !important;
  }
}

/* Ensure mobile menu toggle is visible and clickable */
@media (max-width: 991px) {

  /* Fix hamburger menu button */
  .navbar-toggler {
    display: block !important;
    position: relative;
    z-index: 9999;
    background: transparent;
    border: none;
    padding: 10px;
    margin-right: 10px;
    cursor: pointer;
    touch-action: manipulation;
  }

  .navbar-toggler:focus {
    outline: none;
    box-shadow: none;
  }

  /* Ensure cross menu is clickable */
  .cross-menu-wrapper {
    /* display: flex; */
    flex-direction: column;
    /* gap: 4px; */
    width: 22px;
    cursor: pointer;
  }

  .cross-menu-wrapper span {
    display: block;
    width: 100%;
    height: 2px;
    background: #333;
    transition: all 0.3s ease;
    border-radius: 1px;
  }

  /* Animate hamburger to X when menu is open */
  .navbar-toggler:not(.collapsed) .cross-menu-wrapper span.bar1 {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .navbar-toggler:not(.collapsed) .cross-menu-wrapper span.bar2 {
    opacity: 0;
  }

  .navbar-toggler:not(.collapsed) .cross-menu-wrapper span.bar3 {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  /* Make hamburger icon smaller and better looking */
  .navbar-toggler.cross-menu {
    padding: 5px 7px !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 4px !important;
    background: #fff !important;
    width: 40px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .navbar-toggler.cross-menu:hover {
    background: #f8f9fa !important;
  }

  .navbar-toggler.cross-menu:focus {
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2) !important;
  }

  /* Make menu visible when expanded */
  .navbar-collapse {
    position: fixed;
    top: 100px;
    left: 0;
    right: 0;
    background: #fff;
    z-index: 9998;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    /* padding: 20px 0; */
  }

  .navbar-collapse.show {
    display: block !important;
    margin: 0px 20px;
  }

  /* Mobile menu items */
  .nav-custom-menu {
    flex-direction: column;
    width: 100%;
    padding: 0 20px;
    max-width: 100vw !important;
    box-sizing: border-box;
  }

  /* Ensure responsive mobile menu container doesn't overflow */
  .responsive-mobile-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%;
  }

  .responsive-mobile-menu .logo-wrapper {
    flex: 1;
    max-width: calc(100% - 60px);
  }

  .responsive-mobile-menu .logo img {
    max-width: 120px !important;
    height: auto !important;
  }

  .nav-custom-menu li {
    width: 100%;
    border-bottom: 1px solid #f0f0f066;
    padding: 0;
  }

  .nav-custom-menu li a {
    display: block;
    padding: 15px 10px;
    font-size: 16px;
    color: #333;
    text-decoration: none;
  }

  .nav-custom-menu li.current-menu-item a,
  .nav-custom-menu li a:hover {
    color: #7c3aed !important;
    background: #f9f9f9;
  }

  /* Hide desktop buttons in mobile menu */
  .nav-custom-menu li[style*="display: none"] {
    display: block !important;
  }

  /* Mobile cart in menu */
  .mobile-cart {
    background: #ff6b6b;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 5px;
  }

  /* Fix header buttons on mobile */
  .nav-right-content {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .nav-right-content .btn-wrapper {
    display: none !important; /* Hide on mobile, show in menu instead */
  }

  .nav-right-content .icon-part {
    display: none !important;
  }

  .cart-icon {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 15px;
  }

  .cart-icon li a {
    color: #333;
    font-size: 20px;
    position: relative;
    display: flex;
    align-items: center;
    padding: 5px;
  }

  .cart-icon .cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
  }

  /* User icon styling */
  .user-icon a {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px !important;
  }

  .user-icon i {
    font-size: 16px;
  }
}

/* =================================
   Button Fixes for Mobile
   ================================= */

@media (max-width: 767px) {

  /* Make all buttons touch-friendly */
  .boxed-btn,
  .btn,
  button {
    min-height: 44px !important;
    padding: 12px 20px !important;
    font-size: 14px !important;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
  }

  /* Book Now button mobile */
  .boxed-btn {
    display: inline-block;
    white-space: nowrap;
  }

  /* Fix modal buttons on mobile */
  .modal-content button {
    min-height: 44px !important;
    width: 100%;
    margin-bottom: 10px;
  }

  /* Make form buttons full width on mobile */
  .form-group button,
  form button[type="submit"] {
    width: 100%;
  }

  /* Hero section buttons */
  .hero-area .boxed-btn,
  .banner-area .boxed-btn {
    width: 100%;
    max-width: 300px;
    margin: 10px auto;
    display: block;
  }
}

/* =================================
   Homepage Mobile Fixes
   ================================= */

@media (max-width: 767px) {

  /* Fix header slider on mobile */
  .header-slider .single-slider {
    min-height: 400px !important;
    height: auto !important;
    padding: 60px 0 !important;
  }

  .header-area.header-bg {
    min-height: 400px !important;
  }

  .header-slider .slider-content {
    padding: 20px;
  }

  .header-slider h1,
  .header-slider .title {
    font-size: 28px !important;
    line-height: 1.3 !important;
    margin-bottom: 15px !important;
  }

  .header-slider p {
    font-size: 14px !important;
    margin-bottom: 20px !important;
  }

  /* Category icons on mobile */
  .category-item,
  .service-item {
    padding: 20px 10px !important;
    margin-bottom: 15px;
  }

  .category-item img {
    max-width: 60px !important;
    height: auto !important;
  }

  /* Fix service cards */
  .single-service {
    margin-bottom: 30px;
    padding: 30px 20px !important;
  }

  /* Testimonials on mobile */
  .testimonial-item {
    padding: 20px !important;
  }

  /* Client logos */
  .client-active-area .owl-item img {
    max-width: 80px !important;
    margin: 0 auto;
  }
}

/* =================================
   Services Page Mobile Fixes
   ================================= */

@media (max-width: 991px) {

  /* Category tabs on mobile */
  .nav-tabs {
    display: flex;
    flex-wrap: wrap;
    border: none !important;
  }

  .nav-tabs .nav-link {
    flex: 1 1 calc(50% - 10px);
    margin: 5px;
    padding: 15px 10px !important;
    text-align: center;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    font-size: 13px !important;
    touch-action: manipulation;
  }

  .nav-tabs .nav-link.active {
    background: #ff6b6b !important;
    color: #fff !important;
    border-color: #ff6b6b !important;
  }

  /* Map on mobile */
  #map {
    height: 300px !important;
    width: 100% !important;
    margin-bottom: 20px;
  }

  /* Search input on map */
  #pac-input {
    width: calc(100% - 20px) !important;
    margin: 10px !important;
    max-width: none !important;
    font-size: 14px !important;
    padding: 10px !important;
  }

  /* Location list on mobile */
  .location-list {
    max-height: 400px;
    overflow-y: auto;
  }

  .location-item {
    padding: 15px !important;
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    touch-action: manipulation;
  }

  .location-item:active {
    background: #f5f5f5;
  }
}

/* =================================
   Modal Fixes for Mobile
   ================================= */

@media (max-width: 767px) {

  /* Make modals mobile-friendly */
  .modal-overlay {
    padding: 10px !important;
  }

  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 95vh !important;
    margin: 0 !important;
    border-radius: 10px !important;
  }

  .modal-content h3 {
    font-size: 20px !important;
    margin-bottom: 20px !important;
  }

  /* Form fields in modal */
  .modal-content .form-group {
    margin-bottom: 15px !important;
  }

  .modal-content input,
  .modal-content select,
  .modal-content textarea {
    width: 100% !important;
    padding: 12px !important;
    font-size: 14px !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
  }

  /* Close button */
  .modal-content button[style*="position: absolute"] {
    top: 10px !important;
    right: 10px !important;
    font-size: 28px !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* =================================
   Contact Page Mobile Fixes
   ================================= */

@media (max-width: 767px) {

  .contact-area {
    padding: 30px 0 !important;
  }

  .contact-area h2 {
    font-size: 24px !important;
    margin-bottom: 20px !important;
  }

  .contact-content p {
    font-size: 14px !important;
    line-height: 1.8 !important;
  }

  /* Contact form */
  .contact-form .form-group {
    margin-bottom: 15px;
  }

  .contact-form input,
  .contact-form textarea {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 5px;
  }

  .contact-form textarea {
    min-height: 120px;
  }
}

/* =================================
   Footer Mobile Fixes
   ================================= */

@media (max-width: 767px) {

  .footer-area {
    padding: 30px 0 !important;
  }

  .footer-widget {
    margin-bottom: 30px;
  }

  .footer-widget h4 {
    font-size: 18px !important;
    margin-bottom: 15px !important;
  }

  .footer-widget ul li {
    margin-bottom: 10px;
  }

  .footer-widget ul li a {
    font-size: 14px !important;
    display: block;
    padding: 5px 0;
  }

  /* Social icons */
  .social_share {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  .social_share li {
    flex: 0 0 auto;
  }

  .social_share li a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
    color: #fff;
    border-radius: 50%;
    font-size: 16px;
  }

  /* Subscribe form */
  .subscribe-form {
    display: flex;
    gap: 10px;
  }

  .subscribe-form input {
    flex: 1;
    padding: 10px !important;
    font-size: 14px !important;
  }

  .subscribe-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  /* Back to top button */
  .back-to-top {
    bottom: 20px !important;
    right: 20px !important;
  }

  .back-to-top span {
    width: 44px !important;
    height: 44px !important;
    font-size: 20px !important;
  }
}

/* =================================
   Login/Checkout Page Mobile Fixes
   ================================= */

@media (max-width: 767px) {

  .login-page,
  .checkout-page {
    padding: 20px 0 !important;
  }

  .login-form,
  .checkout-form {
    padding: 20px !important;
  }

  .login-form h2,
  .checkout-form h2 {
    font-size: 22px !important;
    margin-bottom: 20px !important;
  }

  /* Tabs in login page */
  .nav-tabs .nav-item {
    flex: 1;
  }

  .nav-tabs .nav-link {
    padding: 12px 10px !important;
    font-size: 14px !important;
  }

  /* Cart items */
  .cart-item {
    padding: 15px !important;
    margin-bottom: 15px !important;
  }

  .cart-item-details {
    font-size: 14px !important;
  }

  .cart-item-price {
    font-size: 16px !important;
    font-weight: bold;
  }

  /* Remove button in cart */
  .remove-btn {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 10px !important;
  }
}

/* =================================
   Improve Touch Interactions
   ================================= */

/* Make all links and buttons touch-friendly */
a, button, input[type="submit"], .clickable {
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
  touch-action: manipulation;
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 767px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important; /* Prevents iOS zoom */
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Fix viewport issues on mobile */
body {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Improve readability on small screens */
@media (max-width: 767px) {
  body {
    font-size: 14px;
    line-height: 1.6;
  }

  h1 { font-size: 26px !important; }
  h2 { font-size: 22px !important; }
  h3 { font-size: 20px !important; }
  h4 { font-size: 18px !important; }
  h5 { font-size: 16px !important; }
  h6 { font-size: 14px !important; }

  p {
    margin-bottom: 15px;
  }
}

/* Fix container spacing on mobile */
@media (max-width: 767px) {
  .container {
    padding-left: 15px !important;
    padding-right: 15px !important;
    max-width: 100% !important;
  }

  .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
  }

  [class*="col-"] {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  /* Fix specific elements that might cause horizontal scroll */
  .header-slider,
  .owl-carousel,
  .slider-content,
  .section-title,
  pre, code {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Fix wide images and media */
  img, video, iframe, embed, object {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Fix tables on mobile */
  table {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    display: block !important;
  }

  /* Fix forms that might overflow */
  form, .form-group, input, textarea, select {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* =================================
   Cart Count Badge Fixes (All Devices)
   ================================= */

/* Desktop cart count in header */
.cart-icon li.cart {
  position: relative;
}

.cart-icon li.cart a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-icon .cart-count {
  position: absolute !important;
  top: -8px !important;
  right: -8px !important;
  background: #ff6b6b !important;
  color: #fff !important;
  border-radius: 50% !important;
  width: 20px !important;
  height: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  z-index: 10 !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
  padding: 0 !important; /* Override any padding */
  text-align: center !important;
}

/* Mobile cart count in menu */
.mobile-cart {
  display: inline-flex !important;
  background: #ff6b6b !important;
  color: #fff !important;
  padding: 4px 8px !important;
  border-radius: 10px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  margin-left: 8px !important;
  line-height: 1 !important;
  vertical-align: middle !important;
  position: relative !important;
  top: 0 !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Ensure cart icon has proper spacing */
.cart-icon li {
  position: relative;
  list-style: none;
}

/* Fix cart icon alignment */
.flaticon-shopping-bag {
  font-size: 22px;
  display: inline-block;
  vertical-align: middle;
}

/* Ensure the count updates with animation */
.cart-count.updated {
  animation: bounce 0.3s ease;
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* Desktop specific fixes */
@media (min-width: 992px) {
  .nav-right-content .cart-icon {
    margin-right: 20px;
  }

  .cart-icon li.cart a {
    padding: 8px;
  }

  .cart-icon .cart-count {
    top: -6px;
    right: -6px;
  }
}

/* Tablet fixes */
@media (min-width: 768px) and (max-width: 991px) {
  .cart-icon .cart-count {
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    font-size: 10px;
  }
}
