@font-face {
  font-family: "BPG Arial";
  src: url("../assets/bpg_arial_2009/BPGArial.woff2") format("woff2"),
    url("../assets/bpg_arial_2009/BPGArial.woff") format("woff"),
    url("../assets/bpg_arial_2009/BPGArial.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #1b2a41;
  --navy-2: #16233a;
  --red: #e23b3b;
  --red-dark: #c62f2f;
  --bg: #ececec;
  --card: #ffffff;
  --muted: #8a929c;
  --text: #20262e;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "BPG Arial", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
}

/* ---------- Top info bar ---------- */
.topbar {
  background: var(--navy-2);
  color: #cdd5df;
  font-size: 0.82rem;
}
.topbar a {
  color: #cdd5df;
}
.topbar a:hover {
  color: #fff;
}
.topbar .topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem;
  white-space: nowrap;
}
.topbar .topbar-item i {
  color: var(--red);
}
.topbar .social a {
  color: var(--red);
  font-size: 1rem;
}

/* ---------- Navbar ---------- */
.main-nav {
  background: var(--navy);
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff !important;
  font-weight: 700;
  letter-spacing: 1px;
}
.brand-logo .logo-badge {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--red);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}
.brand-logo .site-logo-img {
  height: 42px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}
.main-nav .nav-link {
  color: #d7dde5 !important;
  font-weight: 600;
  position: relative;
  padding: 0.75rem 1rem;
}
.main-nav .nav-link:hover,
.main-nav .nav-link.active {
  color: #fff !important;
}
.main-nav .navbar-collapse {
  gap: 1rem;
}
.nav-search-form {
  flex: 1 1 280px;
  max-width: 520px;
}
.nav-search-wrap {
  position: relative;
}
.nav-search-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0.5rem 2.75rem 0.5rem 1rem;
  font-size: 0.92rem;
}
.nav-search-input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}
.nav-search-input:focus {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.12);
}
.nav-search-btn {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
}
.nav-search-btn:hover {
  background: var(--red-dark);
  color: #fff;
}
.nav-search-results {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(27, 42, 65, 0.18);
  max-height: 360px;
  overflow-y: auto;
  z-index: 30;
}
.nav-search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--text);
  border-bottom: 1px solid #eef1f4;
}
.nav-search-item:last-child {
  border-bottom: 0;
}
.nav-search-item:hover {
  background: #f7f9fb;
  color: var(--text);
}
.nav-search-item img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}
.nav-search-item strong {
  display: block;
  font-size: 0.9rem;
}
.nav-search-item small {
  color: var(--muted);
}
.nav-search-empty,
.nav-search-more {
  padding: 0.75rem 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
}
@media (max-width: 991.98px) {
  .nav-search-form {
    max-width: none;
    width: 100%;
    margin: 0.75rem 0 0.25rem;
  }
}
.main-nav .nav-link.active::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 4px;
  height: 2px;
  background: var(--red);
}
.brand-nav-dropdown .dropdown-toggle::after {
  vertical-align: 0.15em;
  margin-left: 0.35rem;
  transition: border-color 0.15s ease;
}
.brand-nav-dropdown .dropdown-toggle.show,
.brand-nav-dropdown .dropdown-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}
.brand-nav-dropdown .dropdown-toggle.show::after,
.brand-nav-dropdown .dropdown-toggle[aria-expanded="true"]::after {
  border-top-color: var(--red);
}
.brand-nav-dropdown .nav-link.dropdown-toggle.active::after {
  display: none;
}
.brand-nav-menu {
  --bs-dropdown-min-width: 0;
  width: 320px;
  max-width: min(92vw, 320px);
  padding: 0;
  margin-top: 0.45rem;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 16px 42px rgba(27, 42, 65, 0.18);
}
.brand-nav-scroll {
  list-style: none;
}
.brand-nav-scroll-inner {
  max-height: min(280px, 50vh);
  overflow-y: auto;
}
.brand-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid #f0f2f5;
  transition: background 0.15s ease;
}
.brand-nav-scroll-inner .brand-nav-item:last-child {
  border-bottom: 0;
}
.brand-nav-item:hover,
.brand-nav-item:focus {
  background: #f8f9fb;
  color: inherit;
}
.brand-nav-logo-wrap {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid #e6eaef;
  background: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 7px;
}
.brand-nav-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand-nav-logo-letter {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--navy);
}
.brand-nav-text {
  flex: 1;
  min-width: 0;
}
.brand-nav-name {
  display: block;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.95rem;
  line-height: 1.2;
}
.brand-nav-arrow {
  flex-shrink: 0;
  font-size: 0.82rem;
  color: #c5cbd3;
}
.brand-nav-item:hover .brand-nav-arrow,
.brand-nav-item:focus .brand-nav-arrow {
  color: var(--red);
}
.brand-nav-empty {
  padding: 1rem;
  text-align: center;
  color: #8b95a5;
  font-size: 0.88rem;
}
@media (max-width: 991.98px) {
  .brand-nav-menu {
    width: 100%;
    max-width: none;
    margin-top: 0.35rem;
    border-radius: 12px;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(12, 22, 38, 0.98);
  }
  .brand-nav-name {
    color: #eef2f7;
  }
  .brand-nav-empty {
    color: rgba(255, 255, 255, 0.5);
  }
  .brand-nav-item {
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }
  .brand-nav-item:hover,
  .brand-nav-item:focus {
    background: rgba(255, 255, 255, 0.06);
  }
  .brand-nav-logo-wrap {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
  }
  .brand-nav-logo-letter {
    color: #eef2f7;
  }
}

/* ---------- Page heading ---------- */
.page-title {
  color: var(--red);
  font-weight: 800;
  text-align: center;
  margin: 1.5rem 0 1.75rem;
}
.breadcrumb-bar {
  font-size: 0.9rem;
}
.breadcrumb-bar a {
  color: var(--navy);
}

/* ---------- Cards (brands / models) ---------- */
.tile {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid #e3e6ea;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(27, 42, 65, 0.16);
}
.tile-img {
  height: 160px;
  width: 100%;
  object-fit: contain;
  padding: 1.25rem;
  background: #fff;
}
.tile-title {
  text-align: center;
  font-weight: 700;
  color: var(--red);
  padding: 0.6rem 0.5rem 1rem;
  margin: 0;
  margin-top: auto;
  min-height: 3.2rem;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid #eef0f3;
}

/* Brand badge: holds the vector logo (or letter fallback) */
.brand-badge {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow: hidden;
}
.brand-badge svg,
.brand-badge .brand-logo-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.18s ease;
}
.tile:hover .brand-badge svg,
.tile:hover .brand-badge .brand-logo-img {
  transform: scale(1.06);
}
.brand-badge .brand-letter {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--navy), #2c405e);
  color: #fff;
  font-weight: 800;
  font-size: 2rem;
  display: grid;
  place-items: center;
}

/* ---------- Parts grid ---------- */
.part-card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid #e3e6ea;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow 0.18s ease;
}
.part-card-hit {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
  text-decoration: none;
}
.part-card-hit:hover {
  color: inherit;
}
.part-card-actions {
  text-align: center;
  padding-bottom: 0.85rem;
  position: relative;
  z-index: 2;
}
.part-card:hover {
  box-shadow: 0 10px 24px rgba(27, 42, 65, 0.14);
}
.part-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  z-index: 2;
}
.part-img {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: contain;
  padding: 1rem;
  background: #fff;
}
.part-body {
  padding: 0.5rem 0.85rem 1rem;
  text-align: center;
  margin-top: auto;
}
.part-code {
  display: inline-block;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--navy);
  background: #eef2f7;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  margin-bottom: 0.35rem;
}
.part-code-badge {
  font-size: 0.85rem;
  color: var(--navy);
}
.part-name {
  font-weight: 600;
  font-size: 0.92rem;
  min-height: 2.6em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.part-price {
  color: var(--muted);
  font-weight: 700;
  margin-top: 0.35rem;
}
.part-wa-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-top: 0.65rem;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  font-size: 1.2rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
}
.part-wa-btn:hover {
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.45);
}

/* ---------- Part detail ---------- */
.part-detail-media {
  position: relative;
  text-align: center;
}
.part-detail-img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}
.part-detail-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.part-detail-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 1rem;
}
.part-detail-meta {
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}
.part-code-lg {
  font-size: 0.9rem;
  padding: 0.25rem 0.65rem;
}
.btn-whatsapp {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
  font-weight: 600;
}
.btn-whatsapp:hover {
  background: #1ebe57;
  border-color: #1ebe57;
  color: #fff;
}
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
}
.similar-carousel-wrap {
  position: relative;
  padding: 0 2.5rem;
}
.similar-carousel-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}
.similar-carousel-track::-webkit-scrollbar {
  display: none;
}
.similar-carousel-item {
  flex: 0 0 220px;
  scroll-snap-align: start;
}
.part-card-mini .part-name {
  font-size: 0.85rem;
  min-height: 2.4em;
}
.part-card-mini .part-img {
  padding: 0.65rem;
}
.similar-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 1px solid #dde2e8;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  display: grid;
  place-items: center;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(27, 42, 65, 0.1);
}
.similar-carousel-btn:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.similar-carousel-btn.prev {
  left: 0;
}
.similar-carousel-btn.next {
  right: 0;
}

/* ---------- Filter ---------- */
.filter-card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid #e3e6ea;
  padding: 1rem 1.1rem;
}
.filter-card h6 {
  font-weight: 700;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.6rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #cdd5df;
  margin-top: auto;
  padding: 1.4rem 0;
  text-align: center;
  font-size: 0.85rem;
}
.contact-map {
  min-height: 360px;
  background: #e9ecef;
}
.contact-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: 0;
}
.seo-prerender {
  padding: 1.5rem 0;
}
.tile a:not(.btn) {
  color: var(--red);
}
.tile a:not(.btn):hover {
  color: var(--red-dark);
}

/* ---------- Buttons ---------- */
.btn-red {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 600;
}
.btn-red:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: #fff;
}

/* ---------- Admin ---------- */
#admin-content {
  align-self: flex-start;
}
#admin-content .tile {
  height: auto;
}
.admin-pass-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
}
.admin-pass-label {
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.admin-pass-input {
  flex: 0 1 280px;
  width: 280px;
  max-width: 100%;
}
.admin-pass-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 767.98px) {
  .admin-pass-row {
    flex-wrap: wrap;
  }
  .admin-pass-input {
    flex: 1 1 100%;
    width: 100%;
  }
  .admin-pass-row .btn {
    width: 100%;
  }
}
.phone-row .phone-number {
  flex: 1 1 200px;
  max-width: 320px;
}
.phone-wa-label {
  font-size: 0.9rem;
  cursor: pointer;
}
.admin-sidebar {
  background: var(--navy);
  min-height: calc(100vh - 56px);
}
.admin-sidebar .nav-link {
  color: #cdd5df;
  border-radius: 8px;
  margin: 0.15rem 0.5rem;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.admin-sidebar .nav-link.active {
  border-left: 3px solid var(--red);
}
.admin-cat-bar {
  background: var(--card);
  border: 1px solid #e3e6ea;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.75rem;
}
.admin-cat-bar .admin-cat-add {
  max-width: 280px;
  min-width: 200px;
}
.admin-table-wrap {
  background: var(--card);
  border: 1px solid #e3e6ea;
  border-radius: 12px;
  overflow: hidden;
}
.admin-table-wrap .table {
  margin-bottom: 0;
}
.admin-table-wrap tbody tr.empty-row td {
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
}
.stat-card {
  border-radius: 12px;
  border: none;
  color: #fff;
}
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}

/* ---------- Floating chat widget ---------- */
.chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.chat-options {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.chat-widget.open .chat-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.chat-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 30px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.chat-option i {
  font-size: 1.25rem;
}
.chat-option:hover {
  color: #fff;
  transform: translateY(-2px);
  filter: brightness(1.05);
}
.chat-option.whatsapp {
  background: #25d366;
}
.chat-option.messenger {
  background: linear-gradient(135deg, #00b2ff, #006aff);
}
.chat-toggle {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(226, 59, 59, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.chat-toggle:hover {
  background: var(--red-dark);
}
.chat-widget.open .chat-toggle {
  transform: rotate(90deg);
}
.chat-toggle .icon-close {
  display: none;
}
.chat-widget.open .chat-toggle .icon-open {
  display: none;
}
.chat-widget.open .chat-toggle .icon-close {
  display: inline-block;
}
@media (max-width: 575.98px) {
  .chat-widget {
    right: 14px;
    bottom: 14px;
  }
  .chat-toggle {
    width: 54px;
    height: 54px;
    font-size: 1.5rem;
  }
}
