/* Paleta de colores */
:root {
    --primary-color: #006d77; /* Azul petróleo */
    --secondary-color: #83c5be; /* Verde menta suave */
    --accent-color: #ff6f61; /* Coral */
    --bg-color: #edf6f9; /* Gris claro */
    --text-color: #023047; /* Azul oscuro */
    --border-color: #adb5bd; /* Gris intermedio */
}

/* Fuentes y ajustes básicos */
body {
    font-family: 'Nunito', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
}
#header {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 10px; 
    align-items: center; 
    background-color: var(--primary-color);
    padding: 20px;
}

#header h1 {
    color: var(--bg-color);
    text-align: center;
}

.header-container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

/* Barra de navegación */
.nav {
    grid-column: 1 / 2;
}

.navcart {
    grid-column: 2 / 3;
    text-align: right;
    cursor: pointer;
}

#cart-count-header {
    position: absolute;
    right: 1em;
    background-color: var(--accent-color);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 50%;
    display: inline-block;
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

header nav ul li {
    margin: 0 15px;
}

header nav ul li a {
    color: var(--bg-color);
    text-decoration: none;
    font-size: large !important;
}

header nav ul li a:hover {
    color: var(--accent-color) !important;
}

h1{
    text-align: center;
    margin-top: 1vh;
}

h2 {
    text-align: center;
    color: var(--primary-color);
}

/* Pie de página */
footer {
    background-color: var(--primary-color);
    color: var(--bg-color);
    text-align: center;
    padding: 10px;
}

/* Sección Inicio */
.container {
    max-width: 50%;
    margin: auto;
    padding-left: 1px;
    display: flex;
    flex-direction: column;
}

.welcome {
    text-align: center;
    padding: 10px;
    color: var(--primary-color);
    font-size: 30px;
}

.container p {
    text-align: justify;
    padding: 10px;
}

.d-flex {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* Slider */
.slider-box {
    width: 50%;
    height: 100%;
    margin-right: 1%;
    overflow: hidden;
    align-content: center;
}

.slider-box ul {
    display: flex;
    padding: 0;
    width: 300%;
    animation: slide 15s infinite alternate-reverse ease-in-out;
}

.slider-box li {
    width: 100%;
    list-style: none;
    position: relative;
}

.slider-box img {
    width: 100%;
    height: 100%;
}

@keyframes slide {
    0% { margin-left: 0%; }
    33% { margin-left: 0%; }
    33% { margin-left: -100%; }
    66% { margin-left: -100%; }
    66% { margin-left: -200%; }
    100% { margin-left: -200%; }
}

/* Productos */
.productos-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-around;
    padding: 20px;
}

.card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    width: 100%;
    height: 700px;
    max-width: 350px;
    padding: 5px;
    text-align: center;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 500px;
}

.card:hover {
    border-color: var(--accent-color);
    box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.2);
}

.card img {
    height: auto;
    max-height: 200px;
    max-width: 100%;
    object-fit: contain;
}

.card h3 {
    margin: 10px 0;
    height: 3em; 
    line-height: 1.5em; 
    overflow: hidden; 
    text-overflow: ellipsis;
}

.card p {
    margin: 10px 0;
    height: 4em;  
    line-height: 1.5em;  
    overflow: hidden; 
    text-overflow: ellipsis;
}

.btn-description{
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: auto;
}
.btn-add-cart{
    background-color: var(--primary-color);
    color: var(--bg-color);
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: auto;
}

/* Reseñas */
.reseñas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.reseña {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    color: var(--text-color);
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.reseña:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

.reseña p {
    font-style: italic;
    height: 60%;
}

/* Contacto */
form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

form label {
    font-weight: bold;
}

form input, form textarea {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-color);
    resize: none;
}

form button[type="submit"] {
    background-color: var(--primary-color); 
    color: var(--bg-color); 
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

form button[type="submit"]:hover {
    background-color: var(--accent-color); 
    transform: translateY(-2px); 
    box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.15);
}

form button[type="submit"]:active {
    transform: translateY(0); 
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    background-color: var(--secondary-color); 
}

button {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

button:hover {
    transform: scale(1.1);
    background-color: var(--accent-color);
}

.btn-container {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 10%;
    right: 20px;
    gap: 10px; 
}

.btn-update-quantity {
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}


/* Botones */
#btnUp, #btnCart {

    border: none;
    background-color: transparent;
    border-radius: 0px;
    position: relative;
}

#btnUp:hover i, #btnCart:hover i {
    transform: scale(1.1);
    color: var(--text-color);
    transition: color 0.3s linear, transform 0.3s linear;
}

#cart-count {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--accent-color);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 50%;
    display: inline-block;
}

#imgUp, #imgCart{
    color: #006d77;
    background-color: transparent; 
}

#imgUp:hover , #imgCart:hover {
    color: var(--text-color);
    transition: color 0.3s linear;
}


/* Media Queries */
@media (max-width: 992px) {
    
    .header-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 5px;
    }
    
    #header h1 {
        color: var(--bg-color);
        text-align: center;
    }
        
    .nav {
        grid-column: 1 / 2;
        align-items: center;
    }
    
    .navcart {
        position: relative;
        grid-column: 2 / 2; 
        text-align: right;
        cursor: pointer;
        display: inline-block;
    }

    .navbar-toggler {
        border: var(--text-color) solid 1px !important; 
    }
    
    #cart-count-header {
        position: absolute;
        right: 0.5vw;
        background-color: var(--accent-color);
        color: white;
        font-size: 12px;
        font-weight: bold;
        padding: 3px 6px;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 18px;
        height: 18px;
    }

    .d-flex {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .productos-container {
        flex-direction: column;
        align-items: center;
    }

    .container {
        max-width: 90%;
        width: 90%;
        text-align: center;
    }

    .slider-box {
        width: 90%;
        margin: 20px 0;
    }

    form {
        width: 90%;
    }

    .welcome {
        text-align: center;
        padding: 10px;
        color: var(--primary-color);
        font-size: 2vh;
    }
    #reseñas {
        width: 100%;
        overflow: hidden;
    }

    .reseñas-grid {
        margin: 1%;
        overflow: hidden;
        align-content: center;
        display: flex;
        padding: 0;
        width: 300%;
        height: 300px;
        position: relative;
        animation: slide 20s infinite alternate-reverse ease-in-out;
    }

    @keyframes slide {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(-69%);
        }
    }
    
    
    .reseña {
        width: 100%;
        height: 100%; 
        margin: 0;
    }
    
    .reseña:hover {
        background-color: var(--accent-color);
        color: var(--bg-color);
        border-color: var(--accent-color);
    }
    
    .reseña p {
        font-style: italic;
        height: 60%;
    }
}

