/* ===================================================================
   SupplyFlexJS — Modern Responsive Stylesheet
   Layered on top of legacy main.css; this file is loaded AFTER it
   and progressively overrides table-based layout for all screen sizes.
   =================================================================== */

/* ── 1. CSS CUSTOM PROPERTIES ────────────────────────────────────── */
:root {
  --brand-blue:   #0066CC;
  --brand-dark:   #00457A;
  --brand-red:    #CC3300;
  --brand-light:  #E9F4FF;
  --text-primary: #222;
  --text-muted:   #555;
  --white:        #fff;
  --border:       #D0D0D0;
  --radius:       6px;
  --shadow:       0 2px 8px rgba(0,0,0,.12);
  --max-width:    960px;
  --font-body:    'Droid Sans', 'Trebuchet MS', Arial, sans-serif;
  --font-ui:      'Trebuchet MS', Arial, Helvetica, sans-serif;
}

/* ── 2. RESET / BASE ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background-image: url(../images/header/bkgd-page.jpg);
  background-color: #f4f4f4;
  text-align: left;       /* override legacy center-align */
}

img { max-width: 100%; height: auto; border: none; display: block; }
a   { color: var(--brand-blue); }
a:hover { color: var(--brand-dark); }

h1, h2, h3 {
  font-family: var(--font-ui);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 .5em;
  color: var(--brand-blue);
}
h1 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
h2 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
h3 { font-size: 1.1rem; }

p {
  font-family: var(--font-body);
  font-size: 13px;
  margin: 0 0 .9em;
  color: var(--text-primary);
}

/* ── 3. PAGE WRAPPER ─────────────────────────────────────────────── */
.sf-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── 4. SITE HEADER ──────────────────────────────────────────────── */
.sf-header {
  width: 100%;
  background: var(--white);
}
.sf-header img {
  width: 100%;
  max-width: var(--max-width);
  height: auto;
  margin: 0 auto;
}

/* ── 5. CONTENT SHELL (sidebar + main) ──────────────────────────── */
.sf-shell {
  display: flex;
  flex-direction: row;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  background: var(--white);
  box-shadow: var(--shadow);
}

/* ── 6. SIDEBAR NAV ──────────────────────────────────────────────── */
.sf-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
}

/* Hamburger toggle — hidden on desktop */
.sf-nav-toggle {
  display: none;
  width: 100%;
  padding: 12px 16px;
  background: var(--brand-blue);
  color: var(--white);
  border: none;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  text-align: left;
}
.sf-nav-toggle::after { content: ' ☰'; }
.sf-nav-toggle[aria-expanded="true"]::after { content: ' ✕'; }

/* Override legacy .sf-side-nav styles from menu_ppal.html */
.sf-side-nav { display: block !important; }

/* ── 7. MAIN CONTENT ─────────────────────────────────────────────── */
.sf-main {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: var(--white);
}

/* ── 8. HERO SLIDER ──────────────────────────────────────────────── */
.sf-slider-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--brand-dark);
}
.sf-slider {
  display: flex;
  transition: transform .45s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.sf-slider-slide {
  min-width: 100%;
  flex-shrink: 0;
}
.sf-slider-slide img,
.sf-slider-slide picture { width: 100%; display: block; }

.sf-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.4);
  color: var(--white);
  border: none;
  padding: 10px 14px;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  border-radius: var(--radius);
  line-height: 1;
  transition: background .2s;
}
.sf-slider-btn:hover { background: rgba(0,102,204,.75); }
.sf-slider-btn.prev { left: 6px; }
.sf-slider-btn.next { right: 6px; }

.sf-slider-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
  background: var(--brand-dark);
}
.sf-slider-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background .2s;
}
.sf-slider-dot.active { background: var(--white); }

/* ── 9. INTRO / ABOUT SECTION ────────────────────────────────────── */
.sf-intro {
  padding: 24px 28px 16px;
}
.sf-intro h1 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  margin-bottom: 12px;
}
.sf-intro p { text-align: justify; font-size: 13px; }

/* ── 10. BRAND LOGOS BAR ─────────────────────────────────────────── */
.sf-brands {
  text-align: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.sf-brands img { display: inline-block; max-height: 100px; width: auto; }

/* ── 11. CATEGORY GRID ───────────────────────────────────────────── */
.sf-categories {
  padding: 20px 20px 24px;
}
.sf-categories h2 {
  text-align: center;
  margin-bottom: 14px;
}
.sf-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.sf-cat-grid li a {
  display: block;
  padding: 10px 14px;
  background: var(--brand-light);
  border: 1px solid #c2d9f0;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-blue);
  text-decoration: none;
  transition: background .18s, color .18s, border-color .18s;
  text-align: center;
}
.sf-cat-grid li a:hover,
.sf-cat-grid li a:focus {
  background: var(--brand-blue);
  color: var(--white);
  border-color: var(--brand-dark);
  outline: none;
}

/* ── 12. CATEGORY IMAGE-MAP BANNER (keeps image visible) ─────────── */
.sf-catmap {
  text-align: center;
  padding: 20px 0 0;
}
.sf-catmap img { max-width: 100%; height: auto; margin: 0 auto; }

/* ── 13. PRODUCT PAGE CONTENT ────────────────────────────────────── */
.sf-product-content {
  padding: 16px 24px 24px;
}
.sf-product-content table { max-width: 100%; }
.sf-product-content img { max-width: 100%; height: auto; }

/* ── 14. COOKIE BAR ──────────────────────────────────────────────── */
.cookie-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  background: rgba(0,0,0,.82);
  backdrop-filter: blur(4px);
  padding: 10px 16px;
}
.cookie-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--white);
}
.cookie-content p { margin: 0; font-size: 13px; color: var(--white); }
.cookie-hide {
  padding: 6px 18px;
  background: var(--brand-blue);
  color: var(--white);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.cookie-hide:hover { background: var(--brand-dark); }

/* ── 15. SITE FOOTER ─────────────────────────────────────────────── */
.sf-footer-wrap { margin-top: auto; }

/* ── 16. FORM FIELDS ─────────────────────────────────────────────── */
.formfield {
  width: 100%;
  max-width: 320px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font-body);
}
.formfield:focus {
  outline: 2px solid var(--brand-blue);
  outline-offset: 1px;
  border-color: var(--brand-blue);
}

/* ── 17. UTILITY ─────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ── 18. RESPONSIVE OVERRIDES ────────────────────────────────────── */

/* Tablet: 600–900px */
@media (max-width: 900px) {
  /* Make legacy fixed-width tables scroll */
  body > table,
  .sf-shell > table {
    width: 100% !important;
    overflow-x: auto;
    display: block;
  }
  table[width="900"] {
    width: 100% !important;
  }
  td[width="219"],
  td[width="739"] {
    width: auto !important;
  }
  .sf-shell { flex-direction: column; }
  .sf-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }

  /* Show hamburger, hide nav by default */
  .sf-nav-toggle { display: block; }
  .sf-side-nav   { display: none !important; }
  .sf-side-nav.open { display: block !important; }
  .sf-side-badges { display: none; }

  /* Slider */
  #container { width: 100% !important; }
  #slider li, #slider2 li { width: 100% !important; }
  .sf-slider-wrap { min-height: 80px; }
}

/* Mobile: ≤ 480px */
@media (max-width: 480px) {
  h1 { font-size: 1.2rem; }
  .sf-intro { padding: 16px; }
  .sf-cat-grid { grid-template-columns: repeat(2, 1fr); }
  .sf-slider-btn { padding: 7px 10px; font-size: 16px; }
  .cookie-content { flex-direction: column; text-align: center; gap: 8px; }
  .formfield { max-width: 100%; }
}
