/* ============================================================
   Eastern Diesel - responsive layer
   Loaded after ed_css.css / hoverbtn.css on every page.
   Desktop appearance is untouched; everything below only
   kicks in on screens 768px wide or smaller.
   ============================================================ */

/* Images should never overflow their container, on any screen */
img {
  max-width: 100%;
  height: auto;
}

/* ---- Mobile navigation (hidden on desktop) ---- */
.ed-nav-toggle {
  display: none;
}
.ed-mobile-nav {
  display: none;
}
/* ---- Sub-header banner (shown on mobile only) ---- */
.ed-subbanner {
  display: none;
}

@media (max-width: 768px) {

  /* ---------- Header / navigation ---------- */
  .w3-top {
    height: auto !important;
  }
  .w3-top .w3-bar {
    height: auto !important;
    min-height: 64px;
    position: relative;
    /* ed_css.css sets overflow:hidden on .w3-bar, which would clip the dropdown menu */
    overflow: visible;
    /* keep the branded banner behind the hamburger */
    background-image: url(../top_banner_head.png);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
  }
  /* hide the desktop button-table nav, keep the hamburger instead */
  .w3-top .w3-bar > table {
    display: none;
  }
  .ed-nav-toggle {
    display: block;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 8px;
    font-size: 26px;
    line-height: 1;
    padding: 6px 12px;
    cursor: pointer;
    z-index: 1001;
  }
  .ed-mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #111;
    z-index: 1000;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  }
  .ed-mobile-nav.open {
    display: block;
  }
  .ed-mobile-nav a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 15px 20px;
    border-top: 1px solid #333;
    font-size: 18px;
    font-family: Calibri, Arial, sans-serif;
  }
  .ed-mobile-nav a:active {
    background: #222;
  }

  /* anchor targets from the home page category cards: keep clear of the fixed header */
  #turbochargers,
  #fuel-systems {
    scroll-margin-top: 80px;
  }

  /* ---------- Sub-header banner below the menu ---------- */
  .ed-subbanner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 110px;
    background-image: url(../top_banner_head.png);
    background-size: cover;
    background-position: center;
    border-bottom: 3px solid silver;
  }
  .ed-subbanner span {
    color: #fff;
    font-size: 28px;
    font-family: Calibri, Arial, sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    background: rgba(0, 0, 0, 0.45);
    padding: 8px 24px;
    border-radius: 8px;
  }
  /* the banner fills the space the old top margin left behind */
  .ed-subbanner + .serviceClass {
    margin-top: 20px !important;
  }
  /* contact page: section follows an empty div, so use the general sibling rule */
  .ed-subbanner ~ #contact {
    margin-top: 20px !important;
  }

  /* ---------- Index page hero ---------- */
  .hero-table,
  .hero-table tbody,
  .hero-table tr,
  .hero-table td {
    display: block;
    width: 100% !important;
    margin: 0 !important;
    padding: 12px 15px !important;
    box-sizing: border-box;
  }
  .hero-table {
    margin-left: 0 !important;
  }
  .circle {
    float: none !important;
    width: 240px !important;
    height: 215px !important;
    margin: 30px auto 0 !important;
    padding-right: 0 !important;
  }
  .logo {
    width: 240px !important;
    height: 215px !important;
  }
  .hero-text p {
    font-size: 18px !important;
  }
  /* the parallax sections are fixed at 100vh; let content dictate height */
  .section {
    height: auto !important;
    min-height: 100vh;
    padding: 40px 0;
  }
  .static {
    height: auto !important;
    padding: 40px 20px !important;
  }
  .foot {
    height: auto !important;
    padding: 30px 10px !important;
  }

  /* ---------- Products page : brand logo menu ---------- */
  #fruitmenu {
    height: auto !important;
    min-height: 0;
    padding: 20px 10px 30px;
  }
  .logo-grid {
    width: 100% !important;
    margin: 0 auto;
  }
  .logo-grid tr {
    display: block;
  }
  .logo-grid td {
    display: inline-block;
    width: 48%;
    text-align: center;
    box-sizing: border-box;
    padding: 6px;
  }

  /* ---------- Products page : results grid (4 cols -> 2 cols) ---------- */
  #myproducts table {
    width: 96% !important;
    margin-top: 20px !important;
  }
  #myproducts tbody,
  #myproducts tr {
    display: block;
  }
  #myproducts td {
    display: inline-block;
    width: 46% !important;
    margin: 1.5%;
    vertical-align: top;
    box-sizing: border-box;
  }
  #myproducts td[colspan] {
    display: block;
    width: 97% !important;
    margin: 0 auto 10px;
  }

  /* ---------- About / Services content columns ---------- */
  .serviceClass table,
  .serviceClass tbody,
  .serviceClass tr,
  .serviceClass td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }
  .serviceClass {
    padding: 0 15px;
  }
  .serviceClass td {
    padding: 10px 0 !important;
  }

  /* ---------- Contact page ---------- */
  #contact {
    padding: 20px 12px !important;
    margin-top: 90px !important;
  }
  #contact input,
  #contact textarea,
  #contact button {
    box-sizing: border-box;
  }
}

/* ---------- Homepage: category cards, trust badges, CTA band ---------- */
.home-section-title {
  text-align: center;
  font-family: Calibri, 'Segoe UI', sans-serif;
  color: #1a1a1a;
  font-size: 22px;
  margin: 0 0 18px;
}
.home-cats {
  background: #f2f2f2;
  padding: 32px 16px;
}
.home-cat-card {
  display: block;
  max-width: 520px;
  margin: 0 auto 16px;
  background: #ffffff;
  border-radius: 12px;
  border-left: 6px solid #b30000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  padding: 18px 20px;
  text-decoration: none;
  color: #222;
}
.home-cat-card:last-child {
  margin-bottom: 0;
}
.home-cat-title {
  display: block;
  font-family: Calibri, 'Segoe UI', sans-serif;
  font-size: 20px;
  font-weight: bold;
  color: #0a2a5c;
  margin-bottom: 6px;
}
.home-cat-brands {
  display: block;
  font-size: 14px;
  color: #555;
  margin-bottom: 10px;
  line-height: 1.5;
}
.home-cat-link {
  display: inline-block;
  font-size: 15px;
  font-weight: bold;
  color: #b30000;
}
.home-trust {
  padding: 32px 12px;
  background: #ffffff;
}
.home-trust-row {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
}
.home-trust-item {
  flex: 1;
  text-align: center;
  padding: 0 8px;
}
.home-trust-icon {
  display: block;
  font-size: 30px;
  color: #b30000;
  margin-bottom: 8px;
}
.home-trust-item strong {
  display: block;
  font-size: 13px;
  font-family: Calibri, 'Segoe UI', sans-serif;
  color: #222;
  line-height: 1.35;
}
.home-cta {
  background: #0a2a5c;
  color: #fff;
  text-align: center;
  padding: 36px 20px;
}
.home-cta h3 {
  font-family: Calibri, 'Segoe UI', sans-serif;
  font-size: 22px;
  margin: 0 0 10px;
  color: #fff;
}
.home-cta p {
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 20px;
  color: #dbe4f0;
}
.home-cta-btn {
  display: inline-block;
  background: #c00000;
  color: #fff !important;
  font-weight: bold;
  font-size: 17px;
  font-family: Calibri, 'Segoe UI', sans-serif;
  padding: 14px 44px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}
.home-cta-alt {
  display: inline-block;
  margin-top: 14px;
  color: #9fb6d8 !important;
  font-size: 14px;
}

/* ---------- Back-to-menu button (products results) ---------- */
.back-btn {
  display: inline-block;
  background: #0a2a5c;
  color: #fff !important;
  font-weight: bold;
  font-size: 16px;
  font-family: Calibri, 'Segoe UI', sans-serif;
  padding: 12px 34px;
  border-radius: 8px;
  text-decoration: none;
  margin: 8px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.back-btn:active {
  background: #08204a;
}

/* ---------- Homepage: gold hero ---------- */
.hero-gold-section {
  min-height: 0 !important;
  padding: 0 !important;
}
.hero-gold {
  text-align: center;
  padding: 52px 20px 48px;
  background: radial-gradient(ellipse at 50% 30%, #2e2a20 0%, #161310 55%, #0c0a08 100%);
}
.hero-gold-logo {
  width: min(280px, 68vw);
  height: auto;
  border-radius: 18px;
  border: 3px solid #d4af37;
  box-shadow: 0 0 45px rgba(212,175,55,0.35), 0 10px 30px rgba(0,0,0,0.55);
  margin-bottom: 24px;
}
.hero-gold-title {
  font-family: Calibri, 'Segoe UI', sans-serif;
  color: #f5e7c1;
  font-size: 24px;
  margin: 0 0 12px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}
.hero-gold-tag {
  color: #cfcfcf;
  font-size: 16px;
  line-height: 1.55;
  max-width: 520px;
  margin: 0 auto 26px;
  font-family: Calibri, 'Segoe UI', sans-serif;
}
.hero-gold-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-btn-solid {
  display: inline-block;
  background: linear-gradient(180deg, #e8c35a, #c9992e);
  color: #1a1a1a !important;
  font-weight: bold;
  font-size: 17px;
  font-family: Calibri, 'Segoe UI', sans-serif;
  padding: 14px 34px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(212,175,55,0.4);
}
.hero-btn-solid:active {
  filter: brightness(0.92);
}
.hero-btn-ghost {
  display: inline-block;
  border: 2px solid #d4af37;
  color: #f5e7c1 !important;
  font-weight: bold;
  font-size: 17px;
  font-family: Calibri, 'Segoe UI', sans-serif;
  padding: 12px 32px;
  border-radius: 10px;
  text-decoration: none;
}
.hero-btn-ghost:active {
  background: rgba(212,175,55,0.15);
}
