/* EcoPart visual shell — v0.467.9.8 / Footer + public search + mobile catalog patch
   Reintroduces the visual identity of the legacy site while keeping the
   current application pages and workflows intact. Theme-ready variables are
   intentionally centralized here for the next patch. */
:root {
  --ep-site-bg: #282828;
  --ep-site-panel: #1f1f1f;
  --ep-site-panel-2: #2a2a2a;
  --ep-site-text: #f4f4f4;
  --ep-site-muted: #c8c8c8;
  --ep-site-border: #c0c0c0;
  --ep-site-blue: #2d65c4;
  --ep-site-blue-hover: #244f99;
  --ep-site-yellow: #ffc302;
  --ep-site-red: #e53238;
  --ep-site-lime: #c7e15d;
  --ep-site-danger: #d94b4b;
  --ep-site-radius: 5px;
  --ep-site-content-width: 85%;
  --ep-site-max-width: 1400px;
  --ep-header-z: 3000;
  --ep-drawer-z: 3050;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background-color: var(--ep-site-bg);
  /* The global texture lives on exactly one layer. Keeping it on html means
     pages that intentionally constrain <body> (for example the stock catalog)
     cannot accidentally paint a second copy over the first one. */
  background-image: url('../auto-parts-white2.png');
  background-repeat: repeat-y;
  background-size: 100% auto;
  background-position: top center;
  background-attachment: fixed;
  background-blend-mode: soft-light;
}

body {
  min-height: 100vh;
  margin: 0;
  /* Page-local styles are allowed to size the body/content, but the global
     background must remain transparent so the html texture is shown once. */
  background-color: transparent !important;
  background-image: none !important;
  background-repeat: no-repeat !important;
  background-blend-mode: normal !important;
}

html.ep-menu-lock,
body.ep-menu-lock {
  overflow: hidden !important;
}

/* ---------------- Header ---------------- */
.ep-site-header {
  position: sticky;
  top: 0;
  z-index: var(--ep-header-z);
  /* Neutralize legacy page rules such as `header { display:flex; ... }`. */
  display: block;
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
  align-items: normal;
  justify-content: normal;
  /* Break out of legacy pages whose body is only 70% wide. The visual bar is
     always viewport-wide; only its inner controls keep the normal max width. */
  width: 100vw;
  max-width: none;
  min-height: 78px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background: rgba(40, 40, 40, 0.98);
  border-bottom: 1px solid var(--ep-site-border);
  color: var(--ep-site-text);
  font-family: Arial, Helvetica, sans-serif;
}

.ep-site-header-inner {
  width: min(var(--ep-site-content-width), var(--ep-site-max-width));
  margin: 0 auto;
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 8px 3%;
}

.ep-site-header-inner.ep-guest-header {
  grid-template-columns: minmax(180px, 1fr) auto;
}

.ep-logo {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  text-decoration: none;
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -1px;
  white-space: nowrap;
  cursor: pointer;
}

.ep-logo:hover,
.ep-logo:focus { text-decoration: none; }
.ep-logo-e { color: var(--ep-site-blue); }
.ep-logo-c { color: var(--ep-site-yellow); }
.ep-logo-o { color: var(--ep-site-red); }
.ep-logo-rest { color: var(--ep-site-lime); }

.ep-global-search {
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 3px;
  margin: 0;
}

.ep-global-search input {
  width: min(100%, 650px);
  min-width: 0;
  height: 43px;
  padding: 9px 14px;
  border: 1px solid #b9b9b9;
  border-radius: 6px;
  background: #fff;
  color: #222;
  font: 16px Arial, Helvetica, sans-serif;
}

.ep-global-search input:focus {
  outline: 2px solid rgba(45, 101, 196, 0.45);
  outline-offset: 1px;
}

.ep-global-search button {
  width: 52px;
  height: 43px;
  border: 1px solid #aaa;
  border-radius: 6px;
  background: #fff;
  color: #111;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-size: 18px;
}

.ep-global-search button:hover { background: #ededed; }

.ep-user-menu-button {
  width: 50px;
  height: 48px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #fff;
  display: inline-grid;
  place-items: center;
  justify-self: end;
  cursor: pointer;
  font-size: 29px;
}

.ep-user-menu-button:hover,
.ep-user-menu-button:focus-visible { background: rgba(255,255,255,.08); }

.ep-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--ep-drawer-z) - 1);
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

.ep-menu-backdrop.open { opacity: 1; visibility: visible; }

.ep-user-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: var(--ep-drawer-z);
  width: min(390px, 92vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #202020;
  border-left: 1px solid rgba(255,255,255,.12);
  box-shadow: -18px 0 45px rgba(0,0,0,.4);
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  transform: translateX(102%);
  transition: transform .22s ease;
}

.ep-user-drawer.open { transform: translateX(0); }

.ep-user-drawer-head {
  min-height: 68px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #1a1a1a;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.ep-user-drawer-head strong { font-size: 18px; }

.ep-user-drawer-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 7px;
  background: #303030;
  color: #fff;
  cursor: pointer;
  font-size: 19px;
}

.ep-user-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.ep-user-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  align-items: center;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  background: #2a2a2a;
}

.ep-user-card > i {
  grid-row: 1 / span 3;
  font-size: 34px;
  color: #eee;
}

.ep-user-card strong { font-size: 16px; }
.ep-user-card span { color: #bcbcbc; font-size: 12px; overflow-wrap: anywhere; }

.ep-menu-group { margin: 0 0 18px; }
.ep-menu-group-title {
  margin: 0 0 7px;
  padding: 0 5px;
  color: #a9a9a9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.ep-menu-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  margin: 5px 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #292929;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.25;
}

.ep-menu-link i { width: 20px; text-align: center; color: #ddd; }
.ep-menu-link:hover { background: #393939; border-color: rgba(255,255,255,.09); text-decoration: none; }
.ep-menu-link.ep-logout { background: rgba(217, 75, 75, .16); }
.ep-menu-link.ep-logout:hover { background: rgba(217, 75, 75, .26); }

.ep-flash-stack {
  position: fixed;
  top: 90px;
  right: max(14px, 7.5vw);
  z-index: calc(var(--ep-drawer-z) + 10);
  width: min(420px, calc(100% - 28px));
  display: grid;
  gap: 8px;
}

.ep-flash {
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  background: #252525;
  color: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
  font: 14px/1.4 Arial, Helvetica, sans-serif;
}
.ep-flash-success { border-color: rgba(70,190,105,.65); }
.ep-flash-error { border-color: rgba(229,80,80,.7); }
.ep-flash-info { border-color: rgba(80,135,229,.7); }
.ep-flash-warning { border-color: rgba(236,184,58,.7); }

/* ---------------- Footer ---------------- */
.ep-site-footer {
  clear: both;
  width: 100vw;
  max-width: none;
  margin-top: 54px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0;
  border-top: 1px solid rgba(192,192,192,.45);
  background: rgba(31,31,31,.42);
  color: #f1f1f1;
  font: 14px/1.5 Arial, Helvetica, sans-serif;
}

.ep-footer-inner {
  width: min(var(--ep-site-content-width), var(--ep-site-max-width));
  margin: 0 auto;
  padding: 28px 10px 12px;
}

.ep-footer-container {
  display: flex;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
  text-align: center;
}

.ep-footer-container.ep-company-only { justify-content: center; }

.ep-footer-column {
  flex: 1 1 220px;
  min-width: 220px;
  max-width: 360px;
  text-align: center;
}

.ep-footer-container.ep-company-only .ep-footer-column {
  flex: 0 1 360px;
}

.ep-footer-column h4 {
  margin: 0 0 10px;
  color: var(--ep-site-blue);
  font-size: 16px;
}

.ep-footer-column p { margin: 4px 0; }
.ep-footer-column ul { list-style: none; padding: 0; margin: 0; text-align: center; }
.ep-footer-column li { margin: 5px 0; }
.ep-footer-column a { color: #ccc; text-decoration: none; }
.ep-footer-column a:hover { color: #fff; text-decoration: underline; }

.ep-footer-bottom {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid #444;
  color: #aaa;
  text-align: center;
}
.ep-footer-bottom p { margin: 0; }

/* ---------------- Home page ---------------- */
.ep-home-main {
  width: 85%;
  max-width: 1100px;
  min-height: 55vh;
  margin: 0 auto;
  padding: 42px 0 24px;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
}

.ep-home-vehicle-title {
  margin: 0 0 24px;
  font-size: 25px;
  line-height: 1.2;
}

.ep-home-vehicle-selects {
  width: min(760px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.ep-home-vehicle-selects select {
  width: 100%;
  min-height: 54px;
  padding: 10px 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #1e1e1e;
  color: #fff;
  font: 18px Arial, Helvetica, sans-serif;
}

.ep-home-vehicle-selects select:disabled { color: #999; opacity: .82; }
.ep-home-vehicle-status { min-height: 20px; margin-top: 9px; color: #cfcfcf; font-size: 13px; }

.ep-home-intro {
  width: min(920px, 100%);
  margin: 82px auto 0;
}

.ep-home-intro h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.22;
  font-weight: 700;
}

.ep-construction-wrap {
  min-height: 54vh;
  display: grid;
  place-items: center;
  padding: 42px 0;
}

.ep-construction-banner {
  width: min(760px, 100%);
  padding: 30px 22px;
  border: 2px solid var(--ep-site-yellow);
  border-radius: 8px;
  background: rgba(20,20,20,.82);
  color: var(--ep-site-yellow);
  box-shadow: 0 14px 34px rgba(0,0,0,.28);
  font-size: clamp(30px, 7vw, 64px);
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
}

@media (max-width: 880px) {
  html { background-attachment: scroll; }

  .ep-site-header {
    min-height: 72px;
  }

  .ep-site-header-inner {
    width: 92%;
    min-height: 72px;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo menu"
      "search search";
    gap: 7px 10px;
    padding: 11px 4% 12px;
  }

  .ep-site-header-inner.ep-guest-header {
    grid-template-areas: "logo menu";
    grid-template-columns: 1fr auto;
  }

  .ep-logo { grid-area: logo; font-size: 28px; }
  .ep-global-search { grid-area: search; }
  .ep-user-menu-button { grid-area: menu; }

  .ep-global-search input {
    width: 100%;
    height: 47px;
    font-size: 17px;
  }
  .ep-global-search button { height: 47px; width: 54px; }

  .ep-footer-inner { width: 92%; }
  .ep-footer-container,
  .ep-footer-container.ep-company-only { justify-content: center; text-align: center; }
  .ep-footer-column,
  .ep-footer-container.ep-company-only .ep-footer-column { flex: 1 1 100%; min-width: 0; }

  .ep-home-main { padding-top: 34px; }
  .ep-home-intro { margin-top: 70px; }
}

@media (max-width: 560px) {
  .ep-home-main { width: 92%; }

  .ep-site-header-inner,
  .ep-footer-inner { width: 94%; }
  .ep-site-header-inner { padding-left: 2%; padding-right: 2%; }
  .ep-logo { font-size: 27px; }
  .ep-user-menu-button { width: 46px; font-size: 27px; }
  .ep-home-main { padding-top: 30px; }
  .ep-home-vehicle-title { font-size: 23px; }
  .ep-home-vehicle-selects select { min-height: 58px; font-size: 19px; }
  .ep-home-intro { margin-top: 72px; }
  .ep-home-intro h1 { font-size: 25px; }
  .ep-site-footer { margin-top: 42px; }
  .ep-footer-inner { padding-left: 4px; padding-right: 4px; }
}

/* ---------------- Customer cart ---------------- */
.ep-cart-menu-link {
  position: relative;
}

.ep-cart-menu-link > span:not(.ep-cart-count) {
  flex: 1 1 auto;
}

.ep-cart-count {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ep-site-yellow);
  color: #1b1b1b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.ep-cart-count[hidden] { display: none !important; }

.ep-cart-toast {
  position: fixed;
  z-index: calc(var(--ep-drawer-z) + 20);
  right: max(14px, 4vw);
  bottom: 24px;
  width: min(390px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: #252525;
  color: #fff;
  box-shadow: 0 12px 34px rgba(0,0,0,.35);
  font: 14px/1.4 Arial, Helvetica, sans-serif;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}

.ep-cart-toast.show { opacity: 1; transform: translateY(0); }
.ep-cart-toast-success { border-color: rgba(90, 204, 119, .75); }
.ep-cart-toast-error { border-color: rgba(229, 80, 80, .8); }

/* Cart buttons expose a persistent visual state once the signed-in user has
   already added that part.  The state is driven centrally by ecopart_cart.js. */
[data-ep-cart-button].ep-cart-added,
[data-ep-cart-button].ep-cart-added:hover {
  background: #b18400 !important;
  border-color: #d5ab22 !important;
  color: #fff !important;
  filter: none !important;
}


/* ---------------- Cookie consent ---------------- */
.ep-footer-link-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: #ccc;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
.ep-footer-link-button:hover { color: #fff; text-decoration: underline; }

.ep-cookie-banner[hidden],
.ep-cookie-modal[hidden],
.ep-cookie-modal-backdrop[hidden] { display: none !important; }

.ep-cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 3600;
  width: min(980px, calc(100vw - 28px));
  transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  background: rgba(25,25,25,.98);
  color: #f5f5f5;
  box-shadow: 0 18px 48px rgba(0,0,0,.48);
  font: 14px/1.45 Arial, Helvetica, sans-serif;
}

.ep-cookie-banner-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 17px 18px;
}

.ep-cookie-copy strong { display: block; margin-bottom: 4px; font-size: 16px; }
.ep-cookie-copy p { margin: 0 0 6px; color: #ddd; }
.ep-cookie-copy a, .ep-cookie-policy-link { color: #9fc3ff; }

.ep-cookie-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ep-cookie-btn {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 7px;
  background: #343434;
  color: #fff;
  cursor: pointer;
  font: 700 13px/1.2 Arial, Helvetica, sans-serif;
}
.ep-cookie-btn:hover { background: #414141; }
.ep-cookie-btn-primary { background: var(--ep-site-blue); border-color: #4c79c8; }
.ep-cookie-btn-primary:hover { background: var(--ep-site-blue-hover); }
.ep-cookie-btn-secondary { background: transparent; }

.ep-cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3650;
  background: rgba(0,0,0,.66);
}
.ep-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 3660;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-y: auto;
  color: #f5f5f5;
  font-family: Arial, Helvetica, sans-serif;
}
html.ep-cookie-modal-open { overflow: hidden !important; }
.ep-cookie-modal-card {
  width: min(720px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  background: #252525;
  box-shadow: 0 22px 64px rgba(0,0,0,.55);
  padding: clamp(18px, 4vw, 28px);
}
.ep-cookie-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.ep-cookie-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--ep-site-lime);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ep-cookie-modal h2 { margin: 0; font-size: 25px; }
.ep-cookie-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 7px;
  background: #333;
  color: #fff;
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}
.ep-cookie-modal-intro { margin: 0 0 16px; color: #d2d2d2; line-height: 1.55; }
.ep-cookie-category {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 15px 0;
  border-top: 1px solid rgba(255,255,255,.1);
}
.ep-cookie-category strong { display: block; margin-bottom: 4px; }
.ep-cookie-category span:not(.ep-cookie-status) { display: block; color: #c9c9c9; font-size: 13px; line-height: 1.45; }
.ep-cookie-status {
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.ep-cookie-status-on { background: rgba(142,190,77,.18); color: #d7f1a4; }
.ep-cookie-switch { display: inline-flex; align-items: center; gap: 8px; color: #aaa; font-size: 12px; }
.ep-cookie-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ep-cookie-switch > span {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #4a4a4a;
  opacity: .75;
}
.ep-cookie-switch > span::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #ddd;
}
.ep-cookie-switch input:checked + span { background: var(--ep-site-blue); opacity: 1; }
.ep-cookie-switch input:checked + span::after { transform: translateX(16px); }
.ep-cookie-switch em { font-style: normal; white-space: nowrap; }
.ep-cookie-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.1);
}

@media (max-width: 720px) {
  .ep-cookie-banner { bottom: 9px; width: calc(100vw - 18px); }
  .ep-cookie-banner-inner { grid-template-columns: 1fr; gap: 13px; padding: 15px; }
  .ep-cookie-actions { justify-content: stretch; }
  .ep-cookie-actions .ep-cookie-btn { flex: 1 1 150px; }
  .ep-cookie-category { grid-template-columns: 1fr; gap: 9px; }
  .ep-cookie-status, .ep-cookie-switch { justify-self: start; }
  .ep-cookie-modal-actions { align-items: stretch; flex-direction: column; }
  .ep-cookie-modal-actions .ep-cookie-btn { width: 100%; }
}
