:root {

    /* ===== COLORES PRINCIPALES ===== */

    --color-primary: #4f6df5;
    --color-primary-hover: #3f5ce0;

    --color-secondary: #7c63e6;
    --color-secondary-hover: #6b53d1;

    --color-accent: #d35c9c;

    --color-dark: #2a2f3a;
    --color-muted: #6f7685;

    --color-white: #ffffff;
    --color-light: #f6f7fb;

    --color-border: #e7e9f1;


    /* ===== HERO GRADIENT ===== */

    --hero-gradient: linear-gradient(135deg,
            #6c7af7,
            #7c63e6,
            #d35c9c);

    --gradient-primary: linear-gradient(90deg,
            #4f6df5,
            #7c63e6);


    /* ===== TIPOGRAFÍA ===== */

    --font-main: "Segoe UI", system-ui, -apple-system, sans-serif;

    --font-size-base: 1rem;
    --font-size-small: 0.875rem;

    --font-size-h1: clamp(2rem, 6vw, 3rem);
    --font-size-h2: clamp(1.5rem, 4vw, 2rem);
    --font-size-h3: 1.25rem;


    /* ===== ESPACIADO ===== */

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 3rem;
    --space-xl: 5rem;

    --container-padding: 5%;


    /* ===== BORDES ===== */

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 20px;
    --radius-full: 999px;


    /* ===== SOMBRAS ===== */

    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);


    /* ===== TRANSICIONES ===== */

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;

}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--color-dark);
}

img {
    max-width: 100%;
    display: block;

}

/*/////---HEADER---/////*/
.header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 5%;
    background-color: var(--color-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: 1rem;
}

/*/////---NAVBAR---/////*/
.navbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
    /*Ocupa todo el espacio libre del contenedor*/
    gap: 1rem;
    color: var(--color-white);
}

/*/////--LOGO---/////*/
.logo {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.logo img {
    width: auto;
    height: 50px;
}

/*/////---ICONOS DE USUARIO---/////*/
.user-actions {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.user-actions a {
    padding: 0.5rem;
    display: inline-flex;
}

.user-actions img {
    width: 24px;
    height: 24px;
}

.user-actions a[href="#search"],
.user-actions a[href="login.html"] {
    /*Están ocultos en móvil */
    display: none;
}

/*/////---BOTON DE HAMBURGUESA---/////*/
.nav-toggle {
    background: none;
    border: none;
    font-size: 2.2rem;
    cursor: pointer;
    padding: 0.5rem 0.8rem;
}

/*/////---MENU---/////*/
.nav-list {
    display: none;
    /*Oculto en movil*/
    width: 100%;
    list-style: none;
    flex-basis: 100%;
    /* Hace que el menú baje a la siguiente línea */
}

.nav-list a {
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    color: var(--color-dark);
}

/*/////---HOVER LINKS---/////*/
.nav-list a:hover {
    color: var(--color-primary-hover);
}

/*/////---MENU ABIERTO---/////*/
.nav-list.active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem 0;
    text-align: center;
}

/*/////---HERO---/////*/
.hero {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 4rem 5%;
    min-height: 60vh;
    background: var(--hero-gradient);
    color: var(--white);
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    color: var(--color-white);
    max-width: 500px;
}

.ofert-badge {
    display: inline-block;
    width: fit-content;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);

}

.hero h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
}

.highlight {
    color: #5497e8;

}

.hero p {
    color: var(--light-light);
    font-size: var(--font-size-base);
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.button-primary {
    display: inline-block;
    padding: 0.9rem 1.6rem;
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.25s ease;
}

.button-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.button-secondary {
    display: inline-block;
    padding: 0.9rem 1.6rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    text-align: center;
}

.hero-img img {
    border-radius: 20px;
}

/*////---PRODUCTOS DESTACADOS---/////*/
.products {
    padding: var(--space-xl) var(--container-padding);
    background: var(--color-light);

}

.section-title {
    text-align: center;
    margin-bottom: var(--space-xl);
    color: #7404d0;


}

.section-title h2 {
    font-size: 2.5rem;
    padding: var(--space-md);
    margin-bottom: 1rem;
}


.section-title p {
    color: var(--color-muted);
    font-size: 1.5rem;
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    list-style: none;
    padding: 0;
}

.product-card {
    background: var(--white);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-md);

    overflow: hidden;

    display: flex;

    flex-direction: column;

    transition: var(--transition);
    cursor: pointer;
}

.product-card:hover {

    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.product-card img {

    width: 100%;

    height: 200px;

    object-fit: cover;

}

.product-card a {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: var(--space-md);
    text-decoration: none;
    color: inherit;
}

.product-title {
    font-size: 1.60rem;
    font-weight: 600;
    color: rgb(13, 63, 156);
    margin-bottom: 0.3rem;


}

.price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-secondary);
    margin-top: 0.3rem;
    letter-spacing: 0.5px;
}

.stock {

    font-size: 1rem;

    color: var(--color-muted);
    margin-top: 0.5rem;
}

.btn-add-cart {

    margin: var(--space-sm);

    padding: 0.8rem;

    border: none;

    border-radius: var(--radius-md);

    background: linear-gradient(90deg,
            #3b82f6,
            #9333ea);

    color: white;

    font-weight: 600;

    cursor: pointer;

    transition: var(--transition);

}

.btn-add-cart:hover {

    transform: translateY(-2px);
    /*Se desliza un poco al pasar el ratón*/
}

.products-link {
    text-align: center;
    margin: 2rem;
}

/*////---NEWSLETTER---/////*/



.newsletter {
    padding: var(--space-xl) var(--container-padding);
    text-align: center;
    background: var(--hero-gradient);
    color: white;
}

.newsletter header {
    max-width: 500px;
    margin: auto;
    margin-bottom: var(--space-md);
}

.newsletter h2 {
    font-size: var(--font-size-h2);
    margin-bottom: 0.5rem;
}

.newsletter p {
    color: #e5e7eb;
    font-size: 0.95rem;
}

.newsletter form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    margin: auto;
    margin-top: var(--space-md);
}

.newsletter input {

    padding: 0.9rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background: #e5e7eb;

}

.newsletter .button-primary {

    background: linear-gradient(90deg,
            #3b82f6,
            #9333ea);

    border: none;
    border-radius: var(--radius-md);
    padding: 0.9rem;
    font-weight: 600;
    cursor: pointer;

}

/*////---FOOTER---/////*/

.main-footer {
    background: var(--color-light);
    padding: var(--space-md);
}

.main-footer img {
    height: auto;
    width: 40%;

}

.main-footer p {
    padding: var(--space-sm);
}

.footer-container {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-icons {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.social-icons a {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f3f3;
    transition: transform .2s ease, background .2s ease;
}

.social-icons svg {
    width: 28px;
    height: 28px;
    fill: var(--color-secondary);
}

.social-icons a:hover {
    /* Pequeña animacion al pasar el raton por encima */
    transform: scale(1.1);
    background: #e9e9e9;
}

.enlaces-footer li {
    list-style: none;
}

.enlaces-footer a {
    text-decoration: none;
}

.enlaces-footer {
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;


}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}

.contact-item svg {
    width: 20px;
    height: 20px;
    fill: var(--color-secondary);
}

/* ===== TABLET ===== */

@media (min-width: 768px) {
    .nav-toggle {
        display: none;
    }

    .navbar {
        flex-wrap: nowrap;
    }

    .nav-list {
        display: flex;
        flex-direction: row;
        width: auto;
        gap: 2rem;
        margin-left: 2rem;
    }

    .user-actions a[href="#search"],
    .user-actions a[href="login.html"] {
        display: inline-flex;
    }

    /* HERO */
    .hero {
        flex-direction: row;
        align-items: center;
    }

    .hero-content {
        flex: 1;
    }

    .hero-img {
        flex: 1;
    }

    /* BOTONES HERO */
    .hero-buttons {
        flex-direction: row;
    }

    /* GRID PRODUCTOS */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* NEWSLETTER */
    .newsletter form {
        flex-direction: row;
    }

    /*ENLACES */
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

}

/* ===== DESKTOP ===== */

@media (min-width: 1024px) {
    .header {
        flex-wrap: nowrap;
    }

    .nav-list {
        display: flex;
        justify-content: space-evenly;

        gap: 2rem;

    }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .footer-container {
        grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
        align-items: start;
        gap: 2rem;
    }

    .footer-info,
    .social-links,
    .footer-contact {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .enlaces-footer {
        display: flex;
        gap: 2rem;
    }

}