/* =========================================
   VARIABLES Y ESTILOS GLOBALES
   ========================================= */
:root {
    --white: rgba(255, 255, 255, 0.95);
    --shadow: 0 8px 32px rgba(0,0,0,0.2);
    --primary: #28a745;
    --accent: #e63946;
    --text: #1d3557;
}

body {
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding-bottom: 110px;
    min-height: 100vh;
    background: #f8f9fa url('imagenes/fondo.jpg') no-repeat center fixed;
    background-size: cover;
}

.main-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px;
}

/* =========================================
   GRID CATEGORÍAS
   ========================================= */
.grid-categorias {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.card-cat {
    background: var(--white);
    border-radius: 15px;
    padding: 5px;
    text-align: center;
    box-shadow: var(--shadow);
}

.card-cat .img-container {
    height: 85px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 5px;
}

.card-cat img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================
   GRID PRODUCTOS (2 COLUMNAS)
   ========================================= */
#lista-productos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.product-card {
    background: var(--white);
    border-radius: 15px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

/* CONTENEDOR DE IMAGEN PARA POSICIONAR EL + */
.img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;   
    overflow: hidden;
    border-radius: 12px;
    background-color: #eee; 
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    
    /* 2. CLAVE: Corta la imagen para que llene el cuadro sin estirarse ni verse flaca */
    object-fit: cover; 
    
    /* Centra la parte importante de la foto */
    object-position: center; 
    
    display: block;
    cursor: pointer;
}

/* BOTÓN + CUADRADO PEQUEÑO EN LA ESQUINA DE LA IMAGEN */
.btn-add {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 30px;
    height: 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.product-info h3 { font-size: 0.85rem; margin: 5px 0; color: var(--text); }
.product-info p { 
    font-size: 0.65rem; 
    color: #666;
     /*height: 32px;
      overflow: hidden; */
            line-height: 1.2;
     }
.product-info b { font-size: 0.9rem; color: var(--primary); display: block; margin-top: 4px; }

/* =========================================
   MODALES Y FORMULARIO COMPACTO
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: none; justify-content: center; align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 380px;
    padding: 15px;
    border-radius: 20px;
}

.compact-form input, .compact-form select {
    width: 100%;
    padding: 10px;
    margin: 4px 0;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 0.85rem;
}

/* =========================================
   BARRA CARRITO (FIJA Y FUNCIONAL)
   ========================================= */
.cart-bar {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 450px;
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 35px;
    display: none;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    z-index: 3000; /* Z-INDEX ALTO PARA QUE SIEMPRE RECIBA EL CLIC */
    cursor: pointer;
}

.cart-info-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
}

.btn-edit-cart {
    background: rgba(255,255,255,0.2);
    border: 1px solid white;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
}

/* =========================================
   BOTÓN WHATSAPP CON EFECTO 3D
   ========================================= */
.btn-confirmar {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

.btn-3d-wa {
    background: #25D366 !important;
    color: white !important;
    border-bottom: 4px solid #128C7E !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    transition: all 0.1s;
}

.btn-3d-wa:active {
    transform: translateY(2px);
    border-bottom: 2px solid #128C7E !important;
}

/* =========================================
   HEADER
   ========================================= */
.header { text-align: center; padding: 15px 0; }
.header h2 {
    background: var(--white);
    padding: 10px 25px;
    border-radius: 50px;
    display: inline-block;
    font-size: 1.1rem;
    box-shadow: var(--shadow);
}

.btn-volver {
    background: var(--text);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    margin-bottom: 10px;
}
.card-cat .img-container {
    width: 100%;
    height: 90px; /* Súbelo de 80px a 140px (o lo que prefieras) */
    border-radius: 12px;
    overflow: hidden;
}
.card-cat h3 {
    font-size: 0.85rem;
    margin: 5px 0 2px 0; /* Casi nada de espacio arriba y abajo del nombre */
    text-transform: uppercase;
}