/*
Theme Name: ChemData Pro
Theme URI: https://alkemist.org
Author: Alkemist
Description: Premium scientific directory theme with modern card layouts, live search, sidebars, and professional data presentation.
Version: 2.7.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: chemdata
*/

:root {
  /* -- Palette -- */
  --primary: #0f4c5c;
  --primary-dark: #09313d;
  --primary-light: #e0f2f1;
  --accent: #fb8b24;
  --accent-hover: #e07a1c;
  --secondary: #5f6c7b;
  
  /* -- Backgrounds -- */
  --bg-body: #f4f6f8;
  --bg-panel: #ffffff;
  --bg-input: #f1f3f5;
  
  /* -- Text -- */
  --text-main: #1d2d35;
  --text-muted: #6c757d;
  
  /* -- UI Tokens -- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
  --shadow-md: 0 8px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.1);
  --container: 1280px;
  --header-height: 70px;
  --mobile-nav-height: 65px;
}

/* ------------------------------------------
   1. BASE STYLES
   ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  padding-bottom: 0;
}

h1, h2, h3, h4, h5 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: var(--primary-dark);
  margin-top: 0;
}

a { color: inherit; text-decoration: none; transition: all 0.2s ease; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; padding: 0; margin: 0; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ------------------------------------------
   2. BUTTONS (PREMIUM UPGRADE)
   ------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 50px; /* Pill shape */
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-transform: uppercase;
}

/* Primary Button - Gradient & Shadow */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(15, 76, 92, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 76, 92, 0.35);
    color: #fff;
}

.btn-primary:active {
    transform: translateY(0);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 76, 92, 0.2);
}

/* ------------------------------------------
   3. HEADER
   ------------------------------------------ */
.main-header { 
    position: sticky; top: 0; z-index: 1000; 
    background: rgba(255, 255, 255, 0.9); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05); 
    transition: all 0.3s ease; 
}

.topbar { background: var(--primary-dark); color: rgba(255,255,255,0.8); font-size: 12px; padding: 6px 0; }
.topbar-flex { display: flex; justify-content: space-between; align-items: center; }

.header-main { padding: 16px 0; }
.header-flex { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand img { height: 52px; width: auto; }
.brand-text { font-size: 22px; font-weight: 800; color: var(--primary); }

.search-wrap { flex: 1; max-width: 600px; position: relative; }
.search-input { 
    width: 100%; padding: 14px 20px 14px 50px; 
    border-radius: 99px; border: 2px solid transparent; 
    background: var(--bg-input); 
    font-size: 15px; 
    transition: all 0.3s;
}
.search-input:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(15, 76, 92, 0.1); outline: none; }
.search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: #6c757d; pointer-events: none; }

#search-suggestions { 
    position: absolute; top: 110%; left: 0; right: 0; 
    background: #fff; border: 1px solid #e9ecef; 
    border-radius: 12px; box-shadow: var(--shadow-lg); 
    z-index: 1100; overflow: hidden; display: none; 
}
.suggestion-item { padding: 12px 20px; border-bottom: 1px solid #f1f3f5; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--text-main); }
.suggestion-item:hover { background: var(--primary-light); color: var(--primary-dark); }

.header-nav-bar { border-top: 1px solid #e9ecef; background: rgba(255,255,255,0.8); }
.header-nav-list { display: flex; gap: 8px; overflow-x: auto; }
.header-nav-list li a { display: inline-block; padding: 12px 18px; font-size: 14px; font-weight: 600; color: var(--text-main); border-bottom: 3px solid transparent; transition: all 0.2s; }
.header-nav-list li a:hover { color: var(--primary); border-bottom-color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 16px; }
.header-btn { background: transparent; border: none; cursor: pointer; color: var(--primary); padding: 8px; position: relative; }
.cart-count { position: absolute; top: 0; right: -4px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 5px; border-radius: 10px; min-width: 16px; text-align: center; }

/* ------------------------------------------
   4. HERO SLIDER
   ------------------------------------------ */
.hero-slider { 
    position: relative; height: 480px; 
    border-radius: var(--radius-lg); 
    overflow: hidden; background: var(--primary); 
    box-shadow: var(--shadow-lg); 
    margin-bottom: 40px; 
}
.slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 0.8s ease; }
.slide.active { opacity: 1; }
.hero-content { 
    position: absolute; inset: 0; 
    background: linear-gradient(90deg, rgba(9, 49, 61, 0.85) 0%, rgba(9, 49, 61, 0.4) 60%, transparent 100%); 
    display: flex; flex-direction: column; justify-content: center; padding: 0 60px; 
}
.hero-title { font-size: 3.5rem; margin-bottom: 16px; line-height: 1.1; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.2); }
.hero-desc { font-size: 1.125rem; opacity: 0.95; max-width: 600px; margin-bottom: 24px; color: #fff; }

/* ------------------------------------------
   5. SECTIONS & GRIDS
   ------------------------------------------ */
.section-wrap { padding: 40px 0; margin-bottom: 20px; clear: both; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; border-bottom: 2px solid #e9ecef; padding-bottom: 12px; }
.section-title { font-size: 1.5rem; position: relative; margin: 0; }
.section-title::after { content: ''; position: absolute; bottom: -14px; left: 0; width: 60px; height: 2px; background: var(--primary); }
.section-link { font-size: 13px; font-weight: 600; color: var(--primary); }

.grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; width: 100%; }
.chem-cat-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 12px; margin-bottom: 30px; }

/* ------------------------------------------
   6. CARDS (MODERN)
   ------------------------------------------ */
.cat-card, .chem-card, .woocommerce ul.products li.product { 
    background: #fff; 
    border: 1px solid rgba(0,0,0,0.05); 
    border-radius: var(--radius-md); 
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    display: flex; flex-direction: column; 
    overflow: hidden; position: relative; 
    box-shadow: var(--shadow-sm);
}

.cat-card:hover, .chem-card:hover, .woocommerce ul.products li.product:hover { 
    transform: translateY(-5px); 
    box-shadow: var(--shadow-lg); 
    border-color: rgba(15, 76, 92, 0.2); 
}

.cat-card { padding: 12px 8px; align-items: center; justify-content: center; text-align: center; min-height: 100px; }
.cat-icon { font-size: 24px; margin-bottom: 8px; transition: transform 0.3s; }
.cat-card:hover .cat-icon { transform: scale(1.1); }
.cat-title { font-size: 12px; font-weight: 700; color: var(--text-main); line-height: 1.2; width: 100%; }

.chem-img { height: 180px; background: #f8fafc; display: flex; align-items: center; justify-content: center; width: 100%; position: relative; }
.chem-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.chem-card:hover .chem-img img { transform: scale(1.05); }

.chem-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.chem-title { font-size: 16px; margin-bottom: 8px; line-height: 1.4; font-weight: 700; }
.chem-title a { color: var(--text-main); }
.chem-title a:hover { color: var(--primary); }
.chem-meta { font-size: 13px; color: #6c757d; margin-bottom: 16px; background: #f1f3f5; align-self: flex-start; padding: 2px 8px; border-radius: 4px; }
.chem-action { margin-top: auto; width: 100%; }

/* Primary Button - Gradient & Shadow */
.chem-card .btn, 
.chemical-card .btn {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.chem-card .btn:hover,
.chemical-card .btn:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

/* ------------------------------------------
   7. WOOCOMMERCE
   ------------------------------------------ */
.woocommerce ul.products { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 24px !important; padding: 0 !important; margin: 0 !important; float: none !important; width: 100% !important; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none !important; }
.woocommerce ul.products li.product { float: none !important; width: 100% !important; margin: 0 !important; min-height: 380px; }
.woocommerce ul.products li.product a img { height: 220px !important; width: 100% !important; object-fit: cover; margin: 0 !important; display: block; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { padding: 15px 15px 5px; font-size: 16px; color: var(--primary-dark); font-family: 'Montserrat', sans-serif; font-weight: 700; line-height: 1.4; margin: 0; }
.woocommerce ul.products li.product .price { padding: 0 15px; color: var(--accent); font-weight: 800; font-size: 1.1rem; margin-bottom: 10px; display: block; }
.woocommerce ul.products li.product .button { 
    margin: auto 15px 15px; text-align: center; 
    background: var(--primary); color: #fff !important; 
    border-radius: 50px; padding: 10px; font-weight: 600; 
    font-size: 14px; display: block; text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.woocommerce ul.products li.product .button:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* Checkout Buttons - Ensuring Theme Color */
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce-checkout #place_order {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important; 
  color: #fff !important; 
  font-size: 1.1rem; 
  font-weight: 700; 
  padding: 16px 32px; 
  border-radius: 50px; 
  border: none; 
  box-shadow: 0 4px 15px rgba(15, 76, 92, 0.3); 
  transition: all 0.3s ease; 
  display: block; 
  width: 100%; 
  text-align: center; 
  text-transform: uppercase; 
  letter-spacing: 0.5px;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce-checkout #place_order:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 8px 25px rgba(15, 76, 92, 0.4); 
  background: var(--primary-dark) !important;
}

/* ------------------------------------------
   8. FOOTER
   ------------------------------------------ */
.site-footer { background: #111827; color: #d1d5db; padding: 60px 0 20px; margin-top: 60px; clear: both; position: relative; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-title { color: #fff; font-size: 16px; margin-bottom: 20px; font-weight: 700; }
.footer-links li a { display: block; padding: 4px 0; transition: color 0.2s; font-size: 14px; opacity: 0.8; }
.footer-links li a:hover { color: var(--accent); opacity: 1; padding-left: 5px; }
.footer-btm { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: center; font-size: 13px; opacity: 0.6; }

/* ------------------------------------------
   9. MOBILE / RESPONSIVE (GLASSMORPHISM NAV)
   ------------------------------------------ */
@media (max-width: 992px) {
  .main-header { display: none !important; }
  .mobile-app-top { 
      display: block; height: 50px; 
      background: rgba(255,255,255,0.95); 
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      border-bottom: 1px solid rgba(0,0,0,0.05); 
      position: sticky; top: 0; z-index: 999; 
  }
  
  /* Glassmorphism Bottom Nav */
  .mobile-bottom-nav { 
      display: flex; position: fixed; bottom: 0; left: 0; width: 100%; 
      height: var(--mobile-nav-height); 
      background: rgba(255, 255, 255, 0.85); /* Semi-transparent */
      backdrop-filter: blur(16px); /* Strong Blur */
      -webkit-backdrop-filter: blur(16px);
      border-top: 1px solid rgba(255,255,255,0.3); 
      box-shadow: 0 -4px 20px rgba(0,0,0,0.05); 
      z-index: 2000; justify-content: space-around; align-items: center; 
      padding-bottom: env(safe-area-inset-bottom); 
  }
  
  .mob-nav-item { 
      flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; 
      color: #94a3b8; font-size: 10px; font-weight: 600; text-decoration: none; 
      height: 100%; background: none; border: none; padding-top: 4px;
      transition: color 0.3s;
  }
  
  .mob-nav-item svg { margin-bottom: 4px; transition: transform 0.2s; }
  .mob-nav-item.active, .mob-nav-item:hover { color: var(--primary); }
  .mob-nav-item.active svg { transform: translateY(-2px); stroke-width: 2.5px; }

  /* Body padding for bottom nav */
  body { padding-bottom: calc(var(--mobile-nav-height) + 20px); }
  
  /* 1 Column Grids on Mobile */
  .grid-cols-4 { grid-template-columns: 1fr; gap: 16px; }
  .woocommerce ul.products { grid-template-columns: 1fr !important; gap: 16px !important; }
  
  .chem-cat-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  
  .hero-slider { 
      height: 360px; border-radius: 0; 
      margin-left: -20px; margin-right: -20px; width: calc(100% + 40px); 
  }
  .hero-content { padding: 0 24px; align-items: flex-start; text-align: left; }
  .hero-title { font-size: 2rem; }
  .hero-desc { font-size: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  
  /* --- Mobile Single Page Layout Improvements (CRITICAL FIX) --- */
  /* Ensures Main Content is ABOVE Sidebar on Mobile */
  .pro-layout-grid { 
      display: flex; 
      flex-direction: column; 
      gap: 30px; 
  }
  
  .content-wrapper { 
      order: 1; /* Content First */
      width: 100%;
  }
  
  .sidebar-wrapper {
      order: 2; /* Sidebar Second */
      margin-top: 20px;
      width: 100%;
  }
  
  .pro-detail-grid { 
      display: flex; 
      flex-direction: column; 
      gap: 20px; 
  }
  
  .pro-image-stage { 
      margin-left: -20px; 
      margin-right: -20px; 
      border-radius: 0; 
      border: none; 
      border-bottom: 1px solid #eee; 
  }
  
  /* Mobile Sidebar Style */
  .pro-sidebar {
      position: static; 
      box-shadow: none; 
      border: none; 
      background: transparent; 
      padding: 0;
  }
  
  .sidebar-widget {
      background: #fff; 
      padding: 20px; 
      border-radius: 12px; 
      border: 1px solid #e9ecef; 
      box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  }
}

/* ------------------------------------------
   10. PRO FEATURES (INSTRUMENTS & DETAILS)
   ------------------------------------------ */

/* Instruments Hero */
.instr-hero {
    background: linear-gradient(120deg, var(--primary-dark), #0f4c5c, #2a9d8f);
    padding: 80px 0 100px;
    color: #fff;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
    margin-bottom: 20px;
}
.instr-title { font-size: 3.5rem; color: #fff; margin: 10px 0; letter-spacing: -1px; }
.pro-badge { background: rgba(255,255,255,0.15); padding: 4px 12px; border-radius: 20px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(5px); }

/* Instrument Grid/Cards */
.instr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
@media(max-width:992px){ .instr-grid { grid-template-columns: 1fr; } }

.instr-card {
    background: #fff; border-radius: 16px; overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column;
}
.instr-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(15, 76, 92, 0.15); border-color: rgba(15, 76, 92, 0.2); }

.instr-img-wrap {
    height: 240px; background: #f8f9fa; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.instr-card:hover .instr-img-wrap img { transform: scale(1.05); }

.brand-tag {
    position: absolute; top: 15px; left: 15px; background: rgba(255,255,255,0.95);
    padding: 4px 10px; border-radius: 6px; font-size: 10px; font-weight: 800;
    color: var(--primary); box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 2;
}

.instr-body { padding: 25px; flex: 1; display: flex; flex-direction: column; }
.model-no { font-size: 11px; color: var(--accent); font-weight: 700; text-transform: uppercase; margin-bottom: 5px; }
.instr-name { font-size: 18px; margin-bottom: 10px; line-height: 1.3; font-weight: 700; }
.instr-excerpt { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; flex: 1; }

.btn-pro {
    display: block; width: 100%; text-align: center;
    padding: 12px; border-radius: 50px; background: var(--primary-light);
    color: var(--primary); font-weight: 700; font-size: 13px;
    transition: all 0.2s; margin-top: auto;
}
.btn-pro:hover { background: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(15, 76, 92, 0.2); }

/* ------------------------------------------
   11. SIDEBAR & SINGLE LAYOUT
   ------------------------------------------ */
.pro-layout-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

.pro-sidebar {
    background: #fff;
    padding: 25px;
    border-radius: var(--radius-md);
    border: 1px solid #e9ecef;
    position: sticky;
    top: 90px;
    box-shadow: var(--shadow-sm);
}

.sidebar-widget { margin-bottom: 30px; }
.sidebar-widget:last-child { margin-bottom: 0; }

.sidebar-title {
    font-size: 15px; font-weight: 700; color: var(--primary-dark);
    border-bottom: 2px solid #f1f3f5; padding-bottom: 10px; margin-bottom: 15px;
    text-transform: uppercase; letter-spacing: 0.5px;
}

.sidebar-list li { margin-bottom: 8px; border-bottom: 1px solid #f9fafb; padding-bottom: 8px; }
.sidebar-list li:last-child { border: none; }
.sidebar-list li a { font-size: 14px; color: #4b5563; display: flex; justify-content: space-between; align-items: center; transition: all 0.2s; }
.sidebar-list li a:hover { color: var(--primary); transform: translateX(5px); }

.btn-sidebar-all {
    display: block; text-align: center;
    font-size: 12px; font-weight: 600; color: var(--primary);
    background: var(--primary-light); padding: 8px;
    border-radius: 6px; margin-top: 10px; transition: all 0.2s;
}
.btn-sidebar-all:hover { background: var(--primary); color: #fff; }

/* Related Items (Sidebar) */
.related-item {
    display: flex; gap: 12px; align-items: center;
    margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #f1f3f5;
}
.related-item:last-child { border: none; margin: 0; padding: 0; }
.rel-img {
    width: 50px; height: 50px; background: #f3f4f6; border-radius: 6px;
    overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.rel-img img { width: 100%; height: 100%; object-fit: cover; }
.rel-info { flex: 1; min-width: 0; }
.rel-title { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text-main); margin-bottom: 2px; }
.rel-date { font-size: 11px; color: #9ca3af; }

/* Single Detail Layout */
.pro-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.pro-image-stage { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; position: relative; }
.pro-meta-pills { display: flex; gap: 20px; margin-bottom: 25px; padding: 15px; background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0; }
.pro-meta-pills div { display: flex; flex-direction: column; }
.pro-meta-pills small { font-size: 10px; text-transform: uppercase; color: #64748b; font-weight: 700; }
.pro-meta-pills strong { font-size: 14px; color: #0f172a; }

/* Specs Table */
.specs-box { background: #f8f9fa; padding: 25px; border-radius: 12px; margin-top: 30px; border: 1px solid #e5e7eb; }
.specs-table { width: 100%; border-collapse: collapse; }
.specs-table th { text-align: left; padding: 12px 0; color: var(--primary); width: 40%; font-weight: 600; border-bottom: 1px solid #e5e7eb; font-size: 14px; }
.specs-table td { text-align: right; padding: 12px 0; color: #374151; border-bottom: 1px solid #e5e7eb; font-size: 14px; }
.specs-table tr:last-child th, .specs-table tr:last-child td { border-bottom: none; }

/* --- Mobile Search Improvements --- */
.mobile-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    z-index: 3000;
    padding: 20px;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
    overflow-y: auto; 
}

.mobile-search-overlay.open {
    display: flex;
}

.mob-search-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
}

.mob-search-input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--primary);
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.mob-search-close {
    position: absolute;
    top: -60px;
    right: 0;
    font-size: 32px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
}

/* Mobile Live Search Suggestions */
#mob-search-suggestions {
    text-align: left;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    max-height: 250px;
    overflow-y: auto;
}

#mob-search-suggestions .suggestion-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f5;
    color: var(--text-main);
    font-size: 14px;
}

#mob-search-suggestions .suggestion-item:last-child {
    border-bottom: none;
}

/* Mobile Bottom Nav Fixes */
.mob-nav-item svg {
    width: 22px; 
    height: 22px;
}

/* Cart Badge Fix */
.mob-cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--accent);
    color: #fff;
    font-size: 9px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid #fff;
}

/* ------------------------------------------
   12. WOOCOMMERCE MOBILE OPTIMIZATION
   ------------------------------------------ */

@media (max-width: 992px) {
    /* Stack Product Gallery and Summary */
    .woocommerce #content div.product div.images, 
    .woocommerce div.product div.images, 
    .woocommerce-page #content div.product div.images, 
    .woocommerce-page div.product div.images {
        width: 100% !important;
        float: none !important;
        margin-right: 0 !important;
        margin-bottom: 20px !important;
        display: block !important;
    }

    .woocommerce #content div.product div.summary, 
    .woocommerce div.product div.summary, 
    .woocommerce-page #content div.product div.summary, 
    .woocommerce-page div.product div.summary {
        width: 100% !important;
        float: none !important;
        clear: both;
        display: block !important;
    }

    /* Tabs Layout */
    .woocommerce div.product .woocommerce-tabs ul.tabs {
        padding: 0;
        margin: 0 0 10px;
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .woocommerce div.product .woocommerce-tabs ul.tabs li {
        border: 1px solid #eee;
        background-color: #f9f9f9;
        display: inline-block;
        position: relative;
        z-index: 0;
        border-radius: 4px;
        margin: 0 5px 5px 0;
        padding: 0 1em;
    }

    /* Related Products Grid on Mobile */
    .woocommerce .related ul.products li.product, 
    .woocommerce .up-sells ul.products li.product {
        width: 100% !important;
        margin-right: 0 !important;
    }
    
    /* Cart Table Responsive */
    .woocommerce table.shop_table_responsive tr td, 
    .woocommerce-page table.shop_table_responsive tr td {
        display: block;
        text-align: right;
        clear: both;
    }
    
    .woocommerce table.shop_table_responsive tr td::before, 
    .woocommerce-page table.shop_table_responsive tr td::before {
        content: attr(data-title) ": ";
        float: left;
        font-weight: 700;
    }
}
/* ... (Existing content remains unchanged) ... */

/* ------------------------------------------
   12. WOOCOMMERCE MOBILE OPTIMIZATION
   ------------------------------------------ */

@media (max-width: 992px) {
    /* ... (Existing mobile styles remain unchanged) ... */

    /* Fix for Long Titles & Text Overflow */
    .woocommerce div.product .product_title,
    .woocommerce-loop-product__title,
    .chem-title,
    .instr-name,
    .pro-title {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        font-size: 1.5rem; /* Slightly smaller on mobile for better fit */
        line-height: 1.3;
    }

    /* Ensure content has breathing room on edges */
    .container, 
    .pro-detail-grid,
    .woocommerce div.product {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Prevent horizontal scroll on descriptions */
    .woocommerce-product-details__short-description,
    .woocommerce-Tabs-panel,
    .pro-desc,
    .entry-content {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
  
    /* Ensure images don't overflow */
    .woocommerce div.product div.images img,
    .pro-image-stage img {
        max-width: 100%;
        height: auto;
    }
}