/* Motorsam additions on top of the unchanged template stylesheet:
   brand colour, real photos, the Cars mega menu and car search. */

/* ---------- Brand colour (template yellow -> Motorsam red) ---------- */
:root { --color--primary-1: #e41e25; }

/* Red backgrounds need white text (template used black text on yellow) */
.button-icon, .button, .button-submit, .menu-button, .car-rental-link, .step-no-round,
.empty-state, .team-badge, .text-mark, .blog-badge { color: var(--color--white); }
.menu-button .w-icon-nav-menu { color: var(--color--white); }
/* Black hover/selected states: white text reads better than red on black */
.car-rental-link:hover, .car-rental-link.w--current, .button-submit:hover, .button:hover { color: var(--color--white); }
.button-submit.footer-button:hover { color: var(--color--black); }

/* ---------- Motorsam's own photos (keep template hero/counter styles) ---------- */
.counter-bg-image { background-image: url("../img/real/fb-075.webp"); }
/* Car cards: photo fills the whole card, details sit on a dark gradient at the bottom */
.car-item {
  position: relative; overflow: hidden; justify-content: flex-end;
  min-height: 440px; background-color: var(--color--black);
}
@media screen and (min-width: 768px) { .car-item { aspect-ratio: 1 / 1; min-height: 0; } }
.grid-car > * { min-width: 0; }
@media screen and (max-width: 767px) { .car-item { min-height: 540px; } }
.car-item .car-image-wrap { position: absolute; inset: 0; z-index: 0; border-radius: 0; overflow: hidden; }
.car-item .car-image { object-fit: cover; object-position: 50% 72%; }
.car-item .car-image-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(22, 22, 24, 0) 30%, rgba(22, 22, 24, .55) 55%, rgba(22, 22, 24, .94) 100%);
}
.car-item > div:not(.car-image-wrap) { position: relative; z-index: 1; }
.car-item .car-title, .car-item .car-rent-price, .car-item .car-meta-value { color: var(--color--white); }
.car-item .car-rent-text, .car-item .text-small { color: rgba(255, 255, 255, .75); }
.car-item .car-divider { background-color: rgba(255, 255, 255, .22); }
.car-item .car-meta-icon { filter: invert(1); }
.car-detail-image-wrap { padding: 0; }
.car-detail-image { aspect-ratio: 4 / 3; }
.rental-category-image { aspect-ratio: 1; }
.blog-image-wrap { aspect-ratio: 3 / 2; }
.blog-image { object-fit: cover; }
.blog-detail-image-wrap { aspect-ratio: 16 / 9; }
/* About photo (showroom sign): fixed wide frame, crop centred on the sign at every width */
.about-image-wrap { aspect-ratio: 2 / 1; max-height: 680px; width: 100%; }
.about-image { position: absolute; inset: 0; object-position: 42% 55%; }
@media screen and (max-width: 767px) { .about-image-wrap { aspect-ratio: 4 / 3; height: auto; } }

/* ---------- Car search box ---------- */
.ms-search { position: relative; display: flex; gap: 8px; width: 100%; margin: 0; }
.ms-search .ms-search-input { flex: 1; margin: 0; min-height: 54px; }
.ms-search-btn { flex: none; }
.ms-search.is-dark .ms-search-input {
  background-color: rgba(22, 22, 24, .85); border-color: var(--color--gray-2); color: var(--color--white);
}
.ms-search.is-dark .ms-search-input::placeholder { color: var(--color--gray-3); }
.ms-hero-search { max-width: 580px; }
.ms-hero-search .ms-search-input { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

.ms-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 90; text-align: left;
  background: var(--color--white); border-radius: var(--border-radius--md);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .25); overflow: hidden;
}
.ms-suggest-item {
  display: flex; gap: 14px; align-items: center; padding: 10px 14px;
  color: var(--color--black); text-decoration: none; line-height: 1.3;
}
.ms-suggest-item:hover, .ms-suggest-item:focus { background: var(--color--gray-5); outline: none; }
.ms-suggest-item img { width: 72px; height: 54px; object-fit: cover; border-radius: var(--border-radius--sm); flex: none; }
.ms-suggest-item strong { display: block; font-weight: 500; }
.ms-suggest-item small { color: var(--color--gray-2); font-size: 14px; }
.ms-suggest-all { display: block; padding: 12px 14px; border-top: 1px solid var(--color--gray-4); color: var(--color--primary-1); font-weight: 500; text-decoration: none; }
.ms-suggest-all:hover, .ms-suggest-all:focus { background: var(--color--gray-5); outline: none; }
.ms-suggest-none { padding: 14px; color: var(--color--gray-2); }
.ms-suggest-none a { color: var(--color--primary-1); }

/* ---------- Cars page: sidebar filters ---------- */
.ms-shop { display: grid; grid-template-columns: 290px 1fr; gap: 40px; align-items: start; }
.ms-sidebar { position: sticky; top: 24px; min-width: 0; }
.ms-shop-main { min-width: 0; }
.ms-filter-panel {
  margin: 0; padding: 28px; border-radius: var(--border-radius--lg); background: var(--color--gray-5);
  max-height: calc(100vh - 48px); overflow-y: auto;
}
.ms-filter-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.ms-filter-heading { font-size: 22px; margin: 0; }
.ms-filter-group { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.ms-filter-group + .ms-filter-group, .ms-filter-note + .ms-filter-group { border-top: 1px solid var(--color--gray-4); padding-top: 20px; }
.ms-filter-title { display: block; font-family: var(--font-family--heading); color: var(--color--black); font-weight: 500; font-size: 17px; margin-bottom: 10px; padding: 0; }
.ms-filter-group .form-input { margin: 0; min-height: 50px; width: 100%; }
.ms-check { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; color: var(--color--gray-1); margin: 0; font-weight: 400; }
.ms-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ms-check-box {
  flex: none; width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid var(--color--gray-3); background: var(--color--white);
  transition: background-color .2s, border-color .2s;
}
.ms-check input:checked + .ms-check-box {
  background: var(--color--primary-1) url("../img/icons/check-white.svg") center / 12px no-repeat; border-color: var(--color--primary-1);
}
.ms-check input:focus-visible + .ms-check-box { outline: 2px solid var(--color--primary-1); outline-offset: 2px; }
.ms-check-label { flex: 1; }
.ms-check:hover .ms-check-label { color: var(--color--black); }
.ms-filter-note { font-size: 13px; line-height: 1.4; color: var(--color--gray-2); margin: -14px 0 20px; }
.ms-filter-help { font-size: 15px; color: var(--color--gray-2); border-top: 1px solid var(--color--gray-4); padding-top: 18px; }
.ms-filter-help a, .ms-clear { color: var(--color--primary-1); }
.ms-filter-toggle { display: none; width: 100%; }
.ms-shop-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.ms-results { color: var(--color--gray-2); }
.ms-sort { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 400; color: var(--color--gray-2); }
.ms-sort .form-input { margin: 0; min-height: 46px; width: auto; padding-right: 36px; }
.ms-empty { text-align: center; padding: 60px 20px; border-radius: var(--border-radius--lg); background: var(--color--gray-5); }
.ms-empty p { max-width: 520px; margin: 0 auto 24px; }
.ms-empty-actions { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; align-items: center; }
@media screen and (max-width: 991px) {
  .ms-shop { grid-template-columns: 1fr; gap: 20px; }
  .ms-sidebar { position: static; }
  .ms-filter-toggle { display: block; }
  .ms-filter-panel { display: none; margin-top: 12px; max-height: none; }
  .ms-filters-open .ms-filter-panel { display: block; }
}

/* ---------- Cars mega menu ---------- */
.ms-mega-title { color: var(--color--gray-3); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.ms-mega-title.ms-mt { margin-top: 18px; }
.ms-mega .dropdown-link { display: flex; justify-content: space-between; gap: 10px; white-space: normal; }
.ms-count { color: var(--color--gray-3); font-size: 13px; }
.ms-mega-top { margin-bottom: 22px; }
.ms-mega-foot { border-top: 1px solid var(--color--gray-2); margin-top: 22px; padding-top: 14px; color: var(--color--gray-3); font-size: 15px; }
.ms-mega-foot a { color: var(--color--white); }
.ms-mega-foot a:hover { color: var(--color--primary-1); }
.ms-dot { margin: 0 6px; }
.ms-mega-feature {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  min-height: 250px; padding: 18px; border-radius: var(--border-radius--md); overflow: hidden;
  color: var(--color--white); text-decoration: none;
}
.ms-mega-feature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.ms-mega-feature::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.8)); }
.ms-mega-feature:hover img { transform: scale(1.04); }
.ms-mega-feature > span { position: relative; z-index: 1; }
.ms-mega-feature-tag { align-self: flex-start; background: var(--color--primary-1); border-radius: var(--border-radius--sm); padding: 2px 8px; font-size: 13px; margin-bottom: 4px; }
.ms-mega-feature-name { font-family: var(--font-family--heading); font-size: 20px; font-weight: 500; }
.ms-mega-feature-price { font-size: 14px; color: var(--color--gray-4); }

@media screen and (min-width: 992px) {
  .right-nav { position: relative; }
  .right-nav .nav-menu, .ms-mega-dropdown { position: static; }
  .ms-mega-list { left: auto; right: 0; top: 100%; width: min(960px, calc(100vw - 40px)); padding-top: 12px; }
  /* invisible bridge so the menu stays open while the pointer moves down to it */
  .ms-mega-list::before { content: ""; position: absolute; left: 0; right: 0; top: -36px; height: 48px; }
  .ms-mega-list .dropdown-list-wrap { padding: 26px 30px 18px; box-shadow: 0 24px 50px rgba(0, 0, 0, .35); }
  .ms-mega-cols { display: grid; grid-template-columns: 1fr 1.25fr 1fr 1.35fr; gap: 30px; }
}

/* Phones/tablets: the template's hover dropdown can't be tapped open, so the
   Cars menu content is always shown inside the collapsed menu. */
@media screen and (max-width: 991px) {
  .ms-mega-dropdown .dropdown-list { display: block !important; position: static; opacity: 1 !important; transform: none !important; padding-top: 6px; margin-bottom: 6px; }
  .ms-mega-dropdown .dropdown-list-wrap { border: 0; background: transparent; padding: 0; }
  .ms-mega-dropdown .dropdown-icon { display: none; }
  .ms-mega-dropdown .dropdown-toggle { cursor: default; pointer-events: none; }
  .ms-mega-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; }
  .ms-mega-cols > .ms-mega-col:nth-child(3), .ms-mega-feature { display: none; }
  .ms-mega .dropdown-link { font-size: 16px; padding-top: 4px; padding-bottom: 4px; }
  .ms-mega-top { margin-bottom: 14px; }
  .ms-mega-top .ms-search-btn { padding-left: 16px; padding-right: 16px; }
  .ms-mega-foot { margin-top: 12px; font-size: 14px; }
}

/* Cards next to the filter sidebar are narrower: tighter padding and spec spacing */
.ms-shop .car-item { padding: 28px; }
.ms-shop .grid-car { grid-column-gap: 24px; grid-row-gap: 24px; }

/* Smaller specs row on every car card */
.car-item .grid-car-meta { grid-column-gap: 14px; grid-row-gap: 12px; }
.car-item .car-meta-item { grid-column-gap: 8px; }
.car-item .car-meta-icon { height: 26px; }
.car-item .text-small { font-size: 13px; line-height: 1.3em; }
.car-item .car-meta-value { font-size: 16px; margin-top: 2px; }
.car-item .car-divider { margin-top: 18px; margin-bottom: 18px; }

/* Team section with only the two directors: centre two cards instead of a 4-column row */
.grid-team.ms-team-2 { grid-template-columns: repeat(2, minmax(0, 300px)); justify-content: center; }
@media screen and (max-width: 479px) { .grid-team.ms-team-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Director portraits: keep faces in frame */
.team-image { object-position: 50% 30%; }

/* Hero search suggestions must not be cut off by the hero's rounded frame */
.hero-bg-section { position: relative; z-index: 20; }
.hero-bg-wrapper { overflow: visible; }
.hero-bg-image-overlay { border-radius: inherit; }
.ms-hero-search .ms-suggest { max-height: min(60vh, 440px); overflow-y: auto; }
