/* ---- GENERAL STYLES --- */

:root {
/* estados base */
    --arrow-off: grayscale(1) brightness(0.65);
    --arrow-on: brightness(0) saturate(100%) invert(49%) sepia(80%) 
        saturate(466%) hue-rotate(170deg) brightness(92%) contrast(91%); 
}

html, body {
    overflow-x: hidden;
}

body {
    margin: 0;
    background-color: var(--ym-primary-50);
}

/* ---- HEADER --- */

header {
    background: linear-gradient(to bottom, rgb(0, 0, 0, 0.7) 0%, rgb(0, 0, 0, 0) 100%);
    border-bottom: none;
    
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

h1 {
    color: var(--ym-primary-50);
}

#header-buttons a:nth-child(-n+3) {
    color: var(--ym-primary-50);
}

#header-buttons a:nth-child(-n+3):hover {
    color: var(--ym-primary-200);
}

/* ---- MAIN --- */

main {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 64px;
    box-sizing: border-box;
}

/* ---- HERO SECTION --- */

.hero {
    width: 100vw;
    height: 100vh;
    background-image: url(../../imagenes/backgrounds/four_teslas.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero__content {
    width: 100vw;
    max-width: 1400px;

    display: flex;
    flex-direction: column;
    gap: 16px;

    padding-left: 64px;
    text-align: left;
}

.hero__content h2{
    color: var(--ym-primary-50);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    font-size: 3.5em;
    margin: 0;
    padding: 0;
}

.btn-catalogo-hero {
    text-decoration: none;
    color: #FFF;
    background-color: var(--ym-primary);
    padding: 16px 48px;
    border-radius: 50px;
    font-size: 1.5em;
    font-weight: 600;
    width: fit-content;

    transition: background-color 0.3s ease;
}

.btn-catalogo-hero:hover {
    background-color: var(--ym-primary-600);
}

.hero__arrows {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero__arrows img{
    width: 64px;
    will-change: filter;
    opacity: 0.8;
    user-select: none;
}

.hero__arrows img:nth-child(1){
    animation: seqTop 2s infinite steps(1, end);
}

.hero__arrows img:nth-child(2){
    animation: seqBottom 2s infinite steps(1, end);
}

@keyframes seqTop{
    0%, 16.6%   { filter: var(--arrow-on); }   /* prende arriba */
    16.7%, 100% { filter: var(--arrow-off); }  /* apagada resto del tiempo */
}

@keyframes seqBottom{
    0%, 8.3%    { filter: var(--arrow-off); }  /* espera mientras prende la de arriba */
    8.4%, 25%   { filter: var(--arrow-on); }   /* prende abajo */
    25.1%, 100% { filter: var(--arrow-off); }  /* apagada hasta volver a empezar */
}

@media (max-width: 700px) {
    .hero__content h2{
        font-size: 2.25em;
    }

    .btn-catalogo-hero {
        padding: 8px 32px;
        font-size: 1.5em;
    }


    .hero__arrows img{
        width: 48px;
    }
}

/* ---- GLOBAL CONTAINER --- */
.global-container {
    width: 100%;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 64px;
    box-sizing: border-box;
}

section {
    width: 85%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    box-sizing: border-box;
    padding: 0 16px;
}

h3 {
    width: 100%;
    margin: 0;
    padding: 0;
    font-weight: 500;
    font-size: 1.75rem;
    color: var(--ym-primary-900);
    justify-self: start; 
    align-self: flex-start;
}

/* ---- BEST SELLER SECTION --- */
.best-seller {
    width: 100%;
    max-width: 1200px;
    align-items: start;
}

.best-seller__content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.best-seller__list {
    display: flex;
    transition: transform 0.4s ease;
    gap: 16px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.card-best-seller {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-best-seller img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    aspect-ratio: 2.35/1;
}

.card-best-seller__body {
    display: flex;
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
}

.card-best-seller__body h4 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 500;
}

.card-best-seller__body p {
    margin: 0;
    color: var(--ym--gray-700);
}

.card-best-seller__body a {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ym-primary);
    text-decoration: none;
}

.card-best-seller__body a:hover {
    color: var(--ym-primary-600);
    text-decoration: underline;
}

@media (max-width: 700px) {
    /* TODO */
}

/* ---- BRAND SECTION --- */
.brands {
    max-width: 1200px;
}

.list-brands {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 32px 64px;
    box-sizing: border-box;
}

.brand-image-container {
    background-color: var(--ym-primary-50);
    border-radius: 12px;
    border: 1px solid var(--ym-primary-100);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 0;
}

.brand-image-container:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.brand-image-container img {
    width: 50%;
    border-radius: 8px;
    object-fit: contain;
    aspect-ratio: 1/1;
}

.brand-name {
    margin-top: 8px;
    text-align: center;
    font-weight: 400;
    font-size: 1rem;
    color: var(--ym-primary-900);
}

@media (max-width: 700px) {
    .list-brands {
        grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
        gap: 16px 32px;
    }
}

/* ---- SEGMENTO SECTION --- */
.types {
    max-width: 1200px;
}

.list-types {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 32px 64px;
    box-sizing: border-box;
}

.type-image-container {
    background-color: var(--ym-primary-50);
    border-radius: 12px;
    border: 1px solid var(--ym-primary-100);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 0;
}

.type-image-container:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.type-image-container img {
    width: 50%;
    border-radius: 8px;
    object-fit: contain;
    aspect-ratio: 4/3;
}

.type-name {
    margin-top: 8px;
    text-align: center;
    font-weight: 400;
    font-size: 1rem;
    color: var(--ym-primary-900);
}

@media (max-width: 700px) {
    .list-types {
        grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
        gap: 16px 32px;
    }
}

/* ---- TESTIMONIOS SECTION --- */
.testimonio {
    max-width: 1200px;
    display: none;
    gap: 24px;
    align-items: center;
    animation: fade 0.5s ease-in-out;
}

.testimonio.active {
    display: flex;
}

.testimonios__content {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: auto;
    overflow: hidden;
}

.testimonios__content img {
    width: 256px;
    object-fit: cover;
    aspect-ratio: 1/1;
    border-radius: 8px;
}

.testimonio__text {
    height: 100%;
    background-color: var(--ym-primary-50);
    border-left: 4px solid var(--ym-primary-400);
    padding: 16px 24px;
    font-style: italic;
    color: var(--ym-gray-800);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    flex: 1;
}

.testimonio__about {
    width: 100%;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
    font-style: normal;
}

.testimonio__comment p {
    text-align: justify;
}

.testimonio__about h4 {
    margin: 0;
    color: var(--ym-primary);
}

.testimonio__about p {
    margin: 0;
    color: var(--ym-gray-400);
    font-size: 0.875rem;
}

.testimonios__controls {
    text-align: center;
    margin-top: 12px;
}

.testimonios__controls button {
    border: none;
    background: var(--ym-primary-400);
    color: white;
    font-size: 1.125rem;
    padding: 6px 10px;
    margin: 0 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
}

.testimonios__controls button:hover {
    background: var(--ym-primary-600);
}

@keyframes fade {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@media (max-width: 700px) {
    .testimonio.active {
        flex-direction: column;
    }
    .testimonios__content img {
        width: 200px;
        border-radius: 16px;
    }
}

/* ---- NEWSLETTER SECTION --- */
.newsletter {
    margin: 0;
    width: 100%;
    position: relative;
    background: url("../../imagenes/backgrounds/tesla_roadster_front.jpg") center/cover no-repeat;
    background-attachment: fixed;
    padding: 0;
    color: white;
}

.newsletter__overlay {
    background-color: rgba(0,0,0,0.75);
    width: 100%;
    padding: 50px 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.newsletter__content {
    width: 100%;
    max-width: 1200px;
    padding: 0 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.newsletter__text h4 {
    margin: 0;
    font-size: 1.5rem;
    text-transform: uppercase;
    font-weight: 900;
    color: var(--ym-primary-400);
}

.newsletter__text p {
    margin: 8px 0 0;
    font-size: 1rem;
    color: var(--ym-primary-100);
}

.newsletter__form {
    display: flex;
    gap: 0;
}

.newsletter__form input {
    padding: 10px 16px;
    border: none;
    border-radius: 4px 0 0 4px;
    width: 250px;
    outline: none;
}

.newsletter__form button {
    background: var(--ym-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.newsletter__form button:hover {
    background: var(--ym-primary-600);
}