
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

/* Hide mobile specific elements on desktop by default */
.rs-mobile-toll-free {
  display: none !important;
}

@media (max-width: 768px) {
  .site-header-sticky {
    position: relative !important;
  }

  body {
    padding-top: 0 !important;
  }

  .first-top .containers.row {
    flex-direction: column;
    align-items: center;
    padding: 6px 8px 4px !important;
    gap: 6px;
  }

  .first-top .col-lg-7,
  .first-top .col-md-7,
  .first-top .col-lg-5,
  .first-top .col-md-5 {
    width: 100% !important;
    float: none !important;
  }

  .first-top .top-info {
    width: 100% !important;
    float: none !important;
    text-align: center !important;
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
  }

  .first-top .full_top {
    flex-wrap: wrap;
    gap: 4px 8px;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
  }

  .first-top-text {
    font-size: 10px !important;
    line-height: 1.25 !important;
  }

  .first-top .top-info:first-child .full_top {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px 6px !important;
    margin: 0 auto;
    width: 100% !important;
    height: auto !important;
  }
  
  .first-top .top-info:first-child .full_top > i.contact-phone,
  .first-top .top-info:first-child .full_top > i.contact-email { 
    margin: 0 !important; 
    font-size: 13px !important; 
  }
  
  .first-top .top-info:first-child .full_top > span.rs-mobile-toll-free { 
    width: 100% !important; 
    display: block !important; 
    text-align: center !important;
    color: #ffcc00 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 2px 0;
    margin: 2px 0 !important;
  }
  
  .first-top .top-info:first-child .first-top-text {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
    word-break: break-word !important;
    line-height: 1.3 !important;
    text-align: left !important;
    font-size: 11px !important;
  }

  .first-top .top-info:first-child .first-top-text a {
    display: inline !important;
    margin: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  .first-top .top-info:first-child .rs-number-count {
    display: inline-block !important;
    white-space: nowrap !important;
  }

  .first-top .top-info:last-child .full_top {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px 15px !important;
    width: 100% !important;
  }

  .first-top .top-info:last-child .full_top > .social-icons {
    gap: 6px;
    display: inline-flex !important;
  }

  .first-top .top-info:last-child .full_top > .rs-translate-btn {
    margin-left: 0 !important;
  }

  .first-top .top-info:last-child .full_top > i.contact-phone,
  .first-top .top-info:last-child .full_top > .rs-toll-free-desktop {
    display: none !important;
  }

  .social-link {
    width: 28px !important;
    height: 28px !important;
    font-size: 12px !important;
  }

  .rs-translate-btn {
    padding: 5px 10px !important;
    font-size: 11px !important;
  }

  .rs-translate-btn .rs-lang-label {
    display: inline-block !important;
  }

  .rs-main-phone-icon {
    margin-left: 0 !important;
  }
}

/* ── 3. NAVIGATION: wsdownmenu mobile fix ── */
@media (max-width: 992px) {
  .wsdownmenu-list {
    overflow-x: hidden;
    width: 100% !important;
  }

  .wsdownmenu-list > li > a {
    font-size: 11px !important;
    padding: 10px 8px !important;
    line-height: 22px !important;
  }

  .megamenu {
    display: none !important;
    position: static !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    min-height: 0 !important;
  }

  .wsdownmenu > ul > li > input:checked + .megamenu {
    display: block !important;
    padding: 8px 10px !important;
  }

  .megamenu .container-fluid,
  .megamenu .row,
  .megamenu .link-list {
    margin: 0 !important;
    padding: 0 !important;
  }

  .megamenu .col-md-3,
  .megamenu .col-sm-3,
  .megamenu .col-lg-3 {
    width: 50% !important;
    float: left !important;
    padding: 5px !important;
  }

  /* Search button in the mobile drawer: keep it centered and below the links */
  .wsdownmenu-list > span {
    display: block !important;
    width: 100% !important;
    padding-left: 0 !important;
    margin: 10px 0 12px !important;
    text-align: center !important;
    clear: both !important;
  }

  .wsdownmenu-list > span a {
    display: inline-block !important;
  }
}

@media (min-width: 993px) {
  body {
    font-size: 16px !important;
    line-height: 1.65 !important;
  }

  p, li, td, th, label, button, input, select, textarea {
    font-size: 16px !important;
    line-height: 1.55 !important;
  }

  h1 { font-size: 30px !important; }
  h2 { font-size: 24px !important; }
  h3 { font-size: 20px !important; }
  h4 { font-size: 17px !important; }

  /* Let the desktop top bar wrap cleanly instead of clipping the contact row */
  .first-top .containers.row {
    align-items: center !important;
    padding: 3px 8px !important;
  }

  .first-top .top-info {
    min-width: 0 !important;
  }

  .first-top .full_top {
    flex-wrap: wrap !important;
    gap: 2px 6px !important;
    align-items: center !important;
    line-height: 1.1 !important;
  }

  .first-top .top-info:first-child .full_top {
    justify-content: flex-start !important;
    text-align: left !important;
  }

  .first-top .top-info:last-child .full_top {
    justify-content: flex-end !important;
    text-align: right !important;
    flex-wrap: wrap !important;
  }

  .first-top .top-info:first-child .first-top-text,
  .first-top .top-info:last-child .first-top-text {
    font-size: 11px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .first-top .top-info:last-child .first-top-text {
    margin-right: 6px !important;
  }

  .social-icons {
    flex-wrap: nowrap !important;
  }

  .social-link {
    width: 26px !important;
    height: 26px !important;
    font-size: 12px !important;
  }

  .rs-translate-btn {
    margin-left: 6px !important;
    flex: 0 0 auto !important;
    padding: 3px 7px !important;
    font-size: 11px !important;
  }

  .first-top .top-info:first-child .first-top-text {
    max-width: 100% !important;
  }

  .first-top .top-info:last-child .first-top-text {
    max-width: 100% !important;
  }

  .rs-main-phone-icon {
    margin-left: 4px !important;
  }

  /* Narrow the desktop red header bar only */
  .wsdownmenu-list {
    width: 86% !important;
  }

  .wsdownmenu-list > li > a {
    line-height: 48px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
  }

  .wsdownmenu-list img {
    height: 48px !important;
    max-height: 48px !important;
    width: auto !important;
  }

  .megamenu {
    width: calc(100vw - 204px) !important;
    position: absolute !important;
    top: 48px !important;
  }

  /* Pull the hero/video up a few pixels so the red header fully covers the gap */
  .fullwidthbanner-container,
  .fullwidthbanner-blocks,
  .home-slider,
  .slider-wrapper,
  #inner-pages-main,
  .fullpercent-banner {
    margin-top: -14px !important;
  }
}

@media (max-width: 480px) {
  .megamenu .col-md-3,
  .megamenu .col-sm-3,
  .megamenu .col-lg-3 {
    width: 100% !important;
    float: none !important;
  }

  .wsdownmenu-list > li > a {
    line-height: 20px !important;
  }

  .wsdownmenu-list img {
    max-height: 50px !important;
  }
}

/* ── 4. PRODUCT GRID: has--4-col, has--3-col, has--2-col ── */
/* These grids use ul.grid li.grid_item — not Bootstrap columns */

.grid {
  display: flex !important;
  flex-wrap: wrap !important;
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
}

.grid_item {
  box-sizing: border-box !important;
  padding: 8px !important;
}

/* 4-column grid */
.has--4-col .grid_item {
  width: 25% !important;
}

/* 3-column grid */
.has--3-col .grid_item {
  width: 33.333% !important;
}

/* 2-column grid */
.has--2-col .grid_item {
  width: 50% !important;
}

/* Tablet: reduce columns */
@media (max-width: 992px) {
  .has--4-col .grid_item {
    width: 50% !important;
  }
  .has--3-col .grid_item {
    width: 50% !important;
  }
  .has--2-col .grid_item {
    width: 50% !important;
  }
}

/* Mobile: single column */
@media (max-width: 540px) {
  .has--4-col .grid_item,
  .has--3-col .grid_item,
  .has--2-col .grid_item {
    width: 100% !important;
  }
}

/* ── 5. PRODUCT CARDS: box images and text ── */
.box-img img {
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  max-height: 200px !important;
}

.box-application {
  height: 100% !important;
}

.box-inner {
  width: 100% !important;
}

/* ── 6. PRODUCT DETAIL PAGES: image + description side by side ── */
@media (max-width: 768px) {
  /* Stack image and description vertically on mobile */
  .product .col-lg-5,
  .product .col-md-5,
  .product .col-md-6,
  .product .col-lg-7,
  .product .col-md-7 {
    width: 100% !important;
    float: none !important;
    padding: 10px 15px !important;
  }

  #image img,
  .product-image img,
  .img-responsive {
    width: 100% !important;
    max-width: 340px !important;
    margin: 0 auto !important;
    display: block !important;
  }

  .descs {
    padding-top: 15px !important;
  }

  .descs .heading {
    font-size: 18px !important;
  }
}

/* ── 7. SIDEBAR: side_menu.php on product pages ── */
/* Bootstrap col-md-3 sidebar and col-md-9 content */
@media (max-width: 768px) {
  .col-md-3.sidemenu-holder,
  .supportingall > .col-md-3 {
    width: 100% !important;
    float: none !important;
    margin-bottom: 15px !important;
  }

  .supportingall > .col-md-9 {
    width: 100% !important;
    float: none !important;
  }
}

/* ── 8. SPECIFICATION TABLES: horizontal scroll on mobile ── */
/* This is the safest fix — wraps table in scrollable div via CSS */
.product_descp .tab-content,
.table-responsive-wrap {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

@media (max-width: 768px) {
  .table {
    min-width: 500px !important;
  }

  .product_descp {
    overflow-x: auto !important;
  }

  /* Tabs: allow wrapping on mobile */
  .product_descp .nav-tabs {
    display: flex !important;
    flex-wrap: wrap !important;
    border-bottom: 1px solid #ddd !important;
  }

  .product_descp .nav-tabs > li {
    float: none !important;
    margin-bottom: 2px !important;
  }

  .product_descp .nav-tabs > li > a {
    font-size: 11px !important;
    padding: 6px 8px !important;
  }
}

/* ── 9. HOMEPAGE FLEXSLIDER ── */
@media (max-width: 768px) {
  .flexslider {
    margin: 0 !important;
  }

  .flexslider .slides img {
    width: 100% !important;
    height: auto !important;
    max-height: 300px !important;
    object-fit: cover !important;
  }

  .flex-caption {
    display: none !important;
  }
}

/* ── 10. FOOTER: #bottom section 4-column grid ── */
@media (max-width: 992px) {
  #bottom .col-md-3 {
    width: 50% !important;
    float: left !important;
    margin-bottom: 20px !important;
  }
}

@media (max-width: 540px) {
  #bottom .col-md-3 {
    width: 100% !important;
    float: none !important;
  }

  #bottom {
    padding: 20px 15px !important;
  }
}

/* ── Footer visual polish (safe, no structural changes) ── */
#bottom {
  background: #222 !important;
  color: #e6e6e6 !important;
  padding: 36px 0 22px !important;
}

#bottom .widget h3 {
  color: #ffffff !important;
  font-size: 16px !important;
  margin: 0 0 10px !important;
  font-weight: 600 !important;
}

#bottom ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

#bottom ul li { margin-bottom: 8px !important; }

#bottom ul li a {
  color: #dcdcdc !important;
  text-decoration: none !important;
  font-size: 14px !important;
}

#bottom ul li a:hover { color: #ffffff !important; text-decoration: underline !important; }

#bottom .address li { font-size: 14px !important; line-height: 1.4 !important; }

#bottom .mar40 { padding-bottom: 8px !important; }

/* compact contact block */
#bottom .address { margin-top: 6px !important; }

/* copyright bar */
#footer.midnight-blue { background: #161616 !important; color: #cfcfcf !important; padding: 12px 0 !important; border-top: 1px solid rgba(255,255,255,0.04) !important; }
#footer .container .text-center { font-size: 14px !important; color: #bfbfbf !important; }

/* Mobile adjustments to keep footer compact and readable */
@media (max-width: 768px) {
  #bottom { padding: 18px 12px !important; }
  #bottom .widget h3 { font-size: 15px !important; margin-bottom: 8px !important; }
  #bottom ul li a { font-size: 15px !important; }
  #bottom .address li { font-size: 13px !important; }
  #footer .container .text-center { font-size: 13px !important; }
}


/* ── 11. BREADCRUMBS: prevent overflow ── */
@media (max-width: 768px) {
  .breadcrumbs.bred_title.bred_margin {
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
    display: block !important;
    padding: 6px 8px !important;
  }
}

/* ── 12. INNER BANNER SECTIONS (histopathology, metrology etc) ── */
@media (max-width: 768px) {
  #inner-pages-main .histopathology-equipments,
  #inner-pages-main .metrology-metallurgy,
  #inner-pages-main .education-microscopes,
  #inner-pages-main .laboratory-clinical-microscope,
  #inner-pages-main .industrial-research-microscopes,
  .fullpercent-banner {
    min-height: 180px !important;
    background-position: center center !important;
  }

  #inner-pages-main .life-science-sections {
    padding: 10px 5% !important;
    padding-top: 20px !important;
  }

  #inner-pages-main .life-science-sections h1 {
    font-size: 18px !important;
  }

  #inner-pages-main .back-shadows {
    padding: 5px 3% !important;
  }
}

/* ── 13. CONTACT & ENQUIRY FORMS ── */
@media (max-width: 768px) {
  #enquiry-form .imports {
    width: 100% !important;
    font-size: 14px !important;
  }

  .enquries .info {
    padding-left: 15px !important;
  }
}

/* ── 14. TAWK CHAT: ensure it doesn't overflow on mobile ── */
@media (max-width: 480px) {
  #google_translate_element {
    top: auto !important;
    bottom: 80px !important;
    right: 8px !important;
    max-width: calc(100vw - 16px) !important;
  }
}

/* ── 15. GENERAL UTILITY: prevent text overflow ── */
@media (max-width: 768px) {
  p, li, td, th, span, a {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  h1 { font-size: 22px !important; }
  h2 { font-size: 19px !important; }
  h3 { font-size: 16px !important; }
  h4 { font-size: 14px !important; }
}
