/* ===== ESTILOS PARA CATÁLOGO ONLINE - RESPONSIVE MEJORADO ===== */

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    padding: 0;
    margin: 0;
}

/* Encabezado - MÁS COMPACTO */
.encabezado {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: white;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 60px;
}

.logo-empresa {
    display: flex;
    align-items: center;
}

.logo-empresa img {
    height: 140px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    transition: transform 0.3s ease;
    background: transparent !important;
    padding: 0 !important;
}

.logo-empresa img:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

/* INFO EMPRESA - TAMAÑO AUMENTADO Y COLOR BLANCO */
.info-empresa {
    text-align: right;
    font-size: 0.85rem;
}

.info-empresa p {
    margin: 0.2rem 0;
    line-height: 1.3;
    color: white !important;
}

.info-empresa a {
    color: white !important;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    opacity: 0.9;
    font-size: 0.8rem;
}

.info-empresa a:hover {
    color: white !important;
    opacity: 1;
    background: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-1px);
}

/* Botones superiores */
.botones-superiores {
    background: white;
    padding: 0.8rem 1.5rem;
    display: flex;
    gap: 0.8rem;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 38px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-volver {
    background: #5c6bc0;
    color: white;
}

.btn-volver:hover {
    background: #3f51b5;
}

.btn-volver-productos {
    background: #7e57c2;
    color: white;
}

.btn-volver-productos:hover {
    background: #673ab7;
}

.btn-exportar {
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
    color: white;
    margin: 0 auto; /* ← Cambia margin-left por esto */
    display: block; /* Importante para que funcione margin: 0 auto */
}

.btn-exportar:hover {
    background: linear-gradient(135deg, #0097a7 0%, #00838f 100%);
}

/* Título principal */
h1 {
    background: white;
    margin: 0;
    padding: 1.2rem 1.5rem 0.6rem;
    color: #1a237e;
    font-size: 1.6rem;
    border-bottom: 2px solid #e8eaf6;
    font-weight: 700;
    text-align: center;
}

/* Imagen del catálogo */
.imagen-catalogo {
    background: white;
    padding: 0 1.5rem 1rem;
    text-align: center;
}

.imagen-catalogo img {
    max-width: 100%;
    height: auto;
    max-height: 250px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    object-fit: contain;
    padding: 5px;
    background: #f8f9fa;
}

/* Secciones */
.seccion {
    background: white;
    margin: 1rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.seccion:hover {
    transform: translateY(-2px);
}

.seccion h2 {
    background: linear-gradient(135deg, #3949ab 0%, #5c6bc0 100%);
    color: white;
    padding: 0.9rem 1.2rem;
    margin: 0;
    font-size: 1.2rem;
    position: relative;
    overflow: hidden;
}

/* Grid de productos - RESPONSIVE MEJORADO */
.productos-de-seccion {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
    padding: 1.2rem;
}

/* Tarjetas de producto - MÁS COMPACTAS */
.card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    border-color: #bbdefb;
    transform: translateY(-3px);
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: #f8f9fa;
    padding: 8px;
    border-bottom: 1px solid #eee;
    transition: transform 0.4s ease;
    display: block;
}

.card:hover img {
    transform: scale(1.05);
}

.card-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card h3 {
    color: #1a237e;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    line-height: 1.3;
    min-height: 2.8em;
}

.card p {
    color: #546e7a;
    margin-bottom: 0.7rem;
    flex-grow: 1;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Sección de precios */
.precios {
    background: #f8f9fa;
    padding: 0.8rem;
    border-radius: 6px;
    margin: 0.6rem 0;
    border-left: 3px solid #3949ab;
}

.precio-publico {
    color: #455a64;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.precio-publico strong {
    color: #1a237e;
    font-size: 0.95rem;
}

.precio-mayorista {
    color: #2e7d32;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.6rem;
    background: #e8f5e9;
    border-radius: 6px;
    text-align: center;
    margin: 0.5rem 0;
    border: 1px solid #c8e6c9;
    animation: pulse 2s infinite;
    line-height: 1.2;
}

@keyframes pulse {
    0% { border-color: #c8e6c9; }
    50% { border-color: #81c784; }
    100% { border-color: #c8e6c9; }
}

.precio-sin-actualizar {
    color: #d32f2f;
    font-size: 0.85rem;
    padding: 0.5rem;
    background: #ffebee;
    border-radius: 5px;
    text-align: center;
    border-left: 2px solid #f44336;
    margin: 0.5rem 0;
}

/* Código de producto */
.card small {
    display: block;
    color: #78909c;
    font-size: 0.8rem;
    padding: 0.5rem;
    background: #f5f5f5;
    border-radius: 4px;
    margin-top: auto;
    text-align: center;
    font-family: monospace;
    font-weight: 500;
}

/* Estado sin productos */
.sin-productos {
    text-align: center;
    padding: 1.5rem;
    color: #78909c;
    background: #fafafa;
    border-radius: 8px;
    margin: 0.8rem;
}

.sin-productos h3 {
    color: #546e7a;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.sin-productos .btn {
    margin-top: 1rem;
    background: #5c6bc0;
    color: white;
    padding: 0.7rem 1.2rem;
}

/* ===== RESPONSIVE COMPLETO PARA CELULARES ===== */

/* Para tablets pequeñas y celulares grandes (600px a 768px) */
@media (max-width: 768px) {
    .productos-de-seccion {
        grid-template-columns: repeat(2, 1fr); /* 2 productos por fila */
        gap: 0.8rem;
        padding: 0.9rem;
    }
    
    .card img {
        height: 150px;
        padding: 6px;
    }
    
    .card h3 {
        font-size: 1rem;
        min-height: 2.6em;
    }
    
    .card p {
        font-size: 0.8rem;
        margin-bottom: 0.6rem;
    }
    
    .precio-mayorista {
        font-size: 1rem;
        padding: 0.5rem;
    }
    
    .precio-publico {
        font-size: 0.85rem;
    }
    
    .card-content {
        padding: 0.8rem;
    }
    
    .seccion {
        margin: 0.8rem;
    }
    
    .seccion h2 {
        padding: 0.7rem 1rem;
        font-size: 1.1rem;
    }
}

/* Para celulares medianos (480px a 600px) */
@media (max-width: 600px) {
    .productos-de-seccion {
        grid-template-columns: repeat(2, 1fr); /* 2 productos por fila */
        gap: 0.7rem;
        padding: 0.8rem;
    }
    
    .card img {
        height: 140px;
    }
    
    .card h3 {
        font-size: 0.95rem;
        min-height: 2.5em;
    }
    
    .encabezado {
        flex-direction: column;
        padding: 0.6rem;
        gap: 0.5rem;
    }
    
    .logo-empresa img {
        height: 120px;
        max-width: 130px;
    }
    
    .info-empresa {
        text-align: center;
        font-size: 0.75rem;
        width: 100%;
    }
    
    .info-empresa a {
        font-size: 0.75rem;
        padding: 0.05rem 0.2rem;
    }
    
    h1 {
        font-size: 1.4rem;
        padding: 1rem 1rem 0.5rem;
    }
    
    .botones-superiores {
        padding: 0.6rem;
        justify-content: center;
    }
    
    .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        min-height: 36px;
    }
}

/* Para celulares pequeños (360px a 480px) */
@media (max-width: 480px) {
    .productos-de-seccion {
        grid-template-columns: repeat(2, 1fr); /* 2 productos por fila */
        gap: 0.6rem;
        padding: 0.7rem;
    }
    
    .card img {
        height: 130px;
        padding: 5px;
    }
    
    .card h3 {
        font-size: 0.9rem;
        min-height: 2.4em;
        margin-bottom: 0.4rem;
    }
    
    .card p {
        font-size: 0.78rem;
        line-height: 1.3;
    }
    
    .card small {
        font-size: 0.75rem;
        padding: 0.4rem;
    }
    
    .precios {
        padding: 0.6rem;
    }
    
    .precio-mayorista {
        font-size: 0.95rem;
        padding: 0.4rem;
        margin: 0.4rem 0;
    }
    
    .precio-publico {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }
    
    .seccion {
        margin: 0.6rem;
    }
    
    .seccion h2 {
        padding: 0.6rem 0.8rem;
        font-size: 1rem;
    }
    
    .imagen-catalogo {
        padding: 0 1rem 0.8rem;
    }
    
    .imagen-catalogo img {
        max-height: 200px;
    }
}

/* Para celulares muy pequeños (hasta 360px) */
@media (max-width: 360px) {
    .productos-de-seccion {
        grid-template-columns: repeat(2, 1fr); /* 2 productos por fila */
        gap: 0.5rem;
        padding: 0.6rem;
    }
    
    .card img {
        height: 120px;
    }
    
    .card h3 {
        font-size: 0.85rem;
        min-height: 2.2em;
    }
    
    .card p {
        font-size: 0.75rem;
    }
    
    .precio-mayorista {
        font-size: 0.9rem;
        padding: 0.35rem;
    }
    
    .logo-empresa img {
        height: 110px;
        max-width: 120px;
    }
    
    h1 {
        font-size: 1.3rem;
        padding: 0.8rem 0.8rem 0.4rem;
    }
    
    .botones-superiores {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }
    
    .info-empresa {
        font-size: 0.7rem;
    }
}

/* Para pantallas grandes */
@media (min-width: 769px) {
    .productos-de-seccion {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

/* Para pantallas extra grandes */
@media (min-width: 1200px) {
    .productos-de-seccion {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (min-width: 1400px) {
    .productos-de-seccion {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* Estilos para impresión */
@media print {
    body {
        background: white !important;
    }
    
    .botones-superiores,
    .btn-exportar {
        display: none !important;
    }
    
    .productos-de-seccion {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Efectos adicionales */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #5c6bc0, #00bcd4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

/* Badge para productos destacados */
.card .badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff5722;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Ajustes para mantener 2 productos en fila en todos los celulares */
@media (max-width: 768px) {
    .card {
        min-width: 0; /* Permite que se ajuste al grid */
    }
}
/* Agregar al final de tu archivo CSS o en la sección <style> */

/* Estilo para el texto + IVA */
.precio-mayorista span.iva-texto {
    color: #e74c3c !important;
    font-weight: bold !important;
    font-size: 0.9em;
    margin-left: 5px;
    background: rgba(231, 76, 60, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Versión alternativa con ícono */
.precio-mayorista .iva-con-asterisco::after {
    content: "*";
    color: #e74c3c;
    font-weight: bold;
    margin-left: 2px;
}

/* Pie de página para aclarar */
.pie-iva {
    text-align: center;
    padding: 10px;
    font-size: 0.85em;
    color: #666;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.pie-iva span {
    color: #e74c3c;
    font-weight: bold;
}
@media (max-width: 480px) {
    .precio-mayorista .iva-texto {
        font-size: 0.8em;
        padding: 1px 4px;
        margin-left: 3px;
    }
    
    .pie-iva {
        font-size: 0.75em;
        padding: 8px;
    }
}

@media (max-width: 360px) {
    .precio-mayorista .iva-texto {
        display: block;
        margin-left: 0;
        margin-top: 3px;
        width: fit-content;
    }
}

