﻿/* =========================================================
   RESET GENERAL
========================================================= */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f4f4;
    color: #333;
}

/* =========================================================
   LAYOUT GENERAL
========================================================= */
.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.contenido {
    flex: 1;
}

.contenedor-seccion {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================================
   HEADER / NAVBAR
========================================================= */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1e73be;
    color: white;
    padding: 12px 20px;
    gap: 20px;
    position: relative;
}

/* LOGO */
.logo {
    background: white;
    padding: 5px 10px;
    border-radius: 6px;
}

    .logo img {
        height: 40px;
        transition: 0.2s;
    }

        .logo img:hover {
            transform: scale(1.05);
        }

/* BUSCADOR */
.buscador {
    display: flex;
    flex: 1;
    max-width: 500px;
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

    .buscador input {
        flex: 1;
        padding: 8px;
        border: none;
    }

    .buscador button {
        background: #155a94;
        color: white;
        border: none;
        padding: 8px 12px;
    }

/* BOTONES MENU */
.btn-menu {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    text-decoration: none;
}

    .btn-menu:hover {
        background: rgba(255,255,255,0.2);
    }

button.btn-menu {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    font: inherit;
    cursor: pointer;
}
/* ================= DROPDOWN CATEGORIAS ================= */

.menu-categorias-dropdown {
    position: relative;
}

.dropdown {
    display: none; /* 🔥 clave */
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    overflow: hidden;
    z-index: 1000;
}

    /* items */
    .dropdown a {
        display: block;
        padding: 10px 12px;
        text-decoration: none;
        color: #333;
    }

        .dropdown a:hover {
            background: #f0f6ff;
        }

    /* activo */
    .dropdown.activo {
        display: block;
    }

/* ================= USER DROPDOWN ================= */

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 45px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    width: 220px;
    z-index: 2000;
}

    .user-dropdown.activo {
        display: block;
    }

.user-info {
    margin-bottom: 10px;
    font-size: 14px;
}

.user-dropdown a {
    display: block;
    padding: 8px;
    text-decoration: none;
    color: #333;
}

    .user-dropdown a:hover {
        background: #f0f6ff;
    }

/* =========================================================
   MENU MOBILE / DESKTOP (FIX DEFINITIVO)
========================================================= */

/* MOBILE (base) */
#menu-mobile {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: #1e73be;
    padding: 20px;
    transition: right 0.3s ease;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    #menu-mobile.activo {
        right: 0;
    }

/* overlay */
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    z-index: 9998;
}

    #overlay.activo {
        display: block;
    }

/* DESKTOP */
@media (min-width: 769px) {

    #menu-mobile {
        position: static !important;
        right: 0 !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        padding: 0 !important;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    #overlay {
        display: none !important;
    }
}

/* =========================================================
   PRODUCTOS
========================================================= */
.grid-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(230px,1fr));
    gap: 25px;
    padding: 25px;
}

.producto-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: 0.3s;
}

    .producto-card:hover {
        transform: translateY(-5px);
    }

    .producto-card img {
        width: 100%;
        height: 200px;
        object-fit: cover;
        border-radius: 8px;
    }

.precio {
    font-size: 20px;
    font-weight: bold;
    color: #1e73be;
}

/* =========================================================
   BOTONES Y CANTIDAD
========================================================= */
.botones {
    margin-top: 10px;
}

.form-carrito {
    display: flex;
    gap: 8px;
}

.cantidad-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

/* botones */
.btn-cantidad {
    width: 30px;
    height: 30px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.2s;
}

    .btn-cantidad:hover {
        background: #f0f0f0;
    }

/* input limpio */
.input-cantidad {
    width: 45px;
    height: 30px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 6px;
    appearance: textfield;
}

    /* sacar flechitas nativas */
    .input-cantidad::-webkit-outer-spin-button,
    .input-cantidad::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

.menos {
    border-radius: 6px 0 0 6px;
}

.mas {
    border-radius: 0 6px 6px 0;
}

.btn-carrito {
    background: #1e73be;
    color: white;
    border-radius: 6px;
    padding: 0 15px;
    height: 42px;
    display: flex;
    align-items: center;
}

/* =========================================================
   SLIDER PRO
========================================================= */

.slider {
    position: relative;
    max-width: 1200px;
    height: 350px;
    margin: 20px auto;
    overflow: hidden;
    border-radius: 10px;
    background: #eee;
}

/* slides superpuestos */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
    z-index: 1;
}

    .slide.activo {
        opacity: 1;
        z-index: 2;
    }

    /* imagen centrada */
    .slide img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

/* overlay texto estilo original mejorado */
.overlay {
    position: absolute;
    left: 30px; /* 🔥 a la izquierda */
    bottom: 30px; /* 🔥 abajo */

    text-align: left;
    max-width: 40%;
}

    /* título */
    .overlay h2 {
        margin: 0 0 10px;
        font-size: 24px;
        color: #333;
    }

    /* botón */
    .overlay a {
        display: inline-block;
        background: #1e73be;
        color: white;
        padding: 10px 15px;
        border-radius: 6px;
        text-decoration: none;
    }

    .overlay h2 {
        margin: 0 0 10px;
        font-size: 24px;
    }

    .overlay a {
        display: inline-block;
        background: #1e73be;
        color: white;
        padding: 10px 15px;
        border-radius: 6px;
        text-decoration: none;
    }

/* flechas */
.prev,
.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    color: white;
    border: none;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 5;
}

/* posiciones */
.prev {
    left: 10px;
}

.next {
    right: 10px;
}

/* =========================================================
   CARRITO
========================================================= */
.contenedor-carrito {
    max-width: 900px;
    margin: 40px auto;
}

.item-carrito {
    display: grid;
    grid-template-columns: 80px 1fr 120px 40px;
    gap: 15px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

    .item-carrito img {
        width: 70px;
    }

.subtotal {
    font-weight: bold;
    text-align: right;
}

.total {
    text-align: right;
    font-size: 20px;
    margin-top: 20px;
    border-top: 1px solid #ddd;
    padding-top: 15px;
}

/* =========================================================
   FIX CARRITO PRO (FORZAR DISEÑO)
========================================================= */

.item-carrito {
    display: grid !important;
    grid-template-columns: 80px 1fr 120px 40px;
    align-items: center;
    gap: 15px;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* imagen */
.item-img img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}

/* info */
.item-info h3 {
    margin: 0 0 5px;
    font-size: 16px;
}

.item-info .precio {
    color: #1e73be;
    font-weight: bold;
    margin-top: 4px;
    margin-bottom: 6px;
    font-size: 16px;
}

.item-info .descripcion {
    font-size: 13px;
    color: #666;
    margin: 4px 0 6px;
    line-height: 1.3;
}

/* cantidad */
/*.form-cantidad {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    width: 55px;
    height: 30px;
    font-size: 14px;

}*/
.form-cantidad {
    display: inline-flex; /* 🔥 clave */
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    background: #f8f9fa;
    padding: 5px;
    border-radius: 8px;
}

    .form-cantidad input {
        width: 50px !important; /* 🔥 fuerza tamaño */
        height: 30px;
        text-align: center;
        border-radius: 6px;
        border: 1px solid #ccc;
        flex: none; /* 🔥 evita que se estire */
    }

    .form-cantidad button {
        background: #e9ecef;
        border: none;
        padding: 6px 10px;
        border-radius: 6px;
        cursor: pointer;
        white-space: nowrap; /* 🔥 evita que crezca */
    }
.form-cantidad input {
    border-radius: 6px;
    border: 1px solid #ccc;
}

   /* .form-cantidad button {
        background: #e9ecef;
        border: none;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 13px;
    }*/

    .form-cantidad button:hover {
        background: #d6d8db;
    }

/* subtotal */
.item-subtotal {
    font-weight: bold;
    text-align: right;
    font-size: 18px;
    color: #333;
}

/* eliminar */
.item-eliminar {
    color: #999;
    font-size: 18px;
    text-decoration: none;
    text-align: center;
    transition: 0.2s;
}

    .item-eliminar:hover {
        color: red;
        transform: scale(1.2);
    }

/* total */
.total {
    text-align: right;
    font-size: 22px;
    font-weight: bold;
    margin-top: 25px;
    padding-right: 10px;
}

/* botón */
.btn-finalizar {
    display: block;
    width: 260px;
    margin: 25px auto;
    background: #1e73be;
    color: white;
    padding: 14px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: 0.2s;
}

    .btn-finalizar:hover {
        transform: scale(1.03);
    }

/* =========================================================
   MINI CARRITO
========================================================= */
.mini-carrito {
    display: none;
    position: absolute;
    right: 0;
    top: 40px;
    width: 280px;
    background: white;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    z-index: 2000;
}

/*.carrito-box:hover .mini-carrito {
    display: block;
}*/

/* item */
.mini-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

    .mini-item img {
        width: 50px;
        height: 50px;
        object-fit: cover;
        border-radius: 6px;
    }

.mini-info {
    flex: 1;
}

.mini-nombre {
    font-size: 13px;
    margin: 0;
    color:black;
}

.mini-desc {
    font-size: 12px;
    color: #777;
    margin: 2px 0;
}

.mini-precio {
    font-size: 13px;
    color: #1e73be;
    font-weight: bold;
}

/* botón */
.mini-ver {
    display: block;
    text-align: center;
    margin-top: 10px;
    padding: 8px;
    background: #1e73be;
    color: white;
    border-radius: 6px;
    text-decoration: none;
}

/* vacío */
.mini-vacio {
    text-align: center;
    font-size: 13px;
    color: #666;
}

/* =========================================================
   CARRITO LATERAL
========================================================= */
.cart-drawer {
    position: fixed;
    right: -400px;
    width: 350px;
    height: 100%;
    background: white;
    transition: 0.3s;
    z-index: 9999;
}

    .cart-drawer.activo {
        right: 0;
    }

/* =========================================================
   TOAST
========================================================= */
/* ================= TOAST PRO ================= */

.toast-ok {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #25D366;
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    /*font-weight: bold;*/
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    z-index: 99999; /* 🔥 clave */

    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

    .toast-ok.visible {
        opacity: 1;
        transform: translateY(0);
    }

/* =========================================================
   FOOTER
========================================================= */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width:768px) {
    .grid-productos {
        grid-template-columns: 1fr 1fr;
    }
}

/* BOTÓN WHATSAPP FLOTANTE */
.btn-wsp-float {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 55px;
    height: 55px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    z-index: 99999;
    transition: 0.2s;
}

/* ================= HAMBURGUESA ================= */

/* por defecto (desktop) */
.hamburguesa {
    display: none;
    font-size: 22px;
    cursor: pointer;
}

/* solo en mobile */
@media (max-width: 768px) {
    .hamburguesa {
        display: block;
    }
}

@media (max-width: 768px) {
    #menu-mobile {
        display: none;
    }

        #menu-mobile.activo {
            display: flex;
        }
}

/* BUSCADOR AJAX*/
.item-busqueda {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
    background: #fff;
}

    .item-busqueda:hover {
        background: #f5f5f5;
    }

    .item-busqueda img {
        width: 60px;
        height: 60px;
        object-fit: cover; /* 🔥 clave */
        border-radius: 5px;
        background: #eee;
    }

    .item-busqueda .info {
        flex: 1;
    }

    .item-busqueda .nombre {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .item-busqueda .precio {
        font-size: 16px;
        font-weight: bold;
        color: #007bff;
    }

.resultados-busqueda {
    position: absolute;
    background: white;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    z-index: 999;
}

/* VER.PHP */
.producto-detalle {
    display: flex;
    gap: 30px;
    padding: 20px;
    max-width: 900px;
    margin: auto;
}

.producto-img img {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    background: #eee;
}

.producto-info {
    flex: 1;
}

    .producto-info h1 {
        font-size: 28px;
        margin-bottom: 10px;
    }

.precio {
    font-size: 22px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 15px;
}

.descripcion {
    margin-bottom: 20px;
    color: #555;
}

.btn-comprar {
    display: inline-block;
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

    .btn-comprar:hover {
        background: #218838;
    }

/* ZOOM PARA LAS IMÁGENES */
.zoom-container {
    width: 300px;
    height: 300px;
    overflow: hidden;
    border-radius: 10px;
    cursor: zoom-in;
}

    .zoom-container img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .zoom-container:hover img {
        transform: scale(1.3); /* 🔥 zoom */
    }

/* BOTÓN WHATSAPP EN GRACIAS */
.btn-ws {
    display: inline-block;
    background: #25D366;
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    text-decoration: none;
    margin-top: 15px;
    font-weight: bold;
    transition: 0.2s;
}

    .btn-ws:hover {
        background: #1ebe5d;
    }

/* FORMATO DE GRACIAS */
.gracias-container {
    max-width: 500px;
    margin: 60px auto; /* 🔥 centra horizontal */
    padding: 30px;
    text-align: center;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

    .gracias-container h2 {
        margin-bottom: 10px;
    }

    .gracias-container h3 {
        margin: 15px 0;
        color: #333;
    }

    .gracias-container p {
        margin: 10px 0;
    }

.mensaje-extra {
    color: #666;
    font-size: 14px;
}