/* --- CONFIGURACIÓN GENERAL --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Arial, sans-serif;
}

body {
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- HEADER & NAVEGACIÓN --- */
header nav {
    background: #1a2a3a; /* Azul oscuro profesional */
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 5%;
    position: fixed;   /* fijo arriba */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

header nav a {
    color: #ecf0f1;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

header nav a:hover {
    color: #3498db; /* Azul acento */
}

.cart {
    font-size: 1.4rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.cart:hover {
    transform: scale(1.2);
}

/* --- BANNER PRINCIPAL --- */
.banner {
    position: relative;
    text-align: center;
    height: 400px;
    overflow: hidden;
    margin-top: 70px; /* espacio para que no se tape con el header fijo */
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
}

.banner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 32px;
    font-weight: bold;
    background: rgba(0,0,0,0.6);
    padding: 20px 40px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- PROMOCIONES --- */
.promo {
    background: linear-gradient(90deg, #ff8c00, #ffae42);
    color: white;
    text-align: center;
    padding: 15px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: inset 0 -2px 5px rgba(0,0,0,0.1);
}

/* --- GRID DE CATEGORÍAS --- */
.categorias .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    padding: 15px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card img {
    max-width: 80px;   /* tamaño uniforme de iconos */
    height: auto;
    margin-bottom: 10px;
}

.card p {
    font-weight: bold;
    color: #1a2a3a;
    font-size: 0.9rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

/* --- FORMULARIOS Y LISTAS --- */
form {
    margin: 20px 5%;
    display: flex;
    gap: 10px;
}

input[type="text"], input[type="number"], select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    flex: 1;
}

.lista-productos {
    padding: 20px 5%;
}

.lista-productos ul {
    list-style: none;
}

.lista-productos li {
    background: white;
    margin: 8px 0;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

/* --- FOOTER --- */
footer {
    background-color: #1a1a1a;
    color: #bdc3c7;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: fixed;   /* fijo abajo */
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

/* Ajuste del contenido para que no se tape con el footer */
main {
    padding-bottom: 80px; /* espacio para el footer fijo */
}

.social {
    display: flex;
    align-items: center;
    gap: 15px;
}

.social a {
    color: #fff;
    text-decoration: none;
    background: #333;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.social a:hover {
    background: #3498db;
}

/* --- RESPONSIVO --- */
@media (max-width: 768px) {
    header nav {
        flex-direction: column;
        padding: 15px;
    }
    header nav ul {
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 10px;
    }
    .banner-text {
        font-size: 20px;
        width: 80%;
    }
    footer {
        flex-direction: column;
        text-align: center;
    }
}

/* --- MENÚ HAMBURGUESA --- */
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    background: none;
    border: none;
    color: #ecf0f1;
    cursor: pointer;
}

@media (max-width: 768px) {
    header nav {
        flex-direction: row;
        justify-content: space-between;
    }

    header nav ul {
        display: none;
        flex-direction: column;
        background: #1a2a3a;
        position: absolute;
        top: 60px;
        right: 5%;
        width: 200px;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    }

    header nav ul.show {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }
}

/* Tabla del carrito */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
th, td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: center;
}
th {
    background: #004080;
    color: #fff;
    font-weight: 600;
}

/* Bloque resumen tipo checkout */
.resumen-compra {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    max-width: 350px;
    float: right;
}
.resumen-compra h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #004080;
}
.resumen-compra p {
    font-size: 16px;
    margin: 8px 0;
}
.resumen-compra .total {
    font-size: 20px;
    font-weight: bold;
    color: #004080;
    margin-top: 15px;
}

/* Botones uniformes */
.btn {
    display: inline-block;
    padding: 12px 20px;
    margin: 5px 0;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    width: 100%; /* botones ocupan todo el ancho del resumen */
    text-align: center;
}
.btn-azul { background: #0077cc; color: #fff; }
.btn-azul:hover { background: #005fa3; }
.btn-verde { background: #28a745; color: #fff; }
.btn-verde:hover { background: #1e7e34; }
.btn-rojo { background: #dc3545; color: #fff; }
.btn-rojo:hover { background: #a71d2a; }
.btn-agregar { background: #ffc107; color: #000; }
.btn-agregar:hover { background: #e0a800; }

/* Responsive */
@media (max-width: 768px) {
    .resumen-compra {
        float: none;
        max-width: 100%;
        margin-top: 20px;
    }
    .btn {
        width: 100%;
    }
}

