*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    color: white;
    background-color: #29373a;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0px 1000px #ECE9D8 inset !important;
    box-shadow: 0 0 0px 1000px #ECE9D8 inset !important;
    background-color: #ECE9D8 !important;
    color: black !important;
}

main {
    flex: 1;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

.link {
    text-decoration: underline;
}

.invalid-domain {
    border: 3px solid red !important;
}

.error-message {
    display: none;
    color: rgb(255, 0, 0);
    font-weight: bold;
    width: 300px;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
}

.required {
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    color: white;
}

.toggle-password {
    position: absolute;
    right: 0px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.skip {
  position: absolute;
  left: -10000px;
  background-color: #1E1E1E;
  color: #ECE9D8;
  top: auto;
  padding: 0.5rem 1rem;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 9999;
}

.skip:focus {
  left: 20%;
  width: auto;
  height: auto;
}

/* Nav styling */
nav {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    position: relative;
    top: 0px;
}

.nav-links {
    margin: 0;
    padding: 20px 0;
    list-style-type: none;
    display: flex;
    font-weight: 500;
    align-items: center;
    gap: 30px;
    transition: max-height 0.5s ease;
}

.login img {
    width: 25px;
}

.logo {
    position: absolute;
    left: 40px;
    text-transform: uppercase;
    font-family: "Lexend Mega", sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #ECE9D8;
}

.logo:visited {
    color: #ECE9D8;
}

.slide_right {
    color: white;
    text-decoration: none;
}

nav a {
    text-decoration: none;
    color: #fff;
    letter-spacing: 0.5px;
}

nav a:visited {
    text-decoration: none;
    color: #fff;
}

nav a:is(:link, :active, :visited).active {
    font-weight: bold;
    border-bottom: 2px solid #fff;
}

.searchBtn {
    cursor: pointer;
    color: #ECE9D8;
}

.searchBtnSub {
    background-color: transparent;
    padding: 0;
    margin: 0;
    border: none;
}

form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.searchBar {
    border: none;
    box-shadow: none;
    padding: 5px 0px;
    width: 0;
    transition: width 0.5s;
}

.searchBar:focus {
    width: 200px;
    padding-left: 10px;
}

.navRight {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 30px;
    align-items: center;
}


/* Header styling */
header {
    /* background: linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.4990589985994398) 27%, rgba(0, 0, 0, 0) 37%, rgba(0, 0, 0, 0) 100%), url(../img/header.webp); */
    background-color: #29373a;
    height: 100vh;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    position: relative;
}

header h1 {
    font-family: 'Lexend Mega', sans-serif;
    font-size: 3.5rem;
    margin-left: 40px;
    margin-top: 3%;
    display: flex;
    flex-direction: column;
    text-transform: uppercase;
}

header p {
    margin-left: 40px;
    width: 40%;
    font-size: 1.3rem;
    z-index: 10;
}

.highlight-container,
.highlight {
    position: relative;
}

.highlight-container {
    display: inline-block;
    color: #ECE9D8;
}

.highlight-container:before {
    content: " ";
    display: block;
    height: 100%;
    width: 100%;
    position: absolute;
    background: rgba(78, 95, 103, 0.7);
    transform: rotate(2deg);
    top: -1px;
    left: -1px;
    border-radius: 20% 25% 20% 24%;
    padding: 10px 3px 3px 10px;
}

.car-header {
    position: absolute;
    width: 47%;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 10;
}

header .discover {
    display: block;
    width: fit-content;
    padding: 20px 40px;
    color: white;
    position: relative;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 2px;
    cursor: pointer;
    margin: 4rem 0 0 40px;
    text-decoration: none;
}

header .discover::after,
header .discover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    border: 2px solid #fff;
    transition: transform 0.2s;
}

header .discover::after {
    transform: translate(3px, 3px);
}

header .discover::before {
    transform: translate(-3px, -3px);
}

header .discover:hover::after,
header .discover:hover::before {
    transform: translate(0);
}


@keyframes slide {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}

.logos {
    overflow: hidden;
    padding: 30px 0;
    white-space: nowrap;
    position: absolute;
    bottom: 0;
    left: 0;
    transition: all 0.5s ease;
}

.logos-slide {
    display: inline-block;
    animation: 25s slide infinite linear;
    opacity: 0.5;
    transition: all 0.5s ease;
}

.logos:hover .logos-slide {
    animation-play-state: paused;
    opacity: 1;
}

.logos-slide img {
    height: 100px;
    margin: 0 50px;
    transition: all 0.5s ease;
}

.logos-slide img:hover {
    transform: scale(1.1);
}

/* About styling */
.about {
    display: flex;
    align-items: stretch;
    /* height: 470px; */
    height: fit-content;
    padding: 0;
    margin: 5rem 3rem 0 3rem;
    gap: 20px;
}

.about img {
    width: 50%;
    height: fit-content;
    object-fit: contain;
    border-radius: 17px;
}

.about-details {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: flex-start;
    background: #1E1E1E;
    color: #ECE9D8;
    border-radius: 17px;
    /* height: 100%; */
    padding: 1rem 2rem;
    line-height: 1.8;
}

.about-details h2 {
    font-family: "Lexend Mega", sans-serif;
    font-size: 2rem;
    margin: 0;
}

.about-details h2 span {
    color: #ECE9D8;
}

.about-details p {
    font-size: 1.2rem;
    margin: 0;
    width: 80%;
}

.slide-right {
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #ECE9D8;
    box-shadow: inset 0 0 0 0 #ECE9D8;
    color: #ECE9D8;
    text-align: center;
    font-size: 1.2rem;
    padding: 5px 16px;
    width: 220px;
    cursor: pointer;
    -webkit-transition: ease-out 0.5s;
    -moz-transition: ease-out 0.5s;
    transition: ease-out 0.5s;
    display: inline-block;
    position: relative;
    text-decoration: none;
}

.slide-right::after {
    content: '+ ';
    position: absolute;
    opacity: 0;
    top: 50%;
    transform: translateY(-50%);
    right: -20px;
    transition: 0.5s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 0px;
    width: 0px;
    background-color: #1E1E1E;
    color: #ECE9D8;
    border-radius: 50%;
}

.slide-right:hover {
    box-shadow: inset 400px 0 0 0 #ECE9D8;
    color: #1E1E1E;
    padding-right: 24px;
    padding-left: 0;
}

.slide-right:hover::after {
    opacity: 1;
    right: 10px;
    height: 25px;
    width: 25px;
}

/* New cars styling */
.new-items {
    margin: 5rem 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0 3%;
    height: 95vh;
}

.new-items h2 {
    font-family: "Krona One", sans-serif;
    font-size: 5rem;
    margin: 0;
    padding: 0;
}

.new-car-row1 {
    display: flex;
    align-items: center;
    gap: 30px;
    justify-content: space-between;
    position: relative;
    width: 100%;
    color: #ECE9D8;
}

.new-title h2 {
    font-size: 2.5rem;
}

.title-line1 {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 30px;
}

.line {
    flex-grow: 1;
    border-bottom: 3px solid #ECE9D8;
    margin: 0 50px;
}

.car-name {
    white-space: nowrap;
}

.new-cars-slider {
    width: 100%;
    position: relative;
}

.new-car {
    display: flex;
    /* flex-wrap: wrap; */
    align-items: center;
    justify-content: flex-start;
    gap: 50px;
    margin: 0 70px;
}

.new-car-img {
    width: 65%;
    object-fit: contain;
    border-radius: 50px;
    overflow: hidden;
}

.new-car-specs {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    font-size: 1.8rem;
}

.new-car-specs .product__power p:last-of-type,
.new-car-specs .product__seats p:last-of-type,
.new-car-specs .product__fuel p:last-of-type,
.new-car-specs .product__price p:last-of-type {
    font-family: "Krona One", sans-serif;
    margin: 0;
}

.new-car-specs .product__power p:first-of-type,
.new-car-specs .product__seats p:first-of-type,
.new-car-specs .product__fuel p:first-of-type,
.new-car-specs .product__price p:first-of-type {
    font-family: "Athiti", sans-serif;
    margin: 0;
}

.new-cars-arrow-left,
.new-cars-arrow-right {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.new-cars-arrow-left {
    position: absolute;
    left: 0;
    top: 50%;
    font-size: 1.5rem;
    border: 2px solid white;
    overflow: hidden;
    transform: translateY(-50%);
}

.new-cars-arrow-right {
    position: absolute;
    right: 0;
    top: 50%;
    font-size: 1.5rem;
    border: 2px solid white;
    overflow: hidden;
    transform: translateY(-50%);
}

.iconoir-nav-arrow-right:first-of-type {
    margin-right: -15px;
}

.iconoir-nav-arrow-left:first-of-type {
    margin-right: -15px;
}

.iconoir-nav-arrow-left {
    color: white;
}

.new-car-row2 {
    display: flex;
    align-items: center;
    gap: 30px;
    justify-content: space-between;
    position: relative;
    width: 100%;
    color: #ECE9D8;
}

.title-line2 {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 30px;
    transform: rotate(180deg);
    opacity: 12%;
}

.new-car-product-link {
    border: 3px solid white;
    padding: 1rem 2rem;
    transition: 0.3s ease-in-out;
    box-shadow: inset 0 0 0 0 #fff;
    cursor: pointer;
}

.new-car-product-link {
    text-decoration: none;
    color: white;
    text-transform: uppercase;
    font-size: 1.2rem;
    transition: 0.3s ease-in-out;
    font-weight: 500;
}

.new-car-product-link:hover {
    box-shadow: inset 500px 0 0 0 #fff;
}

.new-car-product-link:hover {
    color: black;
}


@keyframes bounceBtnRight {
    0% {
        opacity: 1;
        transform: translateX(0px) scale(1);
    }

    25% {
        opacity: 0;
        transform: translateX(10px) scale(0.9);
    }

    26% {
        opacity: 0;
        transform: translateX(-10px) scale(0.9);
    }

    55% {
        opacity: 1;
        transform: translateX(0px) scale(1);
    }
}

.iconoir-nav-arrow-right:first-of-type.bounceBtnRight,
.new-cars-arrow-right:hover .iconoir-nav-arrow-right,
.new-cars-arrow-right:hover .iconoir-nav-arrow-right:first-of-type {
    animation: bounceBtnRight 1.4s infinite linear;
}

.iconoir-nav-arrow-right:first-of-type.bounceBtnRight,
.new-cars-arrow-right:hover .iconoir-nav-arrow-right:first-of-type {
    animation-delay: 0.2s;
}

@keyframes bounceBtnLeft {
    0% {
        opacity: 1;
        transform: translateX(0px) scale(1);
    }

    25% {
        opacity: 0;
        transform: translateX(-10px) scale(0.9);
    }

    26% {
        opacity: 0;
        transform: translateX(10px) scale(0.9);
    }

    55% {
        opacity: 1;
        transform: translateX(0px) scale(1);
    }
}

.iconoir-nav-arrow-left:first-of-type.bounceBtnLeft,
.new-cars-arrow-left:hover .iconoir-nav-arrow-left,
.new-cars-arrow-left:hover .iconoir-nav-arrow-left:first-of-type {
    animation: bounceBtnLeft 1.4s infinite linear;
}

.iconoir-nav-arrow-left:first-of-type.bounceBtnLeft,
.new-cars-arrow-left:hover .iconoir-nav-arrow-left:first-of-type {
    animation-delay: 0.2s;
}

.image-fade {
    animation: imgFade 0.8s ease-in-out;
}

@keyframes imgFade {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-in-out;
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-in-out;
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Footer styling */
footer {
    background-color: #1E1E1E;
    padding: 1rem 0 0.5rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

footer .highlight-container {
    font-size: 3.5rem;
    font-family: 'Lexend Mega', sans-serif;
    text-transform: uppercase;
    font-weight: bold;
}

.footer-links {
    text-align: center;
}

.footer-links h3 {
    font-family: 'Krona One', sans-serif;
    margin-bottom: 1rem;
}

.footer-links ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links ul li a {
    text-decoration: none;
    color: white;
    position: relative;
}

.footer-links ul li a::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    border-radius: 4px;
    background-color: white;
    bottom: 0;
    left: 0;
    transform-origin: right;
    transform: scaleX(0);
    transition: transform .4s ease-in-out;
}

.footer-links ul li a:hover::before {
    transform-origin: left;
    transform: scaleX(1);
}

.footer-links p {
    margin-top: 2rem;
    font-size: 0.8rem;
}

.footer-social {
    text-align: center;
}

.footer-social ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

.footer-social img {
    width: 50px;
    color: white;
    transition: transform .1s;
}

.footer-social img:hover {
    transform: scale(1.05);
}


/* Media queries */
@media (width < 1200px) {
    header h1 {
        font-size: 2rem;
    }

    .about {
        margin: 5rem 1rem 0 1rem;
    }

    .about-details h2 {
        font-size: 1.3rem;
    }

    .about-details p {
        width: 100%;
        font-size: 1rem;
        line-height: 1.25;
    }

    .about-details .slide-right {
        width: 50%;
        max-width: 220px;
        padding: auto;
    }

    .new-items h2,
    .new-title h2 {
        font-size: 2rem;
    }

    .line {
        margin: 0 20px;
    }

    .new-car-specs {
        font-size: 1.5rem;
    }

    .new-car {
        flex-direction: column;
        gap: 20px;
    }

    .new-car-img {
        width: 90%;
    }

    .new-car-specs {
        flex-direction: row;
        gap: 50px;
    }
}

@media (width < 1100px) {
    .new-car-product-link {
        padding: 1rem;
    }

    footer .highlight-container {
        font-size: 2.5rem;
    }

    footer .footer-links ul li a {
        font-size: 0.8rem;
    }

    footer .footer-social img {
        width: 40px;
    }

    footer .footer-links p {
        font-size: 0.7rem;
    }
}