/* Hide WhatsApp floating button globally */
.wp-floating-btn {
  display: none !important;
}

/* Override inline styles for category navbar */
.navbar {
  background: linear-gradient(135deg, #ffcc00, #ff6600, #b22222) !important;
}

/* Mobile Header Fixes */
@media only screen and (max-width: 768px) {
  /* Fix header gradient background on mobile */
  /* .header-middle {
    background: linear-gradient(135deg, #ffcc00, #ff6600, #b22222) !important;
    padding: 10px 5px !important;
    border-bottom: none !important;
  } */
  
  /* Ensure middle-right section takes full width */
  .middle-right {
    flex: 1 !important;
    width: 100% !important;
  }

  /* Fix mobile menu layout - keep original layout */
  .mobile-menu.navBar {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
  }

  .mobile-menu.navBar > a {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    font-size: 12px !important;
    padding: 5px !important;
    color: white !important;
  }

  .mobile-menu.navBar > a svg {
    width: 20px !important;
    height: 20px !important;
    stroke: white !important;
    margin-bottom: 2px;
  }

  .mobile-menu.navBar > a span {
    color: white !important;
    font-size: 11px !important;
  }

  /* Fix header container spacing */
  /* .header-middle-container {
    padding: 0 !important;
    gap: 0 !important;
  } */

  /* Language dropdown fixes */
  .middle-left {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 15px;
  }

  .lang-dropdown .dropdown__button {
    background: transparent !important;
    border: none !important;
    color: white !important;
    font-size: 12px !important;
    padding: 5px !important;
  }

  /* Fix header bottom for mobile */
  .header-bottom {
    padding: 10px 15px !important;
  }

  .header-logo img {
    max-height: 40px !important;
    width: auto !important;
  }

  /* Fix mobile search */
  .mobile-search-tigger {
    font-size: 20px !important;
    color: var(--primary);
  }

  /* Category navbar fixes for mobile */
  .navbar {
    height: auto !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    padding: 10px 15px !important;
    border-radius: 0 !important;
    background: linear-gradient(135deg, #ffcc00, #ff6600, #b22222) !important;
    margin: 0 !important;
  }

  .navbar .nav-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .navbar .nav-item {
    flex-shrink: 0 !important;
    margin: 0 !important;
  }

  .navbar .nav-link {
    display: inline-block !important;
    padding: 8px 15px !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px !important;
    margin: 0 !important;
  }

  .navbar .nav-link:hover,
  .navbar .nav-link:active {
    background: rgba(255, 255, 255, 0.2) !important;
  }

  /* Hide dropdown on mobile - show as separate menu */
  .navbar .dropdown-menu {
    display: none !important;
  }

  /* Hide logo on mobile in navbar */
  .navbar-logo {
    display: none !important;
  }

  /* Hide scrollbar but keep functionality */
  .navbar::-webkit-scrollbar,
  .navbar .nav-list::-webkit-scrollbar {
    display: none;
  }

  /* Fix container fluid padding */
  .container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Fix sticky header */
  header.sticky {
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important; /* Reduced from 9999 to allow menu overlay */
    background: white !important;
  }
  
  /* Fix mobile menu offcanvas z-index */
  .offcanvas,
  .offcanvas-start,
  .offcanvas-end {
    z-index: 10000 !important; /* Higher than header */
  }
  
  .offcanvas-backdrop {
    z-index: 9999 !important; /* Between header and offcanvas */
  }
  
  /* Ensure offcanvas menu content is above everything */
  .offcanvas-body {
    z-index: 10001 !important;
    position: relative !important;
  }

  /* Fix mobile bottom navigation icons */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 5px 10px 10px 10px;
    z-index: 998; /* Below header and offcanvas */
    height: 60px;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
  }

  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 10px;
    padding: 2px 4px;
    position: relative;
    flex: 1;
    max-width: 70px;
    text-decoration: none;
    min-width: 0;
  }
  
  .bottom-nav a span:not(.badge) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }

  .bottom-nav a svg {
    width: 20px !important;
    height: 20px !important;
    margin-bottom: 2px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0 !important;
  }
  
  .bottom-nav a svg path,
  .bottom-nav a svg line,
  .bottom-nav a svg polyline,
  .bottom-nav a svg circle,
  .bottom-nav a svg rect {
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
  }
  
  /* Filled elements like circles in cart icon */
  .bottom-nav a svg circle[fill] {
    fill: currentColor !important;
    stroke: none !important;
  }

  .bottom-nav a.active {
    color: var(--primary);
  }
  
  /* Special styling for Shop center icon */
  .bottom-nav .shop-center-icon {
    position: relative;
    transform: translateY(-15px);
    background: linear-gradient(135deg, #ffcc00, #ff6600);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-shadow: 0 3px 10px rgba(255, 102, 0, 0.3);
    border: 3px solid white;
    margin: 0;
    padding: 0;
    flex: 0 0 auto !important;
    max-width: 48px !important;
  }
  
  .bottom-nav .shop-center-icon svg {
    width: 24px !important;
    height: 24px !important;
    color: white !important;
  }
  
  .bottom-nav .shop-center-icon svg path,
  .bottom-nav .shop-center-icon svg circle {
    stroke: white !important;
  }
  
  .bottom-nav .shop-center-icon span {
    color: white !important;
    font-size: 8px !important;
    font-weight: bold;
    margin-top: 2px;
  }
  
  .bottom-nav .shop-center-icon.active {
    background: linear-gradient(135deg, #ff6600, #b22222);
    transform: translateY(-17px);
  }
  
  /* Ensure cart icon stays visible */
  .bottom-nav a[href*="cart"] svg {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* Fix cart badge positioning and styling */
  .bottom-nav .cart-items-count {
    position: absolute;
    top: -5px;
    right: 50%;
    transform: translateX(8px);
    font-size: 10px;
    padding: 2px 5px;
    min-width: 18px;
    height: 18px;
    line-height: 14px;
    background-color: #dc3545 !important;
    color: white !important;
    border-radius: 50%;
    text-align: center;
    font-weight: bold;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  }
  
  .bottom-nav .cart-items-count.d-none {
    display: none !important;
  }
  
  /* Show badge when it has content */
  .bottom-nav .cart-items-count:not(:empty):not(.d-none) {
    display: flex !important;
  }
  
  /* Alternative badge style */
  .bottom-nav .badge {
    background-color: #dc3545 !important;
    color: white !important;
  }
  
  /* Ensure cart link is positioned relative for badge */
  .bottom-nav a[href*="cart"] {
    position: relative !important;
  }

  /* Add padding to body to account for fixed bottom nav */
  /* body {
    padding-bottom: 70px !important;
    overflow-x: hidden !important;
  } */
  
  /* Prevent horizontal scroll on mobile */
  /* html {
    overflow-x: hidden !important;
  } */
  
  /* Ensure footer doesn't have extra padding */
  footer,
  .footer {
    margin-bottom: 0 !important;
    padding-bottom: 20px !important;
  }
  
  /* Fix any dynamically added spacing */
  body > div:last-of-type:not(.bottom-nav):empty {
    display: none !important;
  }
  
  /* Ensure main content area doesn't have extra padding */
  main {
    padding-bottom: 0 !important;
  }

  /* Hide WhatsApp widget on mobile */
  .wp-floating-btn {
    display: none !important;
  }

  /* Hide all WhatsApp-related elements on mobile */
  .whatsapp-widget,
  .whatsapp-chat,
  .wa-widget,
  .whatsapp-button,
  .whatsapp-icon,
  .floating-whatsapp,
  a[href*="whatsapp"]:not(.bottom-nav a),
  a[href*="wa.me"]:not(.bottom-nav a),
  img[src*="whatsapp"] {
    display: none !important;
  }

  /* Tawk.to specific positioning */
  #tawk-chat-widget-container,
  .tawk-widget,
  .tawk-min-container,
  .tawk-button,
  div[id*="tawk"],
  iframe[title*="chat"],
  iframe[title*="Tawk"],
  .widget-container {
    bottom: 180px !important;
    right: 15px !important; /* Same position as WhatsApp but higher */
    position: fixed !important;
    z-index: 998 !important;
  }

  /* Tawk.to bubble specific */
  #tawk-bubble-container,
  .tawk-bubble,
  .tawk-min-chat,
  #tawk-minified-box,
  .tawk-minified-wrapper {
    bottom: 180px !important; /* Above WhatsApp */
    right: 15px !important;
  }

  /* Common chat widget selectors */
  div[style*="position: fixed"][style*="bottom"],
  div[style*="position:fixed"][style*="bottom"],
  .chat-container,
  .support-chat,
  .live-chat {
    bottom: 180px !important;
  }

  /* Ensure Tawk.to doesn't overlap with WhatsApp */
  #tawk-chat-widget-container.tawk-mobile,
  #tawk-chat-widget-container {
    bottom: 180px !important;
    right: 15px !important;
    max-height: calc(100vh - 240px) !important;
  }

  /* When Tawk.to chat is expanded */
  .tawk-mobile-opened #tawk-chat-widget-container,
  .tawk-desktop-opened #tawk-chat-widget-container {
    bottom: 180px !important;
    right: 15px !important;
  }
  
  /* Tawk.to parent container fix */
  body > div[style*="bottom"][style*="right"][style*="position: fixed"]:not(.bottom-nav):not(.wp-floating-btn) {
    bottom: 180px !important;
    right: 15px !important;
  }

  /* WhatsApp specific styling */
  .wp-floating-btn .wp-icon,
  .whatsapp-widget img,
  .whatsapp-icon img,
  img[alt*="WhatsApp"],
  img[alt*="whatsapp"] {
    width: 50px !important;
    height: 50px !important;
  }

  .wp-floating-btn {
    background: transparent !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
  }
  
  .wp-floating-btn a {
    display: block !important;
    width: 50px !important;
    height: 50px !important;
  }

  /* Fix dropdown positioning */
  .dropdown__list {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    background: white !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    z-index: 10000 !important;
    min-width: 120px !important;
  }

  /* Fix cart dropdown on mobile */
  .cart-dropdown {
    position: fixed !important;
    top: 60px !important;
    right: 10px !important;
    left: 10px !important;
    max-width: none !important;
    width: auto !important;
  }

  /* Override inline styles for Tawk.to */
  iframe[src*="tawk.to"],
  iframe[title*="chat widget"] {
    bottom: 180px !important;
    right: 15px !important;
  }

  /* Target Tawk.to by specific attributes */
  div[style*="position: fixed"][style*="z-index: 999999"] {
    bottom: 180px !important;
    right: 15px !important;
  }

  /* Override any element positioned at bottom right */
  div[style*="bottom:0"][style*="right:"][style*="position:fixed"],
  div[style*="bottom: 0"][style*="right:"][style*="position: fixed"] {
    bottom: 180px !important;
  }
  
  /* Force Tawk iframe container positioning */
  #tawk-chat-widget-container iframe,
  #tawk-chat-widget-container > div {
    bottom: 180px !important;
    position: fixed !important;
  }

  /* Ensure proper z-index layering */
  .bottom-nav {
    z-index: 998 !important; /* Below header and offcanvas */
  }

  /* Stack multiple chat widgets vertically */
  .wp-floating-btn + #tawk-chat-widget-container,
  .wp-floating-btn + div[id*="tawk"] {
    bottom: 130px !important;
  }
}

  /* Additional Tawk.to targeting */
  #tawk-minified-wrapper,
  #tawk-minified-container,
  .widget-visible[style*="bottom"],
  [id^="tawk-"][style*="position: fixed"] {
    bottom: 180px !important;
  }
  
  /* Override widget-visible class specifically */
  .widget-visible {
    bottom: 180px !important;
    right: 15px !important;
  }
  
  /* Target iframe with widget-visible class */
  iframe.widget-visible {
    bottom: 180px !important;
    right: 15px !important;
  }
  
  /* More specific targeting for Tawk widget */
  body .widget-visible[style*="bottom: 20px"] {
    bottom: 180px !important;
    right: 15px !important;
  }
  
  body iframe[style*="bottom: 20px"][style*="right: 20px"] {
    bottom: 180px !important;
    right: 15px !important;
  }

  /* Hide Today's Deal banner on mobile only */
  .todays-deal-banner {
    display: none !important;
  }
  
  /* Remove the rule that was breaking the layout on desktop - products should maintain grid on mobile too */
  /* The banner is hidden on mobile, but products should still follow normal Bootstrap grid */
}

/* Tablet specific fixes */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
  /* Ensure Today's Deal banner is visible on tablets */
  .todays-deal-banner {
    display: block !important;
  }
  
  /* .header-middle {
    padding: 15px 20px !important;
  } */

  .navBar > a {
    font-size: 13px !important;
    padding: 10px 15px !important;
  }

  .category-menu ul li a {
    font-size: 13px !important;
    padding: 8px 15px !important;
  }
}

/* Fix for small mobile devices */
@media only screen and (max-width: 375px) {
  .mobile-menu.navBar > a span {
    font-size: 10px !important;
  }

  .header-logo img {
    max-height: 35px !important;
  }

  .category-menu ul li a {
    font-size: 12px !important;
    padding: 4px 8px !important;
  }
}

/* Desktop specific - ensure Today's Deal banner is visible */
@media only screen and (min-width: 1025px) {
  .todays-deal-banner {
    display: block !important;
  }
}

/* Message Notification Badge */
.message-notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: #dc3545;
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: bold;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 10;
}

/* Ensure the chat button is positioned relatively for the badge */
.chat-btn.position-relative {
  position: relative !important;
}

/* JustFriend Download Button Responsive Fix */
.justfriend-download-btn {
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media only screen and (max-width: 480px) {
  .justfriend-download-btn {
    padding: 10px 20px !important;
    font-size: 14px !important;
  }
}

@media only screen and (max-width: 375px) {
  .justfriend-download-btn {
    padding: 8px 15px !important;
    font-size: 13px !important;
  }
  
  .justfriend-download-btn i {
    display: none; /* Hide arrow icon on very small screens to save space */
  }
}

@media only screen and (max-width: 320px) {
  .justfriend-download-btn {
    padding: 8px 12px !important;
    font-size: 12px !important;
  }
}

/* Newsletter Section Responsive Background */
.newsletter {
  background-attachment: scroll !important; /* Better for mobile */
  background-position: right center !important; /* Show logo on right side */
  background-size: cover !important;
  min-height: auto !important;
  position: relative;
}

/* Alternative: If you want the logo as a subtle watermark */
.newsletter.watermark-style {
  background-position: 85% center !important; /* Position logo to the right */
  background-size: cover !important;
}

/* Alternative: If you want to ensure the full logo is visible */
.newsletter.contain-style {
  background-size: contain !important;
  background-position: right center !important;
  background-repeat: no-repeat !important;
}

/* Option to add stronger overlay for better text readability */
.newsletter::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(139, 69, 19, 0.85), rgba(160, 82, 45, 0.75));
  z-index: 1;
}

.newsletter .Container {
  position: relative;
  z-index: 2; /* Ensure content is above overlay */
}

@media only screen and (max-width: 768px) {
  .newsletter {
    padding: 40px 0 !important; /* Reduce padding on mobile */
    background-attachment: scroll !important;
    background-position: center bottom !important; /* Adjust for mobile */
    background-size: 150% auto !important; /* Zoom out slightly on mobile */
  }
  
  .newsletter h2 {
    font-size: 24px !important;
    line-height: 1.3 !important;
  }
  
  .newsletter span {
    font-size: 14px !important;
  }
  
  .newsletter-form-input {
    flex-direction: row !important;
    max-width: 100% !important;
  }
  
  .newsletter-email {
    font-size: 14px !important;
  }
}

@media only screen and (max-width: 480px) {
  .newsletter {
    padding: 30px 0 !important;
  }
  
  .newsletter h2 {
    font-size: 20px !important;
  }
  
  .newsletter-form {
    margin-top: 20px !important;
  }
}

/* For very small devices */
@media only screen and (max-width: 375px) {
  .newsletter {
    background-size: cover !important;
    background-position: center center !important;
  }
  
  .newsletter-form-input input {
    padding: 10px !important;
    font-size: 13px !important;
  }
  
  .newsletter-submit {
    padding: 10px 15px !important;
  }
}

/* Ensure background covers full width on all devices */
@media only screen and (min-width: 1920px) {
  .newsletter {
    background-size: cover !important;
    background-position: center center !important;
  }
}

/* Header-middle navigation CSS removed - to be implemented later */