* {
    box-sizing: border-box; /* Asegura que padding y border no afecten el ancho total */
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; 
    font-size: 16px; 
}

body {
    padding-top: 70px;
    margin: 0;
    min-height: 100vh;
    width: 100%;
    background-color: rgb(255, 255, 255);
    font-family: 'Forum', cursive;
    overflow-x: hidden; 
}

header {
    width: 100%;
    height: 70px; 
    top: 0;
    background-color: rgb(0, 0, 0);
    position: fixed;
    z-index: 4;

    display: flex;
    align-items: center;
    justify-content: space-between;  /* Distribuye logo, menú e iconos equilibradamente */
    padding: 0 2%; 
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-family: 'Forum', cursive;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.logo img {
    height: 4rem;  /* Aumentado de 3.125rem a 4rem (más grande) */
    transition: transform 0.5s;
    cursor: pointer;
}
.logo h1 {
    font-size: 1.5rem;  /* Aumentado de 1.25rem a 1.5rem (más grande, proporcional) */
    color: #ffffff;
    margin: 0;
    margin-left: 0.625rem; 
    white-space: nowrap; 
    min-width: 0;
}


/* Menu */
.navar {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
    flex-grow: 1;  /* Toma el espacio disponible para centrarse */
    justify-content: center;  /* Centra los enlaces del menú */
}

.navar li {
    margin: 0 1.25rem; 
}

.navar a {
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgb(255, 255, 255);
    font-size: 0.9375rem; 
    transition: color 300ms;
    font-weight: bold;
    white-space: nowrap; 
}

.navar a:hover {
      filter: drop-shadow(0 0 5px #ffc400);  /* Sombra roja */
}

/* Botones */
.botones {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.icono {
    width: 24px;  
    height: 24px; 
    object-fit: contain;  
    transition: filter 0.3s;  
}
.icono:hover {
      filter: drop-shadow(0 0 5px #ffc400);  /* Sombra roja */
  }

/* Para pantallas medianas */
@media (max-width: 992px) {
    .navar li {
        margin: 0 0.8rem; 
    }
    .navar a {
        font-size: 0.85rem; /
    }
    .btn {
        width: auto; 
        padding: 0.4em 0.8em;
        margin-left: 0.8rem;
    }
    .logo h1 {
        font-size: 1.1rem; 
    }
}

/* Para pantallas pequeñas */
@media (max-width: 768px) {
    header {
        height: 60px;
        padding: 0 1rem;
    }

    .logo img {
        height: 2.5rem; 
    }
    .logo h1 {
        font-size: 1rem; 
        margin-left: 0.3rem;
    }

    .navar {
        display: none; 
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: rgb(0, 0, 0); /* Fondo negro para que combine con el header */
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        padding: 10px 0;
        text-align: center;
        z-index: 3;
    }

    .navar.active {
        display: flex; 
    }

    .navar li {
        margin: 0.625rem 0; 
        width: 100%; /* Ocupa todo el ancho para el hover */
    }

    .navar a {
        font-size: 0.875rem; 
        color: rgb(255, 255, 255); /* Texto blanco para contraste */
        display: block; /* Hace que el enlace ocupe todo el li para mejor hover */
        padding: 0.5rem 0; /* Espacio para el hover */
    }

    /* Hover para enlaces (mantiene el original) */
    .navar a:hover {
        filter: drop-shadow(0 0 5px #ffc400);  /* Sombra dorada */
    }

    /* Hover adicional para ítems del menú desplegable (fondo sutil) */
    .navar li:hover {
        background-color: rgba(255, 255, 255, 0.1); /* Fondo gris claro al pasar el cursor */
    }

    .botones {
        display: none; 
    }

    .menu-toggle {
        display: block; 
        cursor: pointer;
        font-size: 1.875rem; 
        color: #ffffff; /* Color blanco para el botón de tres líneas */
        z-index: 5;
        transition: color 0.3s; /* Transición suave para hover */
    }

    .menu-toggle:hover {
        color: #ffc400; /* Color dorado al pasar el cursor sobre el botón de tres líneas */
    }
}


@media (min-width: 769px) {
    .menu-toggle {
        display: none;
    }
}

/* ===== CARRO DE COMPRAS ===== */
.carrito-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 40px;
    background-color: #ffffff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-family: 'Forum', sans-serif;
}

/* ===== TÍTULO PRINCIPAL ===== */
.carrito-container h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #333;
    font-weight: bold;
}

/* ===== LISTA DE CARRITO ===== */
.lista-carrito {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== ITEM DE CARRITO (PRODUCTO) ===== */
.producto-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* ===== IMAGEN DEL PRODUCTO (CUADRADA Y MÁS GRANDE) ===== */
.producto-item img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #ddd;
    margin-right: 20px;
}

/* ===== INFORMACIÓN DEL PRODUCTO ===== */
.producto-item div {
    flex-grow: 1;
    font-size: 1.1rem;
}

.producto-item h4 {
    font-size: 1.4rem;
    margin: 10px 0;
    color: #333;
}

.producto-item p {
    margin: 5px 0;
    font-size: 1rem;
    color: #555;
}

/* ===== ELIMINAR PRODUCTO (ESTILO BOTÓN) ===== */
.producto-item a {
    font-weight: bold;
    color: #e53935;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    transition: 0.2s;
    font-size: 1rem;
}

.producto-item a:hover {
    background: rgba(229, 57, 53, 0.1);
    transform: scale(1.05);
}

/* ===== TOTAL DEL CARRITO ===== */
.total {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 30px;
    text-align: right;
    color: #333;
}

/* ===== BOTONES (VACÍAR CARRITO Y PAGAR) ===== */
.carrito-container > div:last-child a {
    display: inline-block;
    font-weight: bold;
    text-align: center;
    padding: 12px 18px;
    font-size: 1.2rem;
    border-radius: 8px;
    transition: 0.2s;
}

/* ===== VACÍAR CARRITO - COLOR ROJO ===== */
.carrito-container > div:last-child a:nth-child(1) {
    background-color: #f44336;
    color: white;
    margin-right: 15px;
}

.carrito-container > div:last-child a:nth-child(1):hover {
    background-color: #d32f2f;
}

/* ===== PROCEDER AL PAGO - COLOR VERDE ===== */
.carrito-container > div:last-child a:nth-child(2) {
    background-color: #4CAF50;
    color: white;
}

.carrito-container > div:last-child a:nth-child(2):hover {
    background-color: #388e3c;
}

/* ===== LINK A LA TIENDA (SI EL CARRITO ESTÁ VACÍO) ===== */
.carrito-container a {
    font-weight: bold;
    color: #0073e6;
    text-decoration: none;
}

.carrito-container a:hover {
    text-decoration: underline;
}
@media (max-width: 768px) {

    /* Contenedor general */
    .carrito-container {
        padding: 20px;
        margin: 20px 10px;
    }

    .carrito-container h2 {
        font-size: 2rem;
        margin-bottom: 20px;
    }

    /* Producto en columna */
    .producto-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    /* Imagen centrada y más grande */
    .producto-item img {
        width: 160px;
        height: 160px;
        margin-right: 0;
        align-self: center;
    }

    /* Texto del producto */
    .producto-item div {
        width: 100%;
        font-size: 1rem;
    }

    .producto-item h4 {
        font-size: 1.3rem;
    }

    /* Botón eliminar */
    .producto-item a {
        align-self: flex-end;
        font-size: 0.95rem;
    }

    /* Total */
    .total {
        text-align: center;
        font-size: 1.4rem;
        margin-top: 25px;
    }

    /* Botones inferiores */
    .carrito-container > div:last-child {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .carrito-container > div:last-child a {
        width: 100%;
        font-size: 1.1rem;
    }
}
@media (max-width: 480px) {

    .carrito-container h2 {
        font-size: 1.8rem;
    }

    .producto-item img {
        width: 140px;
        height: 140px;
    }

    .producto-item p {
        font-size: 0.95rem;
    }

    .total {
        font-size: 1.3rem;
    }
}


/* ===== MODAL CONFIRMACIÓN ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    touch-action: none;
}
.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    padding: 30px;
    width: 90%;
    max-width: 420px;
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    text-align: center;
    animation: modalFade 0.3s ease;
}

.modal-box h3 {
    font-size: 1.6rem;
    margin-bottom: 10px;
    color: #333;
}

.modal-box p {
    font-size: 1.05rem;
    color: #555;
    margin-bottom: 25px;
}

.modal-botones {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-botones button {
    padding: 10px 18px;
    font-size: 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

#modal-cancelar {
    background: #eee;
    color: #333;
}

#modal-cancelar:hover {
    background: #ddd;
}

#modal-confirmar {
    background: #e53935;
    color: #fff;
}

#modal-confirmar:hover {
    background: #c62828;
}

@keyframes modalFade {
    from {
        transform: translateY(15px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
.btn-vaciar {
    background-color: #f44336;
    color: white;
    padding: 12px 20px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    text-decoration: none;
    transition: 0.25s ease;
    display: inline-block;
}

.btn-vaciar:hover {
    background-color: #d32f2f;
    transform: scale(1.05);
}


@media (max-width: 768px) {
    .modal-box {
        max-width: 360px;
    }

    .modal-box h3 {
        font-size: 1.4rem;
    }

    .modal-box p {
        font-size: 1rem;
    }
}


@media (max-width: 480px) {
    .modal-box {
        padding: 20px;
        border-radius: 12px;
    }

    .modal-box h3 {
        font-size: 1.3rem;
    }

    .modal-box p {
        font-size: 0.95rem;
    }

    .modal-botones {
        flex-direction: column;
        gap: 12px;
    }

    .modal-botones button {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }
}


/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

/* Modal activo */
.modal-overlay.active {
    display: flex;
}

/* Caja del modal */
.modal-box {
    background: #fff;
    padding: 25px 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s ease;
}

/* Animación */
@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Título */
.modal-box h2 {
    margin-bottom: 15px;
    font-size: 20px;
}

/* Botones */
.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.modal-buttons button {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
}

#modal-login-btn {
    background-color: #c6a009;
    color: #fff;
}

#modal-login-btn:hover {
    background-color: #ccb143;
}

#modal-cerrar-btn {
    background-color: #ccc;
    color: #333;
}

#modal-cerrar-btn:hover {
    background-color: #aaa;
}


.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal-overlay.active {
    display: flex;
}
.modal-box {
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    text-align: center;
}
