:root {
    --primary: #25d366;
    /* Verde WhatsApp */
    --dark: #03133f;
    --light: #ffffff;
    --white: #fff89a27;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light);
    margin: 0;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    /* uno a cada extremo */
    align-items: center;
    padding: 10px 40px;
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* ================================= */
/*             TOP BAR               */
/* ================================= */
.top-bar {
    background-color: var(--dark);
    color: var(--light);
    padding: 8px 20px;
    font-size: 0.85rem;
}

.top-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.top-bar-content i {
    color: var(--primary);
    margin-right: 5px;
}

.top-bar-content a {
    color: var(--light);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.top-bar-content a:hover {
    color: var(--primary);
}

.top-bar-separator {
    color: #666;
}

/* Bloque derecho */
.header-right {
    display: flex;
    flex-direction: column;
    /* uno debajo del otro */
    align-items: center;
    /* centramos los elementos dentro del contenedor */
    /* ahora h1, buscador y categorías quedan alineados en el centro */
    flex: 1;
    /* Permite usar el espacio restante apropiadamente */
    width: 100%;
    max-width: 600px;
    /* opcional: limita el ancho de la sección derecha */
}


.logo-container {
    margin-bottom: 5px;
    width: 100%;
    max-width: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-container .logo {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0px 4px 6px rgba(0, 0, 0, 0.05));
}

h1 {

    font-size: 1.2rem;
    /* Título más discreto */
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #444;
    margin: 10px 0;
}

.search-container {
    padding: 0 20px;
    max-width: 500px;
    margin: 10px auto;
    /* agrega un poco de separación vertical */
    width: 100%;
}

#buscador {
    width: 100%;
    padding: 12px 20px;
    border-radius: 50px;
    /* Más redondeado para verse moderno */
    border: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    outline: none;
    transition: all 0.3s ease;
}

#buscador:focus {
    border-color: #ffcc00;
    /* Color que combine con tu logo amarillo */
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


.btn-categoria:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.btn-categoria.active {
    outline: 3px solid #333;
    /* Resalta cuál está seleccionado */
}

.categorias-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    /* Habilita que bajen a la segunda línea */
    gap: 10px;
    padding: 15px;
}

.btn-categoria {
    flex: 0 0 auto;
    padding: 8px 16px;
    /* Más reducidos */
    font-size: 0.85rem;
    /* Letra un poco más pequeña */
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
}


.grid-catalogo {
    display: grid;
    gap: 20px;
    /* Grid responsivo: */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    max-width: 1200px;
    margin: 0 auto 40px auto;
    /* Agregado margen inferior */
}

/* ================================= */
/*        PROMO BANNER               */
/* ================================= */
.promo-banner {
    background-color: #d1f7c4;
    /* Verde muy clarito */
    border-bottom: 1px solid #c2e8b5;
    padding: 12px 20px;
    text-align: center;
    margin-bottom: 20px;
}

.promo-content {
    max-width: 1200px;
    margin: 0 auto;
    color: var(--dark);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.promo-content i {
    color: var(--primary);
    font-size: 1.2rem;
}



.card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Permite que todas las tarjetas de una fila midan lo mismo */
}

.card:hover {
    transform: translateY(-5px);
}

.card img {
    width: 100%;
    /* Obliga a la imagen a llenar el ancho de la tarjeta */
    aspect-ratio: 1 / 1;
    /* Crea el contenedor cuadrado perfecto */
    object-fit: contain;
    /* Muestra tu foto de 800x800 completa sin recortes */
    background-color: #ffffff;
    /* Fondo blanco para que combine con tus fotos */
    display: block;
    /* Elimina espacios extraños en la base de la imagen */
}

.info {
    padding: 15px;
    text-align: center;
    /* Centra el ID, el nombre y los detalles */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Alinea los elementos hijos al centro */
}

.info h3 {
    margin: 10px 0;
    color: var(--dark);
}

.txt-detalles {
    font-size: 0.85rem;
    color: #666;
    margin: 5px 0 12px 0;
    /* Un poco de margen solo si existe el texto */
    line-height: 1.2;
}

/* Estilo para los IDs y códigos para que no ocupen mucho espacio vertical */
.txt-id {
    font-size: 0.75rem;
    color: #fcd604;
    margin: 0;
    line-height: 1;
}

.txt-codigo {
    font-size: 0.75rem;
    color: #f0df95a1;
    margin: 0;
    line-height: 1;
}

.contenedor-precio {
    display: flex;
    align-items: center;
    justify-content: center;
    /* <--- ESTA ES LA CLAVE para centrar horizontalmente */
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
    /* Asegura que use todo el ancho disponible para centrar */
}

/* --------------------------------------------------
   Responsive adjustments for tablets and phones
   -------------------------------------------------- */
@media (max-width: 992px) {
    header {
        flex-direction: column;
        align-items: center;
        padding: 15px 20px;
        position: relative;
        /* Quitar sticky para no ocupar toda la pantalla */
    }

    .logo-container {
        margin-bottom: 15px;
        text-align: center;
        max-width: 200px;
    }

    .header-right {
        width: 100%;
        max-width: 100%;
        align-items: center;
    }

    .search-container {
        max-width: 100%;
        padding: 0;
    }

    .grid-catalogo {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {

    /* Top Bar Mobile */
    .top-bar-content {
        flex-direction: column;
        gap: 5px;
    }

    .top-bar-separator {
        display: none;
    }

    /* Promo Banner Mobile */
    .promo-content {
        font-size: 0.85rem;
    }

    header {
        padding: 15px 10px;
    }

    .logo-container {
        max-width: 160px;
    }

    h1 {
        font-size: 1.1rem;
        text-align: center;
        margin: 5px 0 10px 0;
    }

    #buscador {
        padding: 10px 15px;
    }

    .grid-catalogo {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .categorias-nav {
        gap: 8px;
        padding: 10px 0;
    }

    .btn-categoria {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .btn-carrito-flotante {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }

    .footer-col h4 {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }
}

.price {
    font-weight: bold;
    color: #1faa1f;
    /* El verde brillante que elegiste */
    font-size: 1.2rem;
    margin: 0;
}

.txt-cant {
    font-size: 0.9rem;
    color: #666;
    font-weight: normal;
    background-color: #f1f1f1;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: capitalize;
}

.txt-ref {
    font-size: 0.75rem;
    color: #000;
    font-weight: bold;
    background-color: #b3c7f9;
    /* Soft blue */
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-left: 5px;
    display: inline-block;
    vertical-align: middle;
}

/* ================================= */
/*          CARRITO FLOTANTE         */
/* ================================= */
.btn-carrito-flotante {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #f1e318;
    /* Amarillo de la marca */
    color: #444;
    /* Ícono oscuro para contrastar */
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-carrito-flotante:hover {
    transform: scale(1.1);
}

.cart-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #ff3333;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid white;
}

/* ================================= */
/*           MODAL CARRITO           */
/* ================================= */
.cart-modal {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Fondo semitransparente */
}

/* Para animar la entrada del modal */
.cart-modal.show {
    display: flex;
    justify-content: flex-end;
    /* Desplegar por la derecha */
}

.cart-modal-content {
    background-color: #fefefe;
    height: 100%;
    width: 100%;
    max-width: 450px;
    /* Panel lateral en web, fullscreen en movil */
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.close-cart {
    color: #aaa;
    align-self: flex-end;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 10px;
}

.close-cart:hover,
.close-cart:focus {
    color: black;
    text-decoration: none;
}

.cart-modal-content h2 {
    margin-top: 0;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.cart-items {
    flex-grow: 1;
    /* Toma el espacio disponible */
    overflow-y: auto;
    /* Permite scroll si hay muchos productos */
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 15px;
}

/* Un item dentro del carrito */
.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: white;
    border-radius: 6px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    color: #333;
}

.cart-item-price {
    color: #1faa1f;
    font-weight: bold;
    margin: 0;
}

.btn-eliminar-item {
    background: none;
    border: none;
    color: #ff5555;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}

/* Botonera inferor del modal */
.cart-footer {
    border-top: 2px solid #f0f0f0;
    padding-top: 15px;
    margin-top: 10px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cart-total h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
}

.checkout-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-nombre {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
    outline: none;
}

.input-nombre:focus {
    border-color: #f1e318;
}

.btn-enviar-pedido {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.3s;
}

.btn-enviar-pedido:hover {
    background-color: #128c7e;
}

/* ================================= */
/*       CONTROLES DE CANTIDAD       */
/* ================================= */
.acciones-producto {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.control-cantidad {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    border-radius: 25px;
    overflow: hidden;
    height: 40px;
}

.btn-cant {
    background: #f1f1f1;
    border: none;
    width: 40px;
    height: 100%;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    color: #555;
    transition: background 0.2s;
}

.btn-cant:hover {
    background: #e0e0e0;
}

.input-cant {
    flex: 1;
    text-align: center;
    border: none;
    font-size: 1rem;
    font-weight: bold;
    outline: none;
    /* Quitar flechitas de number input */
    -moz-appearance: textfield;
    appearance: textfield;
}

.input-cant::-webkit-outer-spin-button,
.input-cant::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-add-cart {
    background-color: #444;
    /* Oscuro moderno */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-cart:hover {
    background-color: #222;
}

/* ================================= */
/*               FOOTER              */
/* ================================= */
.site-footer {
    background-color: var(--dark);
    color: #e0e0e0;
    padding: 50px 20px 20px;
    margin-top: 50px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: var(--light);
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col h4 i {
    color: var(--primary);
}

.footer-col p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-col p i {
    color: #aaa;
    width: 20px;
    text-align: center;
}

.footer-col.social-col .social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--light);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: #aaa;
}