:root {
    --clr-primary: #fc4949;
    --clr-primary-dark: #d93535;
    --clr-text: #4e4e4e;
    --clr-gray: #f8f8f8;

    --ff-base: "Poppins", system-ui, sans-serif;
    --transition: all 0.25s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    font-family: var(--ff-base);
    color: var(--clr-text);
    background: #1e1e1e;
    color: #e1e1e1;
}

.container {
    width: min(92%, 1200px);
    margin-inline: auto;
}

strong {
    color: var(--clr-primary);
}

/*Nav*/
.nav-button {
    display: none;
}

.navbar {
    background: #111;
    position: sticky;
    top: 0;
    text-align: center;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 1rem;
}

.logo {
    cursor: pointer;
    font-size: 2rem;
}

.logo span {
    color: var(--clr-primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

button img {
    width: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--clr-text);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--clr-primary);
}

.navbar p {
    color: var(--clr-text);
}

#btnCarrito {
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

/*Botones*/
.btn {
    cursor: pointer;
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: 1rem;
    background: var(--clr-gray);
    transition: var(--transition);
}

.btn:hover {
    background: var(--clr-primary-dark);
    color: white;
}

.btn-primary {
    background: var(--clr-primary);
    color: white;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--clr-primary-dark);
}

/*Hero*/
.hero {
    background:
        linear-gradient(rgba(26, 25, 25, 0.467)),
        url("../img/hero-laser.jpeg") center/cover fixed;
    padding-block: 6rem;
    text-align: center;
}

.hero-content {
    max-width: 600px;
    margin-inline: auto;
}

.hero h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
}

.hero p {
    margin-bottom: 2rem;
}

/*Select*/
.filtros {
    text-align: center;
    margin-top: 1em;
}

.filtros select {
    background-color: var(--clr-primary);
    border: none;
    border-radius: 1em;
    font-size: 1em;
    color: var(--clr-gray);
    padding: .2em;
    cursor: pointer;
    transition: all 1s ease;
}

.filtros select:hover {
    background-color: var(--clr-primary-dark);
}

.filtros option:checked {
    background-color: var(--clr-primary-dark);
}

/*Section productos*/
.productos {
    padding-block: 4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.card {
    background: #262626;
    flex: 1 1 260px;
    max-width: 260px;
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-6px);
}

.card img {
    aspect-ratio: 3.5 / 3;
    object-fit: cover;
}

.card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-info{
    flex: 1;
}

.btn-product{
    margin-top: auto;
}

.card-title {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.price {
    color: var(--clr-primary-dark);
    margin-bottom: 1rem;
}

/*Carrito*/
.salirCarritoInactivo {
    display: none;
}

.salirCarritoActivo {
    display: block;
}

#salirCarrito {
    position: inherit;
    right: 0;
    margin: 1em;
    color: var(--clr-primary);
    background-color: transparent;
    border: none;
    font-weight: bold;
    font-size: 1em;
}

.Animando {
    animation: zoom 1.5s;
}

.cerrandoCarrito {
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    position: fixed;
    top: 3.5rem;
    right: 11rem;
    background-color: #262626;
    border: 2px solid var(--clr-primary);
    border-radius: 1rem;
    width: 60%;
    max-width: 800px;
    height: 90%;
    padding: 2em;
    text-align: center;
    transform-origin: top right;
    z-index: 9999;
    animation: shrink 0.4s ease forwards;
    
}

.CarritoInactivo {
    display: none;
}

.CarritoActivo {
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    position: fixed;
    top: 3.5rem;
    right: 11rem;
    background-color: #262626;
    border: 2px solid var(--clr-primary);
    border-radius: 1rem;
    width: 60%;
    max-width: 800px;
    height: 90%;
    padding: 2em;
    text-align: center;
    transform-origin: top right;
    z-index: 9999;
    animation: grow 0.4s ease forwards;
}

#productosCarrito {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#carritoTotal {
    border: 2px solid var(--clr-primary);
    border-radius: 0 0 1em 1em;
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    background: #1e1e1e;
    padding: 1em;
    color: var(--clr-text);
}

.cardCarrito {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1e1e1e;
    padding: 1em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.cardCarrito:nth-of-type(2n) {
    background-color: #262626;
    border: 2px solid #1e1e1e;
}

.cardCarrito img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cardCarrito-body {
    flex: 1;
    padding: 0 1em;
    display: flex;
    flex-direction: column;
    gap: 0.3em;
}

.cardCarrito-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.cardCarrito-price {
    font-size: 1rem;
    color: var(--clr-text);
    font-weight: bold;
}

.cardCarrito-actions {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.cantidad {
    display: flex;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
    background: var(--clr-text);
}

.cantidad-btn {
    background: var(--clr-text);
    border: none;
    padding: 0.4em 0.4em;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cantidad-btn:hover {
    background: var(--clr-primary-dark);
}

.cantidad-numero {
    min-width: 30px;
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    cursor: default;
}

.BtnBorrarCarrito,
.btnEliminar {
    background-color: transparent;
    border: none;
    cursor: pointer;
}

.BtnBorrarCarrito img,
.btnEliminar img {
    width: 20px;
    height: auto;
    transition: opacity 0.2s ease-in-out;
}

.icono-abierto {
    display: none;
}

.BtnBorrarCarrito:hover .icono-cerrado,
.btnEliminar:hover .icono-cerrado {
    display: none;
}

.BtnBorrarCarrito:hover .icono-abierto,
.btnEliminar:hover .icono-abierto {
    display: block;
}

#btnPagar {
    cursor: pointer;
    border: none;
    padding: 0.65rem;
    border-radius: 1rem;
    margin-top: .5em;
    background: var(--clr-primary);
    transition: var(--transition);
}

#btnPagar:hover {
    background-color: var(--clr-primary-dark);
}

#pedidoMsg {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 1rem;
    font-family: inherit;
    margin-top: 0.5rem;
}

#msgAccept {
    background-color: var(--clr-primary);
    margin-bottom: .5em;
    border: none;
    padding: .5em;
    border-radius: .5em;
    cursor: pointer;
    transition: all .5s ease;
}

#msgAccept:hover {
    background-color: var(--clr-primary-dark);
}

.btnEliminar {
    position: absolute;
    top: 1em;
    right: 1em;
    border: solid 2px var(--clr-primary);
    background-color: var(--clr-text);
    padding: .5em;
    border-radius: 50%;
}

/*Section sobre-nosotros*/
.sobre-nosotros {
    background: #262626;
    padding-block: 4rem;
}

.sobre-nosotros h2 {
    margin-bottom: 1rem;
    text-align: center;
}

/*Section contactos*/
.contacto {
    padding-block: 4rem;
}

.contacto-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.contacto-datos {
    list-style: none;
    margin-top: 1rem;
}

.form label {
    display: block;
    margin-bottom: 1rem;
}

.form input,
.form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 1rem;
    font-family: inherit;
    margin-top: 0.5rem;
}

#msgMensaje {
    color: var(--clr-primary-dark);
}

#contacto li a {
    text-decoration: none;
    color: white;
}

#contacto li a img {
    width: 1.5em;
    margin-top: .5em;

}

/*Footer*/
.footer {
    color: white;
    text-align: center;
    padding: 1rem 0;
    font-size: 0.9rem;
    background: #111;
}

.footer a {
    text-decoration: none;
    color: rgba(0, 0, 255, 0.325);
    cursor: pointer;
}

/* Cambio de páginas */

#PageSwitch {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .5em;
    margin-bottom: .5em;
}

#PageSwitch input {
    background-color: var(--clr-primary);
    border: none;
    padding: 1em;
    border-radius: .5em;
    transition: .5s ease all;
}
#PageSwitch input:hover {
    background-color: var(--clr-primary-dark);
}

#PageSwitch p {
    padding: .5em 1em;
    border: var(--clr-primary) 1px solid;
    border-radius: .5em;
}

/*Responsive*/
@media (max-width: 768px) {
    .nav-button {
        display: block;
        border: none;
        border-top: var(--clr-primary) 5px solid;
        border-bottom: var(--clr-primary) 12px double;
        width: 2em;
        height: 1.5em;
        background-color: transparent;
        position: absolute;
        left: 90%;
    }

    .nav-links {
        display: none;
    }

    .nav-float-activo {
        display: block;
        flex-direction: column;
        gap: 0.5rem;
    }

    .navbar .container {
        flex-direction: column;
        gap: 0.5rem;
    }

    select {
        margin-top: .2em;
    }

    .CarritoActivo {
        right: 1em;
        width: 90%;
    }

    .cardCarrito {
        flex-direction: column;
    }

}

/*Keyframes*/
@keyframes grow {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoom {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.5);
    }

    100% {
        transform: scale(1);
    }
}


@keyframes shrink {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.5);
    }

    100% {
        opacity: 0;
        transform: scale(0);
    }
}