:root {
    --color-white: #ffffff;
    --color-black: #000000;
    --color-theme-red: #d40707; 
    --color-theme-gray: #F2F2F3; 
    --color-theme-dark-gray: #EAEAEC;
    --color-theme-darker-gray: #a7a7aa;
    --color-text: #3b3d3f; 

    --font-size: 1.25rem; 
    --page-width: 1440px; 
}

*, 
*::before, 
*::after {
    box-sizing: border-box;
}

body, 
html {
    margin: 0; 
    padding: 0; 
}

a, 
input, 
select, 
button {
    font: inherit; 
}

img {
    max-width: 100%; 
    height: auto;
}

ul, 
ol {
    list-style: none; 
    margin: 0; 
    padding: 0;
}

li {
    margin: 0; 
    padding: 0;
}

h1, 
h2, 
h3, 
h4, 
h5, 
h6, 
p {
    margin: 0; 
    padding: 0;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

a {
    max-width: fit-content;
}

body {
    font-family: 'Syne', serif;
    font-family: "Syne", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    scroll-behavior: smooth;
    font-size: var(--font-size);
    font-weight: 400;
}


/* === Global === */

.container {
    width: 100%;
    max-width: var(--page-width);
    margin: 0 auto;
}

.section {
    padding: 0 1.5rem;
}

h1, 
h2, 
h3,
h4,
h5,
h6 {
    font-weight: 500;
    line-height: normal;
}

p {
    line-height: 140%;
}

h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.75rem, 3.5vw, 1.75rem);
}


.thm-btn {
    padding: 0.75rem 2.5rem;
    color: var(--color-white);
    border: 1px solid var(--color-white);
    border-radius: 4rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: fit-content;
}

.thm-btn:hover {
    background: var(--color-white);
    color: var(--color-black);
    border-color: var(--color-black);
    transition: background 250ms ease, color 250ms ease, border-color 250ms ease;
}

/* === Header === */

.header {
    position: fixed;
    width: 100%;
    padding: 0 1.5rem;
    transition: background-color .25s ease, box-shadow .25s ease;
    background-color: transparent;
    z-index: 1000;
}

.header--scrolled {
    background-color: var(--color-black) !important;
}

.header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    width: 100%;
    padding: 1.5rem 0;
    align-items: center;
    gap: 2rem;
}

.header__right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2rem;
}

.header__menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.header__logo-img {
    max-height: 1.5rem;
    width: auto;
}

.header__nav-item, 
.footer__nav-item {
    text-decoration: none;
    color: var(--color-white);
    position: relative;
    padding-bottom: 0.125rem; 
}

.header__nav-item::after,
.footer__nav-item::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: var(--color-white);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 250ms ease;
    will-change: transform;
}

.header__nav-item:hover::after,
.header__nav-item:focus::after, 
.footer__nav-item:hover::after,
.footer__nav-item:focus::after {
    transform: scaleX(1);
}

.header__button {
    padding: 0.5rem 1.75rem;
    color: var(--color-white);
    border: 1px solid var(--color-white);
    border-radius: 4rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: fit-content;
}

.header__button:hover {
    background: var(--color-white);
    color: var(--color-black);
    transition: background 250ms ease, color 250ms ease;
}

.header__menu-toggle {
    width: 44px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    display: none;
}

.header__menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-white);
    border-radius: 2px;
    transform-origin: center;
    transition: transform 250ms cubic-bezier(.4,0,.2,1), opacity 200ms ease, background 200ms ease;
    will-change: transform, opacity;
}

.header__menu-toggle--open span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.header__menu-toggle--open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.header__menu-toggle--open span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}


/* === Language switch === */

.language-switcher {
  position: relative;
  width: 60px;
  cursor: pointer;
  user-select: none;
}

.language-switcher__selected {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.4em;
  background: transparent;
  border: none;
}

.language-switcher__arrow {
  transition: transform 0.2s ease;
  color: var(--color-white);
}

.language-switcher--open .language-switcher__arrow {
  transform: rotate(-90deg);
}

.language-switcher__flag {
  width: 30px;
  height: 20px;
  border-radius: 2px;
  object-fit: cover;
  margin-left: 0.75rem;
}

.language-switcher__options {
  position: absolute;
  top: 110%;
  left: 0;
  background: var(--color-black);
  border-radius: 6px;
  display: none;
  flex-direction: column;
  width: 100%;
  z-index: 100;
}

.language-switcher--open .language-switcher__options {
  display: flex;
}

.language-switcher__option {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.4em;
  transition: background 0.2s;
}

.language-switcher__option:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* === Hero === */

.hero {
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    background-position: center;
    background-size: cover;
    display: grid;
    place-content: stretch;
    position: relative;
    background-image: url('../images/bmw-x3.webp');
    background-position: right center;
    background-size: cover;
    background-repeat: no-repeat;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 0;
    pointer-events: none;
}

.hero__inner {
    position: relative;
    z-index: 1;
}


.hero__inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    color: var(--color-white);
    padding-top: 6rem;
    padding-bottom: 4rem;
}

.hero__title {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    margin-bottom: 1rem;
    max-width: 780px;
}

.hero__text {
    max-width: 600px;
    color: var(--color-theme-dark-gray);
}

.hero__arrow-down {
    opacity: 0.7;
    transition: opacity 250ms ease;
}

.hero__arrow-down:hover {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .hero__video {
        display: none;
    }

    .hero__video-wrapper {
        background: url('../images/hero-fallback.jpg') center center/cover no-repeat;
    }
}

/* === Brands === */

.brands__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    position: relative;
    max-width: 1124px;
    margin: 0 auto;
    padding: 6rem 0 2rem 0;
}

.brands__inner img {
    max-height: 48px;
    max-width: 48px;
    width: auto;
}

/* === About === */

.about__inner {
    display: grid; 
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
    padding: 4rem 0;
}

.about__right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about__left img {
    border-radius: 0.5rem;
}

.about__text {
    max-width: 600px;
    color: var(--color-text);
}

/* === Services === */

.services__inner {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    padding: 6rem 0;
}

.services__cards {
    display: flex;
    gap: 2.5rem;
}

.services__card {
    display: grid;
    gap: 0.25rem;
}

.services__cards i {
    font-size: 2rem;
    color: var(--color-theme-red);
    margin-bottom: 1.25rem;
}

.services__card-text {
    color: var(--color-text);
}

/* === Benefits === */

.benefits__inner {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    padding: 4rem 0;
    align-items: center;
    justify-content: center;
}

.benefits__title {
    max-width: 400px;
    text-align: center;
}

.benefits__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 2rem;
  grid-template-areas:
    "one two three"
    "four two three"
    "four two five";
}

.benefits__grid > :nth-child(1) { grid-area: one; }
.benefits__grid > :nth-child(2) { grid-area: two; }
.benefits__grid > :nth-child(3) { grid-area: three; }
.benefits__grid > :nth-child(4) { grid-area: four; }
.benefits__grid > :nth-child(5) { grid-area: five; }

.benefits__item {
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
}

.benefits__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.center-block {
  background: var(--color-black);
  color: var(--color-white);
  background-image: url('../images/benefits/benefits-rpm.jpg');
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
}

.center-block img {
  width: 100%;
  height: auto;
  display: block;
}

.text-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: var(--color-theme-gray);
  gap: 1rem;
}

.image-block {
  padding: 0;
  border-radius: 0.5rem;
  overflow: hidden;
}


@media (max-width: 992px) {
  .benefits__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, auto);
    grid-template-areas:
      "one two"
      "three two"
      "five four";
  }
}

@media (max-width: 767px) {
  .benefits__grid {
    gap: 1.5rem;
  }
}

@media (max-width: 600px) {
  .benefits__grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, auto);
    grid-template-areas:
      "one"
      "three"
      "two"
      "four"
      "five";
  }

  .benefits__item:nth-child(2) {
    min-height: 600px;
  }
}

/* === Slider === */

.heading-slider {
  overflow: hidden;
  padding: 4rem 0;
  white-space: nowrap;
  color: var(--color-theme-dark-gray);
}

.heading-slider__inner {
  position: relative;
  width: 100%;
}

.heading-slider__track {
  display: inline-flex;
  gap: 6rem;
  animation: scroll 20s linear infinite;
}

.heading-slider__item {
  font-size: clamp(4rem, 5vw, 6rem);
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

@keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* === Contact === */

.contact__inner {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 6rem;
    padding: 4rem 0 6rem 0;
}

.contact__left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact__top {
    display: grid;
    gap: 1rem;
}

.contact__item {
    display: grid;
    gap: 0.25rem;
}

.contact__link {
    color: var(--color-black);
    font-size: 1.5rem;
}

.contact-form__button {
    background: var(--color-black);
}

.contact__text {
    color: var(--color-text);
}



/* === Contact Form === */

.contact-form {
  max-width: 800px;
  margin-left: auto;
}

.contact-form__group {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.contact-form__field {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.contact-form__field--half {
  flex: 1 1 48%;
  min-width: 260px;
}

.contact-form__label {
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.contact-form__required {
  color: var(--color-theme-red);
}

.contact-form__input,
.contact-form__textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--color-theme-darker-gray);
  border-radius: 0.4rem;
  background-color: var(--color-white);
  transition: border-color 0.2s ease;
}

.contact-form__input::placeholder,
.contact-form__textarea::placeholder {
  color: var(--color-theme-darker-gray);
}

.contact-form__input:focus,
.contact-form__textarea:focus {
  border-color: #000;
  outline: none;
}

.contact-form__textarea {
  resize: vertical;
  min-height: 160px;
}

.contact-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}


.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}   

/* === Footer === */

.footer {
    background-color: var(--color-black);
    color: var(--color-white);
    position: relative;
    }

.footer__title {
    display: block;
    margin-bottom: 1rem;
}

.footer__logo-img {
    max-height: 1.5rem;
    width: auto;
}

.footer__inner {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 4rem;
    position: relative; 
    overflow: hidden;
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.footer__social {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 1.5rem;
    margin-top: 2.5rem;
}

.footer__social a {
    color: var(--color-theme-dark-gray);
    text-decoration: none;
    transition: color 250ms ease;
}

.footer__social a:hover {
    color: var(--color-white);
}

.scroll-to-top-button {
    background: none;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-size: 1.5rem;
    border: 1px solid var(--color-theme-dark-gray);
    transition: border-color 250ms ease;
}

.scroll-to-top-button i {
    transition: transform 250ms ease;
} 

.scroll-to-top-button:hover {
    border-color: var(--color-white);
}

.scroll-to-top-button:hover i {
    transform: translateY(-2px);
}

.footer__nav {
    display: grid;
    gap: 0.5rem;
}

.footer__nav-item {
        color: var(--color-theme-dark-gray);

}

.footer__column:nth-child(2) {
    align-items: center;
    justify-content: center;
}

.footer__text {
    max-width: 300px;
    color: var(--color-theme-dark-gray);

}
.footer__column {
    position: relative;
    z-index: 1;
}

.footer__bg {
    position: absolute;
    top: -4rem;
    left: 0;
    width: auto;
}

/* === Copyright === */

.copyright {
    background-color: var(--color-black);
    color: var(--color-white);
    border-top: 1px solid #575a5f;
    padding-top: 1rem;
    padding-bottom: 1rem;
    font-size: 1rem;
    color: var(--color-theme-darker-gray);
}




@media screen and (max-width: 1124px) {
    .header__inner {
        display: flex;
        justify-content: space-between;
    }

    .header__menu-toggle {
        display: flex;
    }

    .header__nav {
        display: flex;
        flex-direction: column;
        background-color: var(--color-theme-red);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 2rem 1rem;
        gap: 2rem;
        transform: translateY(-160%);
        opacity: 0;
        transition: transform 250ms ease-in-out;
        z-index: -1;

    }

    .header__menu {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header__nav--open {
        opacity: 1;
        transform: translateY(0);
    }

    .hero__right {
        display: none;
    }

}

@media screen and (max-width: 992px) {

    .services__cards {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .about__inner {
        grid-template-columns: 1fr;
    }

    .contact__inner {
        gap: 2.5rem;
    }

    .footer__inner {
        grid-template-columns: repeat(2, auto);
    }

    .footer__column:last-child {
        display: flex;
        align-items: flex-end;
        justify-content: flex-end;
    }

    .footer__bg {
        display: none; 
    }

    .hero {
        background-position: left center;
    }
}

@media screen and (max-width: 767px) { 

    .header__right {
        gap: 1rem;
    }

    .contact__inner {
        grid-template-columns: 1fr;
    }

    .brands__inner {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        justify-items: center;
    }
}


@media screen and (max-width: 600px) {
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none;
    }

    .contact-form__group {
        flex-direction: column;
    }

    .contact-form__field--half {
        flex: 1 1 100%;
    }

    .language-switcher__arrow {
        font-size: 16px;
    }

    .footer__inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .services__cards {
        grid-template-columns: 1fr;
    }

    .header__inner {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .hero__inner {
        flex-direction: column;
        justify-content: center;
    }
}