/*
  RW Automóveis — store-specific overrides for the modern2 layout.
  Loaded only when the store has portal_settings.features.tenant_css set
  (see templates/portal/partials/header_omega_modern2.html); no other store
  receives this file.
*/
:root {
  --rw-orange: #f7941d;
  --rw-orange-hover: #e8820a;
  --rw-price: #111111;
}

/* ---------- Split hero showing the WHOLE storefront photo ----------
   The photo box keeps the image's own proportion (2752x1536), so nothing is
   cropped; the hero height follows it. A dark strip under the photo leaves room
   for the search panel that overlaps the bottom of the hero. */
.omg-hero--split .hs-media {
  bottom: auto;
  aspect-ratio: 2752 / 1536;
  height: auto;
  width: 58%;
  background-size: cover;
  background-position: center;
}
.omg-hero--split .hs-media:after {
  background: linear-gradient(90deg, #0b0c0e 0%, rgba(11, 12, 14, .45) 5%, rgba(11, 12, 14, 0) 14%);
}
@media (min-width: 761px) {
  .omg-hero.omg-hero--split {
    min-height: calc(58vw * 1536 / 2752 + 44px);
  }
  .omg-hero--split .omg-hero-inner {
    min-height: calc(58vw * 1536 / 2752);
  }
}
@media (max-width: 760px) {
  .omg-hero--split .hs-media {
    width: 100%;
  }
  .omg-hero--split .hs-media:after {
    background: linear-gradient(180deg, rgba(11, 12, 14, 0) 82%, #0b0c0e 100%);
  }
}

/* ---------- Header follows the scroll ----------
   .omg-site-header is sticky, but its wrapper is only as tall as itself, so it
   never stuck. Make the wrapper sticky instead, shifted up by the address strip
   (34px + 1px border) so only the menu bar stays on screen. */
.omg-theme.omg-header {
  position: sticky;
  top: -35px;
  z-index: 90;
}
@media (max-width: 1100px) {
  .omg-theme.omg-header {
    top: 0;   /* the address strip is hidden on smaller screens */
  }
}

/* ---------- Header logo: black band with the logo centred ----------
   The logo link is a black block almost as tall as the header (a small gap
   above and below, slightly rounded corners); the logo plate image is black
   too, so both read as one band. */
.omg-site-header .brand-link {
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 62px;
  padding: 0 26px;
  border-radius: 5px;
  background: #000;
}
.omg-site-header .site-logo-image {
  max-width: 210px;
  max-height: 54px;
}
@media (max-width: 760px) {
  .omg-site-header .brand-link {
    height: 58px;
    padding: 0 14px;
  }
  .omg-site-header .site-logo-image {
    max-width: 170px;
    max-height: 48px;
  }
}

/* ---------- No favorites: header heart (its /favoritos page doesn't exist) and the
   hearts on car cards (home, stock grid and list, related cars) ---------- */
a.round-link[href="/favoritos"],
.favorite-btn,
.list-card-fav-btn,
.vehicle-favorite,
.btn-favorite {
  display: none !important;
}

/* ---------- Footer: same pure black as the logo plate ---------- */
.omg-theme.site-footer {
  background: #000;
}

/* ---------- Vehicle page ---------- */
/* sticky top bar: WhatsApp green like the homepage (was the store red) */
#stickyPriceBar a[href*="wa.me"] {
  background: #22c55e !important;
}
#stickyPriceBar a[href*="wa.me"]:hover {
  background: #16a34a !important;
}
/* "Quero comprar ..." button: orange like the car-card buttons */
a[href*="wa.me"]:has(> i.fa-check) {
  background: var(--rw-orange) !important;
}
a[href*="wa.me"]:has(> i.fa-check):hover {
  background: var(--rw-orange-hover) !important;
}
/* "Selo de Confiança": the marquee repeats the list for its loop, so with
   few items both copies were visible side by side. Show each item once. */
.trust-seal-viewport {
  -webkit-mask-image: none !important;
  mask-image: none !important;
}
.trust-seal-track {
  animation: none !important;
  flex-wrap: wrap;
  width: auto !important;
}
.trust-seal-track .trust-seal-pill[aria-hidden="true"] {
  display: none !important;
}

/* ---------- Footer contact block: <address> is italic by default (the blog
   pages don't load the portal base reset) ---------- */
.omg-theme.site-footer address {
  font-style: normal;
}

/* ---------- Car-card buttons ("Comprar <marca>") in orange ----------
   Only the buttons on vehicle cards; every other button keeps the store red. */
.vehicle-card-cta .details-btn,
.list-card-scope .list-card-details-btn,
span.btn-buy[style*="#ef1929"] {
  background: var(--rw-orange) !important;
  border-color: var(--rw-orange) !important;
  color: #fff !important;
}
.vehicle-card-cta .details-btn:hover,
.list-card-scope .list-card-details-btn:hover {
  background: var(--rw-orange-hover) !important;
  border-color: var(--rw-orange-hover) !important;
  filter: none;
}
.vehicle-mega-card-button {
  border-color: var(--rw-orange) !important;
  color: var(--rw-orange-hover) !important;
}
.vehicle-mega-card:hover .vehicle-mega-card-button {
  background: var(--rw-orange) !important;
  color: #fff !important;
}

/* ---------- Prices: black ---------- */
.omg-theme .vehicle-price b,
.vehicle-mega-card-price {
  color: var(--rw-price) !important;
}
/* vehicle page: price paragraphs are coloured inline with the theme colour */
p[style*="color: #ef1929"] {
  color: var(--rw-price) !important;
}

/* ---------- Brand carousel: smaller circles ---------- */
.brand-logo-carousel-item {
  flex-basis: 112px !important;
  width: 112px !important;
  height: 112px !important;
  border-width: 1.5px !important;
}
@media (max-width: 760px) {
  .brand-logo-carousel-item {
    flex-basis: 78px !important;
    width: 78px !important;
    height: 78px !important;
  }
}

/* ---------- Homepage: 4 cars per row, compact "Ver todos" button ---------- */
@media (min-width: 1101px) {
  .omg-main .omg-section .vehicle-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
  .omg-main .vehicle-card .vehicle-info h3 {
    font-size: 13px;
  }
}
.omg-main .center-action .details-btn {
  flex: 0 0 auto;
  min-width: 240px;
  height: 44px;
  padding: 0 32px !important;
  border-radius: 6px;
}

/* ---------- Homepage search: room for the text (was cut: "Todas as marca") ---------- */
.omg-main .stock-search-panel select {
  padding: 0 34px 0 46px;
  font-size: 14px;
  text-overflow: ellipsis;
}
.omg-main .search-select-shell .field-icon {
  left: 15px;
}
.omg-main .search-select-shell .field-chevron {
  right: 14px;
}

/* ---------- Bank partners: all six visible at once ---------- */
.automax-partners-showcase .automax-partner-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  overflow: visible;
  padding: 0;
}
.automax-partners-showcase .automax-partner-card {
  flex: none;
  min-width: 0;
  align-items: center;
  gap: 10px;
}
.automax-partners-showcase .automax-partner-logo-box {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  margin: 0;
  padding: 8px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(31, 46, 77, .08);
}
.automax-partners-showcase .automax-partner-logo-box img {
  max-width: 42px;
  max-height: 28px;
}
.automax-partners-showcase .automax-partner-meta {
  min-width: 0;
  padding: 0;
}
.automax-partners-showcase .automax-partner-name {
  gap: 6px;
  margin-bottom: 2px;
  font-size: 13px;
}
.automax-partners-showcase .automax-partner-check {
  flex-basis: 14px;
  width: 14px;
  height: 14px;
  font-size: 9px;
}
.automax-partners-showcase .automax-partner-meta small {
  max-width: none;
  font-size: 11px;
  line-height: 1.35;
}
@media (max-width: 1100px) {
  .automax-partners-showcase .automax-partner-track { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; }
}
@media (max-width: 560px) {
  .automax-partners-showcase .automax-partner-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Carousels (brands + testimonials), driven by js/tenants/rwautomoveis.js ---------- */
.rw-carousel {
  position: relative;
}
/* The track is moved with a GPU transform (smooth at any speed); the viewport only clips. */
.rw-carousel > .rw-carousel-viewport {
  overflow: hidden !important;
  touch-action: pan-y;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}
.rw-carousel > .rw-carousel-viewport:active {
  cursor: grabbing;
}
.rw-carousel .rw-carousel-track {
  will-change: transform;
  backface-visibility: hidden;
}
.rw-carousel .rw-carousel-track img {
  -webkit-user-drag: none;
  pointer-events: none;
}
.rw-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  padding: 0;
  border: 1px solid #e4e7ec;
  border-radius: 50%;
  background: #fff;
  color: #172033;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.rw-arrow:hover {
  border-color: var(--omg-primary, #ef1929);
  background: var(--omg-primary, #ef1929);
  color: #fff;
}
.rw-arrow--prev { left: 0; }
.rw-arrow--next { right: 0; }
/* brands: JS-driven motion replaces the CSS marquee */
.rw-carousel .brand-logo-carousel-track {
  animation: none !important;
}
.rw-carousel .brand-logo-carousel.rw-carousel-viewport {
  padding-left: 0;
  padding-right: 0;
  margin: 0 52px;
}
/* testimonials: one row, three cards per view on desktop */
.rw-carousel .testimonial-grid.rw-carousel-viewport {
  display: block;
  padding: 6px 2px 18px;
}
.rw-carousel .testimonial-grid .rw-carousel-track {
  display: flex;
  gap: 20px;
}
.rw-carousel .testimonial-grid .testimonial-card {
  flex: 0 0 calc((100% - 40px) / 3);
  opacity: 1;
  transform: none;
}
.rw-carousel--testimonials .rw-arrow--prev { left: -20px; }
.rw-carousel--testimonials .rw-arrow--next { right: -20px; }
@media (max-width: 1100px) {
  .rw-carousel .testimonial-grid .testimonial-card { flex-basis: calc((100% - 20px) / 2); }
  .rw-carousel--testimonials .rw-arrow--prev { left: -6px; }
  .rw-carousel--testimonials .rw-arrow--next { right: -6px; }
}
@media (max-width: 760px) {
  .rw-carousel .testimonial-grid .testimonial-card { flex-basis: 88%; }
  .rw-arrow { width: 34px; height: 34px; margin-top: -17px; }
  .rw-carousel .brand-logo-carousel.rw-carousel-viewport { margin: 0 40px; }
}

/* ---------- Car icons: the store's own set (static/portal/img/icons/cars/*.svg) ----------
   Each old car icon is hidden and the new one is drawn with a CSS mask in the
   colour that spot already used (currentColor). Only car icons are replaced. */
.vehicle-mega-link[href*="vehicle_type="] .vehicle-mega-category-icon {
  font-size: 0;
}
.vehicle-mega-link[href*="vehicle_type="] .vehicle-mega-category-icon::before,
a.round-link[aria-label="Comparar veículos"]::before,
.search-select-shell:has(#modelSelect) .field-icon::before,
i.fa-car::before,
i.fa-car-side::before {
  content: '';
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
/* mega menu "Comprar por categoria" (was ▣ ▭ ◪ ▬) */
.vehicle-mega-link[href*="vehicle_type="] .vehicle-mega-category-icon::before {
  width: 30px;
  height: 30px;
}
.vehicle-mega-link[href*="vehicle_type=suv"] .vehicle-mega-category-icon::before {
  -webkit-mask-image: url('../../img/icons/cars/suv.svg');
  mask-image: url('../../img/icons/cars/suv.svg');
}
.vehicle-mega-link[href*="vehicle_type=sedan"] .vehicle-mega-category-icon::before {
  -webkit-mask-image: url('../../img/icons/cars/sedan.svg');
  mask-image: url('../../img/icons/cars/sedan.svg');
}
.vehicle-mega-link[href*="vehicle_type=hatch"] .vehicle-mega-category-icon::before {
  -webkit-mask-image: url('../../img/icons/cars/hatch.svg');
  mask-image: url('../../img/icons/cars/hatch.svg');
}
.vehicle-mega-link[href*="vehicle_type=pickup"] .vehicle-mega-category-icon::before {
  -webkit-mask-image: url('../../img/icons/cars/picape.svg');
  mask-image: url('../../img/icons/cars/picape.svg');
}
/* header "Comparar veículos" button */
a.round-link[aria-label="Comparar veículos"] > svg {
  display: none;
}
a.round-link[aria-label="Comparar veículos"]::before {
  width: 26px;
  height: 26px;
  -webkit-mask-image: url('../../img/icons/cars/comparar.svg');
  mask-image: url('../../img/icons/cars/comparar.svg');
}
/* homepage search, "Tipo de veículo" (body type after rwautomoveis.js; was a fuel/bolt icon) */
.search-select-shell:has(select[name="vehicle_type"]) .field-icon > svg {
  display: none;
}
.search-select-shell:has(select[name="vehicle_type"]) .field-icon::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 22px;
  background-color: currentColor;
  -webkit-mask: url('../../img/icons/cars/suv.svg') center / contain no-repeat;
  mask: url('../../img/icons/cars/suv.svg') center / contain no-repeat;
}
/* homepage search, "Modelo" field */
.search-select-shell:has(#modelSelect) .field-icon > svg {
  display: none;
}
.search-select-shell:has(#modelSelect) .field-icon::before {
  width: 20px;
  height: 20px;
  -webkit-mask-image: url('../../img/icons/cars/carro.svg');
  mask-image: url('../../img/icons/cars/carro.svg');
}
/* Font Awesome car icons on inner pages (Sobre, vehicle page) */
i.fa-car::before,
i.fa-car-side::before {
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.22em;
  -webkit-mask-image: url('../../img/icons/cars/carro.svg');
  mask-image: url('../../img/icons/cars/carro.svg');
}

/* ---------- Focus ring only for keyboard users (no red box after a click) ---------- */
.omg-theme a:focus:not(:focus-visible),
.omg-theme button:focus:not(:focus-visible) {
  outline: none;
}

/* ---------- Mega menu ("Veículos") ---------- */
.vehicle-mega-title {
  gap: 10px;
  font-size: 13.5px;
  letter-spacing: 0;
  white-space: normal;
  line-height: 1.2;
}
.vehicle-mega-title-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 16px;
}
.vehicle-mega-link strong,
.vehicle-mega-price-list .vehicle-mega-link strong {
  font-size: 13.5px;
}
.vehicle-mega-featured-head {
  flex-wrap: wrap;
  gap: 8px 14px;
}
.vehicle-mega-see-all {
  font-size: 11px !important;
}
.vehicle-mega-card-body {
  padding: 12px;
}
.vehicle-mega-card-title {
  font-size: 12px;
  min-height: 32px;
}
.vehicle-mega-card-meta {
  flex-wrap: wrap;
  gap: 2px 8px;
}
.vehicle-mega-card-price {
  font-size: 15px;
}
.vehicle-mega-card-button {
  min-height: 36px;
  white-space: nowrap;
}
/* Wide screens: four columns in one row -> give "Destaques" room and show 2 cards. */
@media (min-width: 1321px) {
  .vehicle-mega-shell {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .85fr) minmax(0, 1.45fr);
  }
  .vehicle-mega-col {
    padding: 0 20px;
  }
  .vehicle-mega-featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vehicle-mega-featured-grid > :nth-child(n+3) {
    display: none;
  }
  .vehicle-mega-card-media {
    height: 120px;
  }
}

/* ---------- Mobile menu (<= 1100px) ---------- */
@media (max-width: 1100px) {
  .omg-site-header .main-nav {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 6px 20px 14px;
  }
  .omg-site-header .main-nav > a,
  .omg-site-header .main-nav .nav-mega-item {
    height: auto;
    display: flex;
    border-bottom: 1px solid #edf0f3;
  }
  .omg-site-header .main-nav > a,
  .omg-site-header .main-nav .nav-mega-toggle {
    width: 100%;
    padding: 15px 2px;
    font-size: 13px;
  }
  .omg-site-header .main-nav > a:last-child {
    border-bottom: 0;
  }
  .omg-site-header .nav-mega-toggle i {
    display: none;
  }
  /* its children are all hidden on mobile; drop the empty box so ☰ sits at the right edge */
  .omg-site-header .header-actions {
    display: none;
  }
}
@media (max-width: 760px) {
  .omg-theme .site-logo-image {
    max-height: 46px;
  }
  .nav-wrap {
    gap: 12px;
  }
}
