/* Main theme CSS — extracted from mockup/index.html <style> block */

html { scroll-behavior: smooth; }
body {
  font-family:  'Toyota Type Book', Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: #212529;
  -webkit-font-smoothing: antialiased;
}
.toyota-h1 { font-size: 26px; font-weight: 400; letter-spacing: 0.52px; color: #1A1A1A; text-transform: uppercase; }
.toyota-h2 { font-size: 26px; font-weight: 400; color: #101010; line-height: 1.25; }
.toyota-car-name { font-size: 26px; font-weight: 400; letter-spacing: 0.52px; color: #101010; }
.toyota-price { font-size: 14px; font-weight: 400; color: #3A3A3A; }
.toyota-footer-title { font-size: 16px; font-weight: 600; color: #101010; letter-spacing: normal; margin-bottom: 16px; }
.toyota-footer-link { font-size: 14px; font-weight: 400; color: #3A3A3A; }
.toyota-footer-link:hover { color: #EB0A1E; }

/* Mega menu — click-to-open */
.mega-panel { top: 92px; opacity: 0; visibility: hidden; transform: translateY(-12px); transition: opacity .25s ease, visibility .25s, transform .35s cubic-bezier(.2,.8,.2,1); pointer-events: none; z-index: 45; }
header.is-scrolled .mega-panel { top: 60px; }

/* Offset for WordPress admin bar (32px on wide screens, 46px on narrow) */
body.admin-bar .mega-panel { top: 124px; }
body.admin-bar header.is-scrolled .mega-panel { top: 92px; }
@media (max-width: 782px) {
  body.admin-bar .mega-panel { top: 138px; }
  body.admin-bar header.is-scrolled .mega-panel { top: 106px; }
}
.nav-item.is-open .mega-panel { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.nav-item.is-open > .nav-link { color: #EB0A1E; }
.nav-item.is-open > .nav-link .chev { transform: rotate(180deg); }
.nav-link .chev { transition: transform .2s; display:inline-block; }

.menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s; }
.menu-overlay.active { opacity: 1; visibility: visible; }

/* Red accent line spans full header width */
.header-red-line { display: block; height: 2px; background: #EB0A1E; }

/* Gray separator aligns with main nav area only (not full right column) */
.nav-row-sep { display: none; }
.main-nav-row {
  width: fit-content;
  margin-left: auto;
  border-top: 1px solid #E9E9E9;
}

.main-nav-row { transition: height .2s ease; }
.utility-row { transition: opacity .2s ease, max-height .25s ease; overflow: hidden; max-height: 40px; }
header.is-scrolled .utility-row { max-height: 0; opacity: 0; pointer-events: none; }
header.is-scrolled .nav-row-sep { display: none; }

.utility-icons { display: none; align-items: center; justify-content: flex-end; gap: 26px; height: 44px; font-size: 14px; color: #212529; }
.utility-icons a { display: inline-flex; align-items: center; gap: 8px; color: #212529; }
.utility-icons a:hover { color: #EB0A1E; }
.utility-icons a i { font-size: 16px; }
header.is-scrolled .utility-icons { display: flex; }

.header-logo { transition: height .2s ease; }
header.is-scrolled .header-logo { height: 44px !important; }

/* When scrolled, align logo vertically with the main nav row (not with the
   utility-icons row above). Outer flex uses items-center, but right column
   has 2 rows — centering would put the logo between them. Push logo down so
   it aligns with the main nav. */
header .header-logo-link { align-self: center; }
header.is-scrolled .header-logo-link { align-self: flex-end; padding-bottom: 6px; }

.prod-tab { position: relative; padding: 14px 4px; color:#3A3A3A; font-size:14px; font-weight: 500; letter-spacing: .04em; cursor: pointer; background: transparent; border: 0; display: inline-flex; align-items: center; text-decoration: none; }
.prod-tab:hover { color:#EB0A1E; }
.prod-tab.active { color:#EB0A1E; }
.prod-tab.active::after { content:''; position:absolute; left:0; right:0; bottom:-1px; height:2px; background:#EB0A1E; }
.hybrid-dot { width:14px; height:14px; border-radius:50%; background:#0098D8; display:inline-block; margin-right:6px; vertical-align: middle; box-shadow: inset 0 0 0 2px #fff; outline: 1px solid #0098D8; }

details > summary::-webkit-details-marker { display: none; }
details > summary { list-style: none; }
details[open] > summary .fa-chevron-down { transform: rotate(180deg); }

.sep-red::after { content: ''; display: block; width: 56px; height: 3px; background: #EB0A1E; margin-top: 12px; }

.swiper-hero { aspect-ratio: 1425 / 605; overflow: hidden; }
.swiper-hero .swiper-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }

.btn-link { position: relative; }
.btn-link::after { content:''; position:absolute; left:0; right:0; bottom:-4px; height:2px; background:#EB0A1E; transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.btn-link:hover::after { transform: scaleX(1); }

.tab-active { color:#EB0A1E; border-bottom-color:#EB0A1E; }

.swiper-button-next, .swiper-button-prev { color: #fff !important; background: rgba(0,0,0,.25); width:44px !important; height:44px !important; border-radius: 50%; }
.swiper-button-next:after, .swiper-button-prev:after { font-size: 16px !important; font-weight: 800; }
.swiper-pagination-bullet-active { background: #EB0A1E !important; }

.news-card img { transition: transform .5s ease; }
.news-card:hover img { transform: scale(1.05); }

.float-contact { box-shadow: 0 6px 20px rgba(235,10,30,.35); }

/* ========================================
   Pagination — global WP the_posts_pagination() + paginate_links()
   Toyota style: square 36px boxes, red active, hover red, grey border.
   ======================================== */
/* Parent wrapper must be text-align:center; child nav-links uses inline-flex */
.nav-links,
.tdt-vehicle-pagination .nav-links,
.tdt-news-hub__pagination .nav-links,
.tdt-vehicle-pagination,
.tdt-news-hub__pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nav-links .page-numbers,
.tdt-vehicle-pagination .page-numbers,
.tdt-news-hub__pagination .page-numbers {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #D9D9D9;
  background: #fff;
  color: #1A1A1A;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-links .page-numbers:hover,
.tdt-vehicle-pagination .page-numbers:hover,
.tdt-news-hub__pagination .page-numbers:hover {
  border-color: #EB0A1E;
  color: #EB0A1E;
}
.nav-links .page-numbers.current,
.tdt-vehicle-pagination .page-numbers.current,
.tdt-news-hub__pagination .page-numbers.current {
  background: #EB0A1E;
  border-color: #EB0A1E;
  color: #fff;
}
.nav-links .page-numbers.dots,
.tdt-vehicle-pagination .page-numbers.dots,
.tdt-news-hub__pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  cursor: default;
}
.nav-links .page-numbers.dots:hover {
  color: #1A1A1A;
  border-color: transparent;
}
/* Prev/Next arrows — slightly wider for ‹ › glyphs */
.nav-links .page-numbers.prev,
.nav-links .page-numbers.next,
.tdt-vehicle-pagination .page-numbers.prev,
.tdt-vehicle-pagination .page-numbers.next {
  font-size: 18px;
  padding: 0 12px;
}
/* WP wraps current-page number in <span class="page-numbers current"> — target it */
.nav-links .screen-reader-text {
  position: absolute !important;
  clip: rect(1px,1px,1px,1px);
  width: 1px; height: 1px; overflow: hidden;
}

/* ========================================
   Vehicle filter selects — match toyota.com.vn style:
   bordered box 1px grey + red chevron arrow on right, hover red border.
   ======================================== */
.tdt-vehicle-filter select,
.vehicle-sort select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  height: 44px;
  padding: 0 36px 0 14px;
  border: 1px solid #D9D9D9;
  border-radius: 0;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 7'><path fill='%23EB0A1E' d='M6 7 0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 7px;
  font-size: 14px;
  color: #1A1A1A;
  cursor: pointer;
  transition: border-color .15s;
}
.tdt-vehicle-filter select:hover,
.vehicle-sort select:hover {
  border-color: #EB0A1E;
}
.tdt-vehicle-filter select:focus,
.vehicle-sort select:focus {
  border-color: #EB0A1E;
  outline: none;
}
.tdt-vehicle-filter select:disabled,
.vehicle-sort select:disabled {
  background-color: #F5F5F5;
  color: #808080;
  cursor: not-allowed;
}
.tdt-vehicle-filter label > span,
.vehicle-sort label > span {
  display: block;
  font-size: 13px;
  color: #3A3A3A;
  margin-bottom: 8px;
  font-weight: 400;
}
.vehicle-sort select { min-width: 200px; width: auto; }

/* ========================================
   Recently viewed vehicles (home section).
   ======================================== */
.tdt-rv { padding: 48px 0; background: #fff; }
.tdt-rv__title {
  font-size: 22px;
  font-weight: 400;
  color: #1A1A1A;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 32px;
}
.tdt-rv__carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.tdt-rv__track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 8px 0 4px;
  flex: 1;
  scrollbar-width: none;
}
.tdt-rv__track::-webkit-scrollbar { display: none; }
.tdt-rv__card {
  flex: 0 0 calc((100% - 48px) / 4); /* 4 cards trên desktop */
  min-width: 0;
  scroll-snap-align: start;
  background: #fff;
  text-align: center;
}
.tdt-rv__card-link { display: block; color: inherit; text-decoration: none; transition: opacity .15s; }
.tdt-rv__card-link:hover { opacity: .85; }
.tdt-rv__card-image {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F5F5F5;
  margin-bottom: 14px;
}
.tdt-rv__card-img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}
.tdt-rv__card-title {
  font-size: 15px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #1A1A1A;
  margin: 0 0 4px;
}
.tdt-rv__card-price {
  font-size: 13px;
  color: #3A3A3A;
  margin: 0;
}
.tdt-rv__nav {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid #D9D9D9;
  background: #fff;
  color: #3A3A3A;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s, color .15s, opacity .15s;
}
.tdt-rv__nav:hover:not(:disabled) { border-color: #EB0A1E; color: #EB0A1E; }
.tdt-rv__nav:disabled { opacity: 0.3; cursor: not-allowed; }

@media (max-width: 1024px) {
  .tdt-rv__card { flex-basis: calc((100% - 32px) / 3); }
}
@media (max-width: 767px) {
  .tdt-rv__card { flex-basis: calc((100% - 16px) / 2); }
  .tdt-rv__title { font-size: 18px; }
}
