:root {
  --primary: #1a1f36;
  --primary-hover: #0d6efd;
  --secondary: #ff6b35;
  --accent: #00b894;
  --text: #333333;
  --text-light: #666666;
  --text-white: #ffffff;
  --bg: #ffffff;
  --bg-light: #f8f9fa;
  --bg-dark: #1a1f36;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-sm: 4px;
  --transition: 0.25s ease;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --container: 1240px;
}

/* ==========================================================================
   1. GLOBAL RESET & OVERFLOW PREVENTION (CRITICAL FIX)
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

/* Media, Images & Embeds */
img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary-hover);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   2. CONTAINERS & GRID UTILITIES
   ========================================================================== */
.container, .container-fluid {
  width: 100%;
  max-width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
  box-sizing: border-box;
}

@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1160px; } }
@media (min-width: 1400px) { .container { max-width: var(--container); } }

/* Ensure rows and columns never exceed viewport */
.row {
  max-width: 100%;
  margin-right: -8px;
  margin-left: -8px;
}
.row > * {
  max-width: 100%;
  padding-right: 8px;
  padding-left: 8px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .row {
    margin-right: -12px;
    margin-left: -12px;
  }
  .row > * {
    padding-right: 12px;
    padding-left: 12px;
  }
}

.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.grid-4 { display: grid; gap: 1rem; grid-template-columns: 1fr; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5em;
  color: var(--primary);
  word-break: break-word;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

@media (min-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.65rem; }
}

/* ==========================================================================
   3. HEADER & MOBILE NAVIGATION BAR
   ========================================================================== */
.site-header {
  position: relative;
  z-index: 1000;
  background: var(--bg);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.main-header {
  background: #ffffff;
  position: relative;
  width: 100%;
}

.navbar-brand {
  max-width: 100%;
}
.navbar-brand span {
  white-space: nowrap;
}

.search-box-wrapper {
  width: 100%;
  max-width: 100%;
}

.search-input {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 50rem;
  outline: none;
  box-sizing: border-box;
}
.search-input:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13,110,253,0.15);
}

.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1050;
  display: none;
  max-height: 380px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: var(--text);
}
.search-result-item:hover {
  background-color: var(--bg-light);
  text-decoration: none;
}
.search-result-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

/* Vertical Sidebars */
.vertical-sidebar {
  max-width: 85vw !important;
  box-shadow: 0 0 30px rgba(0,0,0,0.15) !important;
  z-index: 1060;
}

/* ==========================================================================
   4. BREADCRUMBS (SINGLE LINE & TOUCH-SCROLLABLE)
   ========================================================================== */
.breadcrumb-nav {
  width: 100% !important;
  max-width: 100% !important;
  background-color: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  overflow: hidden !important;
}

.breadcrumb-nav .container {
  overflow: hidden !important;
  max-width: 100% !important;
}

.breadcrumb,
.breadcrumb-nav .breadcrumb,
ol.breadcrumb {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.25rem !important;
  list-style: none !important;
  padding: 0.35rem 0 !important;
  margin: 0 !important;
  font-size: 0.82rem !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  white-space: nowrap !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  -webkit-overflow-scrolling: touch !important;
  width: 100% !important;
  max-width: 100% !important;
}

.breadcrumb::-webkit-scrollbar,
.breadcrumb-nav .breadcrumb::-webkit-scrollbar,
ol.breadcrumb::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.breadcrumb-item,
.breadcrumb-nav .breadcrumb-item {
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  word-break: normal !important;
}

.breadcrumb-item + .breadcrumb-item::before,
.breadcrumb-nav .breadcrumb-item + .breadcrumb-item::before {
  content: "›" !important;
  padding: 0 0.35rem !important;
  color: #94a3b8 !important;
  font-weight: 700 !important;
  font-size: 1.05rem !important;
  line-height: 1 !important;
  display: inline-block !important;
}

.breadcrumb-item a,
.breadcrumb-nav .breadcrumb-item a {
  color: #475569 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  transition: color 0.15s ease !important;
}

.breadcrumb-item a:hover,
.breadcrumb-nav .breadcrumb-item a:hover {
  color: #0070f3 !important;
  text-decoration: underline !important;
}

.breadcrumb-item.active,
.breadcrumb-nav .breadcrumb-item.active {
  color: #0f172a !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}

/* ==========================================================================
   5. PRODUCT DETAIL PAGE (PDP) & TOUCH GALLERY
   ========================================================================== */
.pdp-main-gallery {
  width: 100%;
  max-width: 100%;
}

@media (min-width: 992px) {
  .pdp-main-gallery {
    position: sticky;
    top: 90px;
  }
}

.product-gallery {
  width: 100%;
  max-width: 100%;
}

.main-image {
  width: 100%;
  max-width: 100%;
  min-height: 290px;
  height: 380px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  touch-action: pan-y;
  user-select: none;
}

@media (max-width: 576px) {
  .main-image {
    height: 310px;
    min-height: 260px;
    padding: 0.75rem;
    border-radius: 14px;
  }
}

.main-image img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.15s ease;
}

/* Vertical Share Button pinned to Right Edge */
.pdp-vertical-share-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid #e2e8f0;
  border-right: none;
  border-radius: 10px 0 0 10px;
  padding: 10px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: -3px 3px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  color: #334155;
}

.pdp-vertical-share-btn:hover {
  background: #0070f3;
  color: #ffffff;
  transform: translateY(-50%) translateX(-2px);
  box-shadow: -4px 4px 16px rgba(0, 112, 243, 0.25);
}

.pdp-vertical-share-btn:hover .share-icon,
.pdp-vertical-share-btn:hover .share-text {
  color: #ffffff !important;
}

.pdp-vertical-share-btn .share-icon {
  font-size: 13px;
  line-height: 1;
  color: #0070f3;
  transition: color 0.2s;
}

.pdp-vertical-share-btn .share-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #334155;
  transition: color 0.2s;
}

/* Pagination Dots Indicator Below Image */
.pdp-dots-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 12px;
}

.pdp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

.pdp-dot.active {
  width: 22px;
  border-radius: 6px;
  background: #0070f3;
}

.thumbnail-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  padding-bottom: 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.thumbnail-strip::-webkit-scrollbar {
  display: none;
}

.thumbnail-strip .thumbnail {
  width: 62px;
  height: 62px;
  min-width: 62px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.thumbnail-strip .thumbnail.active,
.thumbnail-strip .thumbnail:hover {
  border-color: #0070f3;
  box-shadow: 0 0 0 2px rgba(0, 112, 243, 0.2);
}

.thumbnail-strip .thumbnail img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ==========================================================================
   5B. BOODMO-STYLE STICKY TABS & VEHICLE COMPATIBILITY SECTION
   ========================================================================== */
.boodmo-compat-container {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.boodmo-sticky-tabs-bar {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.boodmo-nav-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.boodmo-nav-tabs::-webkit-scrollbar {
  display: none;
}

.boodmo-tab-btn {
  background: none;
  border: none;
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #64748b;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.boodmo-tab-btn:hover {
  color: #0070f3;
}

.boodmo-tab-btn.active {
  color: #0070f3;
  border-bottom-color: #0070f3;
  font-weight: 700;
}

.boodmo-compat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 8px;
}

.boodmo-vehicle-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.boodmo-vehicle-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.boodmo-card-header {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  user-select: none;
  transition: background 0.15s ease;
  gap: 8px;
}

.boodmo-card-header:hover {
  background: #f8fafc;
}

.boodmo-vehicle-card.is-open .boodmo-card-header {
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.boodmo-card-chevron {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 11px;
  color: #64748b;
}

.boodmo-vehicle-card.is-open .boodmo-card-chevron {
  transform: rotate(180deg);
  color: #0070f3;
}

.boodmo-card-body {
  display: none;
  padding: 14px 16px;
  background: #ffffff;
}

.boodmo-vehicle-card.is-open .boodmo-card-body {
  display: block;
  animation: boodmoFadeIn 0.2s ease;
}

@keyframes boodmoFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.boodmo-spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

@media (max-width: 380px) {
  .boodmo-spec-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.boodmo-spec-item {
  display: flex;
  flex-direction: column;
}

.boodmo-spec-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.boodmo-spec-value {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

.boodmo-choose-btn {
  width: 100%;
  padding: 10px 14px;
  background: #0070f3;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 112, 243, 0.2);
}

.boodmo-choose-btn:hover {
  background: #0056b3;
  box-shadow: 0 4px 12px rgba(0, 112, 243, 0.35);
  color: #ffffff;
}

.boodmo-choose-btn.selected {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

/* ==========================================================================
   6. PRODUCT CARDS & GRID
   ========================================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 360px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

.product-card {
  background: var(--bg);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-image-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio */
  background: #ffffff;
  overflow: hidden;
}

.card-image-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.75rem;
  transition: transform 0.3s ease;
}

.product-card:hover .card-image-wrap img {
  transform: scale(1.05);
}

.brand-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(26, 31, 54, 0.85);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.card-content {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  font-size: 0.925rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.part-number {
  font-family: monospace;
  font-size: 0.775rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.price-wrap {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.current-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0d6efd;
}

.old-price {
  font-size: 0.85rem;
  color: var(--text-light);
  text-decoration: line-through;
}

.card-actions {
  padding: 0 0.75rem 0.75rem;
}

/* ==========================================================================
   7. CAROUSELS & HORIZONTAL TRACKS
   ========================================================================== */
.carousel-container {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

/* ==========================================================================
   8. TABLES & FORMS
   ========================================================================== */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.form-control, .form-select {
  max-width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   9. FOOTER
   ========================================================================== */
.footer {
  background: var(--bg-dark);
  color: var(--text-white);
  padding: 3rem 0 0;
  margin-top: 3rem;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 576px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-links {
  list-style: none;
}
.footer-links li {
  margin-bottom: 0.5rem;
}
.footer-links a {
  color: #a0aec0;
  text-decoration: none;
  font-size: 0.9rem;
}
.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.25rem 0;
  text-align: center;
  color: #a0aec0;
  font-size: 0.85rem;
}

/* ==========================================================================
   10. WHATSAPP FLOATING BUTTON
   ========================================================================== */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 54px;
  height: 54px;
  background: #25D366;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: var(--shadow-lg);
  z-index: 999;
}
.whatsapp-float:hover {
  color: white;
  text-decoration: none;
  transform: scale(1.05);
}

/* ==========================================================================
   11. COMPACT SCREEN MEDIA QUERIES (320px - 430px)
   ========================================================================== */
@media (max-width: 480px) {
  .container {
    padding-right: 10px;
    padding-left: 10px;
  }
  .action-buttons-box {
    padding: 0.75rem !important;
  }
  .price-box {
    padding: 0.75rem !important;
  }
  .card-body {
    padding: 0.75rem !important;
  }
  .whatsapp-float {
    bottom: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
}

@media (max-width: 360px) {
  .container {
    padding-right: 8px;
    padding-left: 8px;
  }
  .navbar-brand span {
    font-size: 1.15rem !important;
  }
  .btn-sm {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
  }
}
