/* === Estilos modernos para tienda y admin === */
:root {
    --color-principal: #272829;
    --color-secundario: #2980b9;
    --color-fondo: #f4f6f8;
    --color-texto: #333;
    --borde-radius: 12px;
    --sombra-suave: 0 2px 8px rgba(0,0,0,0.05);
    --color-exito: #28a745;
    --color-error: #dc3545;
    --color-info: #17a2b8;
    --color-warning: #ffc107;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--color-fondo);
    color: var(--color-texto);
    /* Asegurar que el scroll táctil funcione correctamente */
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

header, footer {
    background-color: var(--color-principal);
    color: #fff;
    padding: 1em;
    text-align: center;
}

main {
    padding: 2em;
    max-width: 1200px;
    margin: auto;
}

nav {
    background: #fff;
    padding: 1em;
    box-shadow: var(--sombra-suave);
    border-radius: var(--borde-radius);
    margin: 1em auto;
    max-width: 1000px;
    text-align: center;
}
nav a {
    margin: 0 10px;
    color: var(--color-secundario);
    text-decoration: none;
    font-weight: bold;
}

/* Navegación específica del header */
header nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
}
header nav a {
    margin: 0;
    transition: all 0.2s ease;
}
nav a:hover, nav a:focus {
    text-decoration: underline;
    outline: none;
}

/* === Notificaciones === */
.notificacion {
    padding: 14px 18px;
    border-radius: 8px;
    margin: 18px auto 22px auto;
    max-width: 600px;
    font-size: 1.05em;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 6px solid;
    transition: opacity 0.3s;
}
.notificacion.exito {
    background: #eafaf1;
    color: var(--color-exito);
    border-color: var(--color-exito);
}
.notificacion.error {
    background: #fdeaea;
    color: var(--color-error);
    border-color: var(--color-error);
}
.notificacion.info {
    background: #eaf6fb;
    color: var(--color-info);
    border-color: var(--color-info);
}
.notificacion.warning {
    background: #fff8e1;
    color: var(--color-warning);
    border-color: var(--color-warning);
}

.productos {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5em;
    justify-content: center;
}
.producto {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: var(--borde-radius);
    padding: 1em;
    width: 220px;
    text-align: center;
    box-shadow: var(--sombra-suave);
    transition: transform 0.2s, box-shadow 0.2s;
}
.producto:hover, .producto:focus-within {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 4px 16px rgba(41,128,185,0.10);
    outline: none;
}
.producto img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.producto h3 {
    margin: 0.5em 0;
    font-size: 1.1em;
}

/* === Productos nuevos === */
.producto-destacado {
    position: relative;
    background: linear-gradient(135deg, #fff5f5, #ffffff);
    border: 2px solid #e74c3c;
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.15);
    animation: pulse-destacado 2s infinite;
}

.producto-destacado:hover, .producto-destacado:focus-within {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 8px 24px rgba(231, 76, 60, 0.25);
}

.badge-destacado {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    z-index: 10;
    transform: rotate(15deg);
    animation: glow-destacado 2s infinite alternate;
}

@keyframes pulse-destacado {
    0% { box-shadow: 0 4px 16px rgba(231, 76, 60, 0.15); }
    50% { box-shadow: 0 6px 20px rgba(231, 76, 60, 0.25); }
    100% { box-shadow: 0 4px 16px rgba(231, 76, 60, 0.15); }
}

@keyframes glow-destacado {
    from { box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3); }
    to { box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4); }
}

button, .btn-accion, .btn-agregar, .btn-volver, .boton-carrito, .btn-logout {
    background: var(--color-secundario);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    font-size: 1em;
    font-family: inherit;
    outline: none;
}
button:hover, .btn-accion:hover, .btn-agregar:hover, .btn-volver:hover, .boton-carrito:hover, .btn-logout:hover {
    background: #1c598a;
    box-shadow: 0 2px 8px rgba(41,128,185,0.10);
}
button:focus, .btn-accion:focus, .btn-agregar:focus, .btn-volver:focus, .boton-carrito:focus, .btn-logout:focus {
    outline: 3px solid #2980b9;
    outline-offset: 2px;
}

/* === Accesibilidad: focus visible para todos los elementos interactivos === */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 3px solid #2980b9 !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #eaf6fb;
    z-index: 2;
}

/* === Accesibilidad: alto contraste para textos importantes === */
.notificacion, .mensaje-error, .btn-accion, .btn-agregar, .btn-volver, .boton-carrito, .btn-logout {
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* === Accesibilidad: mejorar contraste de botones principales === */
button, .btn-accion, .btn-agregar, .btn-volver, .boton-carrito, .btn-logout {
    color: #fff;
    background: #0056b3;
}
button:hover, .btn-accion:hover, .btn-agregar:hover, .btn-volver:hover, .boton-carrito:hover, .btn-logout:hover {
    background: #003d80;
}

/* === Accesibilidad: navegación por teclado === */
nav a, button, .btn-accion, .btn-agregar, .btn-volver, .boton-carrito, .btn-logout {
    outline: none;
    transition: outline 0.2s, box-shadow 0.2s;
}

input, select, textarea {
    padding: 10px;
    width: 100%;
    border: 1px solid #ccc;
    border-radius: var(--borde-radius);
    margin-bottom: 1em;
    font-size: 1em;
    font-family: inherit;
    background: #f9fafb;
    transition: border 0.2s;
}
input:focus, select:focus, textarea:focus {
    border-color: #2980b9;
    outline: 2px solid #2980b9;
}

/* === Filtros y búsqueda === */
.filtros-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin-bottom: 18px;
    align-items: center;
    justify-content: flex-start;
}
.filtros-panel label {
    font-weight: 500;
    margin-right: 6px;
}
.filtros-panel input[type="text"], .filtros-panel select {
    max-width: 220px;
    margin-bottom: 0;
}
.filtros-panel button {
    padding: 8px 14px;
    font-size: 0.98em;
}

/* === Filtros activos === */
.filtros-panel input:focus, .filtros-panel select:focus {
    border-color: #28a745;
    outline: 2px solid #28a745;
    background: #eafaf1;
}
.filtros-panel input.active, .filtros-panel select.active {
    border-color: #28a745;
    background: #eafaf1;
    font-weight: bold;
}
.filtros-panel label {
    cursor: pointer;
}

@media (max-width: 600px) {
  .filtros-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5em;
  }
  .filtros-panel input, .filtros-panel select {
    max-width: 100%;
    font-size: 1em;
  }
}

/* === Previsualización de imagen === */
.img-preview {
    display: block;
    max-width: 120px;
    max-height: 120px;
    margin: 10px 0 18px 0;
    border-radius: 8px;
    border: 1px solid #ddd;
    object-fit: contain;
    background: #f9fafb;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* === Paginación === */
.paginacion {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 22px 0 10px 0;
    flex-wrap: wrap;
}
.paginacion a, .paginacion span {
    display: inline-block;
    padding: 7px 13px;
    border-radius: 6px;
    background: #f4f6f8;
    color: #2980b9;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid #e0e0e0;
    transition: background 0.2s, color 0.2s;
    min-width: 36px;
    text-align: center;
}
.paginacion a:hover, .paginacion a:focus {
    background: #2980b9;
    color: #fff;
    outline: none;
}
.paginacion .actual {
    background: #2980b9;
    color: #fff;
    font-weight: bold;
    border-color: #2980b9;
}

/* === Tablas exportables y responsivas === */
table, .tabla-panel {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--borde-radius);
    overflow: hidden;
    box-shadow: var(--sombra-suave);
    font-size: 1em;
}
table th, table td, .tabla-panel th, .tabla-panel td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}
table th, .tabla-panel th {
    background: #f9fafb;
    text-align: left;
}
.tabla-panel img {
    max-width: 60px;
    height: auto;
    border-radius: 6px;
}
.exportar-btn {
    background: #17a2b8;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: bold;
    margin-bottom: 18px;
    transition: background 0.2s;
}
.exportar-btn:hover, .exportar-btn:focus {
    background: #117a8b;
    outline: 2px solid #117a8b;
}

/* === Boton Seguir Comprando === */
.btn-volver {
    display: inline-block;
    background-color: #f0f0f0;
    color: #333;
    padding: 6px 5px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95em;
    border: 1px solid #ccc;
    transition: all 0.3s ease;
    margin-top: 10px;
    margin-bottom: 20px;
    margin-left: 10px;
    max-width: 250px;
    text-align: center;
}

.btn-volver:hover, .btn-volver:focus {
    background-color: #e0e0e0;
    border-color: #999;
    color: #000;
    outline: 2px solid #2980b9;
}

/* === Ajuste de layout para mantener footer abajo === */
html, body {
    height: 100%;
    display: flex;
    flex-direction: column;
    /* Permitir scroll en móvil */
    overflow-x: hidden;
    overflow-y: auto;
}

main {
    flex: 1;
    /* Asegurar que main pueda crecer más allá del viewport en móvil */
    min-height: 0;
}

footer {
    margin-top: auto;
}

/* Ajustes adicionales para móvil */
@media (max-width: 768px) {
    html, body {
        /* En móvil, permitir altura natural del contenido */
        height: auto;
        min-height: 100vh;
        display: block;
    }
    
    main {
        /* En móvil, main no usa flex para permitir scroll natural */
        flex: none;
        min-height: calc(100vh - 120px); /* Ajustar según altura del header/footer */
    }
    
    footer {
        margin-top: 20px;
    }
}

/* === ESTILOS PARA CARRITO RESPONSIVE === */

/* Contenedor principal del carrito */
.carrito-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.carrito-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.carrito-header h2 {
    color: var(--color-secundario);
    margin: 0;
    font-size: 1.8em;
}

/* Vista Desktop - Tabla */
.carrito-desktop {
    display: block;
}

.carrito-mobile {
    display: none;
}

.carrito-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--borde-radius);
    overflow: hidden;
    box-shadow: var(--sombra-suave);
    margin-bottom: 20px;
}

.carrito-table th,
.carrito-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.carrito-table th {
    background: var(--color-fondo);
    font-weight: 600;
    color: var(--color-texto);
}

.carrito-table tr:hover {
    background: #f8f9fa;
}

.carrito-table img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Ajustes para tabla del carrito (input cantidad) */
.carrito-table input[type="number"] {
    width: 80px;
    padding: 8px;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 16px;
    box-sizing: border-box;
}

.carrito-table input[type="number"]:focus {
    outline: none;
    border-color: var(--color-secundario);
    box-shadow: 0 0 0 2px rgba(41, 128, 185, 0.2);
}

/* Botones de acción */
.btn-eliminar {
    background: var(--color-error);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-eliminar:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Vista Mobile - Cards */
.carrito-item-card {
    background: white;
    border-radius: var(--borde-radius);
    box-shadow: var(--sombra-suave);
    margin-bottom: 20px;
    padding: 0;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

/* Header de la tarjeta */
.item-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

.item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-basic-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--color-texto);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.item-price {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--color-secundario);
    margin: 0;
}

/* Líneas de separación */
.separator-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e0e0e0 20%, #e0e0e0 80%, transparent);
    margin: 0;
}

/* Sección de cantidad */
.item-quantity-section {
    padding: 20px;
    text-align: center;
    background: white;
}

.quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.quantity-control label {
    font-weight: 600;
    color: var(--color-texto);
    font-size: 1em;
}

.quantity-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-fondo);
    border-radius: 25px;
    padding: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.btn-qty {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-secundario);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.btn-qty:hover {
    background: var(--color-secundario);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
}

.btn-qty:active {
    transform: scale(0.95);
}

.quantity-buttons input {
    width: 70px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 18px;
    font-weight: 700;
    color: var(--color-texto);
    padding: 10px;
}

/* Sección de resumen */
.item-summary {
    padding: 20px;
    background: #f8f9fa;
    text-align: center;
}

.item-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
}

.subtotal-label {
    color: var(--color-texto);
    font-weight: 500;
}

.subtotal-amount {
    font-weight: 700;
    color: var(--color-secundario);
    font-size: 1.2em;
}

/* Sección de acciones */
.item-actions {
    padding: 15px 20px 20px;
    background: white;
}

.btn-eliminar-mobile {
    width: 100%;
    background: var(--color-error);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.1s ease;
}

.btn-eliminar-mobile:hover {
    background: #c82333;
}

.btn-eliminar-mobile:active {
    background: #a71e2a;
}

/* Footer del carrito */
.carrito-footer {
    background: white;
    padding: 25px;
    border-radius: var(--borde-radius);
    box-shadow: var(--sombra-suave);
    margin-top: 30px;
    text-align: center; /* Centrar contenido por defecto */
    max-width: 100%; /* Asegurar que no se salga del contenedor */
    box-sizing: border-box; /* Incluir padding en el cálculo del ancho */
}

.total-carrito {
    display: flex;
    justify-content: center; /* Centrar por defecto */
    align-items: center;
    margin-bottom: 18px; /* Reducido de 20px */
    padding: 16px 18px; /* Reducido de 20px */
    background: var(--color-fondo);
    border-radius: var(--borde-radius);
    font-size: 1.2em; /* Reducido de 1.3em */
    font-weight: 600;
    text-align: center; /* Centrar texto */
    max-width: 100%; /* No salir del contenedor */
    box-sizing: border-box;
}

.total-label {
    color: var(--color-texto);
}

.total-amount {
    color: var(--color-secundario);
    font-size: 1.15em; /* Reducido de 1.2em */
}

/* Botón WhatsApp mejorado */
.whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Reducido de 10px */
    width: 100%;
    max-width: 320px; /* Reducido de 400px */
    margin: 0 auto; /* Centrar en contenedor */
    padding: 12px 20px; /* Reducido de 15px 25px */
    background: linear-gradient(135deg, #25d366, #20c55a);
    color: white;
    text-decoration: none;
    border-radius: 40px; /* Reducido de 50px */
    font-size: 1em; /* Reducido de 1.1em */
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 3px 12px rgba(37, 211, 102, 0.3); /* Reducida sombra */
}

.whatsapp-btn:hover {
    background: linear-gradient(135deg, #20c55a, #1da851);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-icon {
    font-size: 1.1em; /* Reducido de 1.3em */
}

/* Carrito vacío */
.carrito-empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--borde-radius);
    box-shadow: var(--sombra-suave);
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.carrito-empty h3 {
    color: var(--color-texto);
    margin-bottom: 15px;
    font-size: 1.5em;
}

.carrito-empty p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.btn-shop {
    display: inline-block;
    padding: 15px 30px;
    background: var(--color-secundario);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-shop:hover {
    background: #1e6fa8;
    transform: translateY(-2px);
}

/* === RESPONSIVE DESIGN === */

/* Tablets */
@media (max-width: 1024px) {
    .carrito-table {
        font-size: 0.9em;
    }
    
    .carrito-table th,
    .carrito-table td {
        padding: 12px 8px;
    }
    
    .carrito-table img {
        width: 50px;
        height: 50px;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .carrito-container {
        padding: 15px;
        /* Asegurar que el contenedor del carrito permita scroll */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
        padding-bottom: 20px; /* Espacio extra al final */
    }
    
    .carrito-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .carrito-header h2 {
        font-size: 1.5em;
    }
    
    /* Ocultar tabla en móviles */
    .carrito-desktop {
        display: none;
    }
    
    /* Mostrar cards en móviles */
    .carrito-mobile {
        display: block;
        /* Contenedor de tarjetas debe permitir scroll */
        overflow: visible;
        padding-bottom: 100px; /* Espacio para el botón de WhatsApp */
    }
    
    /* Ajustar cards para pantallas pequeñas */
    .carrito-item-card {
        margin-bottom: 15px;
        /* Tarjetas no deben tener restricciones de altura */
        max-height: none;
        overflow: visible;
    }
    
    .item-header {
        padding: 15px;
    }
    
    .item-image {
        width: 70px;
        height: 70px;
    }
    
    .item-name {
        font-size: 1em;
    }
    
    .item-price {
        font-size: 1.2em;
    }
    
    .item-quantity-section {
        padding: 15px;
    }
    
    .quantity-control {
        flex-direction: column;
        gap: 10px;
    }
    
    .quantity-control label {
        font-size: 0.9em;
    }
    
    .btn-qty {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    
    .quantity-buttons input {
        width: 65px;
        font-size: 16px;
    }
    
    .item-summary {
        padding: 15px;
    }
    
    .item-subtotal {
        font-size: 1em;
    }
    
    .subtotal-amount {
        font-size: 1.1em;
    }
    
    .item-actions {
        padding: 15px;
    }
    
    .btn-eliminar-mobile {
        padding: 12px;
        font-size: 13px;
    }
    
    .total-carrito {
        flex-direction: column;
        gap: 8px; /* Reducido de 10px */
        text-align: center;
        padding: 16px; /* Reducido de 20px */
        font-size: 1.1em; /* Reducido tamaño */
    }
    
    .total-amount {
        font-size: 1.35em; /* Reducido de 1.5em */
    }
    
    .whatsapp-btn {
        font-size: 1.05em; /* Reducido de 1.2em */
        padding: 14px 20px; /* Reducido de 18px 25px */
        /* Centrar el botón en móvil */
        margin: 0 auto;
        max-width: 280px; /* Reducido de 300px */
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px; /* Reducido gap */
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .carrito-container {
        padding: 10px;
    }
    
    .carrito-item-card {
        margin-bottom: 12px;
        border-radius: 12px;
    }
    
    .item-header {
        padding: 12px;
        gap: 12px;
    }
    
    .item-image {
        width: 60px;
        height: 60px;
    }
    
    .item-name {
        font-size: 0.95em;
        line-height: 1.2;
    }
    
    .item-price {
        font-size: 1.1em;
    }
    
    .item-quantity-section {
        padding: 12px;
    }
    
    .quantity-buttons {
        padding: 6px;
        gap: 6px;
    }
    
    .btn-qty {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .quantity-buttons input {
        width: 55px;
        font-size: 15px;
        padding: 8px 4px;
    }
    
    .item-summary {
        padding: 12px;
    }
    
    .item-subtotal {
        font-size: 0.95em;
    }
    
    .subtotal-amount {
        font-size: 1.05em;
    }
    
    .item-actions {
        padding: 12px;
    }
    
    .btn-eliminar-mobile {
        padding: 10px;
        font-size: 12px;
        border-radius: 6px;
    }
    
    .total-carrito {
        font-size: 1.05em; /* Reducido de 1.1em */
        padding: 14px; /* Reducido de 15px */
    }
    
    .total-amount {
        font-size: 1.25em; /* Reducido de 1.3em */
    }
    
    .whatsapp-btn {
        font-size: 1em; /* Reducido de 1.1em */
        padding: 12px 18px; /* Reducido de 15px 20px */
        /* Centrar el botón en móviles pequeños */
        margin: 0 auto;
        max-width: 260px; /* Reducido de 280px */
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 25px;
        gap: 5px; /* Reducido gap */
    }
    
    /* Líneas de separación más sutiles en móviles pequeños */
    .separator-line {
        background: linear-gradient(90deg, transparent, #f0f0f0 15%, #f0f0f0 85%, transparent);
    }
}

/* Efectos adicionales para las tarjetas */
.carrito-item-card {
    transition: all 0.3s ease;
    position: relative;
}

.carrito-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

/* Línea azul eliminada según solicitud del usuario */

/* Animación para las líneas de separación */
.separator-line {
    position: relative;
    overflow: hidden;
}

.separator-line:after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(41, 128, 185, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Mejoras visuales adicionales */
.item-header {
    position: relative;
    background: linear-gradient(135deg, #fafafa, #f5f5f5);
}

.item-quantity-section {
    background: linear-gradient(135deg, #ffffff, #fafafa);
}

.item-summary {
    background: linear-gradient(135deg, #f8f9fa, #f0f2f5);
}

/* Sombras internas sutiles */
.item-header:after,
.item-quantity-section:after,
.item-summary:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.05), transparent);
    pointer-events: none;
}

.item-header:after {
    display: none; /* Ya tenemos separator-line */
}

/* Estados activos para mejor feedback */
.btn-qty:active {
    transform: scale(0.9);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.btn-eliminar-mobile:active {
    background: #a71e2a;
}

/* === FIN ESTILOS CARRITO RESPONSIVE === */

/* === Botón WhatsApp === */
.btn-whatsapp {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #25d366;
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 999;
}
.btn-whatsapp:hover, .btn-whatsapp:focus {
    background: #1ebd5a;
    outline: 2px solid #1ebd5a;
}

.whatsapp-btn {
    display: inline-block;
    background-color: #25D366;
    color: white;
    padding: 10px 16px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: background-color 0.3s;
    margin: 15px auto 0;
    text-align: center;
}
.whatsapp-btn:hover, .whatsapp-btn:focus {
    background-color: #1ebc59;
    outline: 2px solid #1ebc59;
}

/* === Estilo Login === */
.login-container {
    max-width: 420px;
    margin: 100px auto;
    padding: 40px 30px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-container h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.4em;
}

.login-container form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-container label {
    text-align: left;
    font-weight: bold;
    margin: 10px 0 5px;
    width: 100%;
    max-width: 280px;
}

.login-container input {
    width: 100%;
    max-width: 280px;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    display: block;
}

.login-container button {
    width: 100%;
    max-width: 280px;
    background-color: #007bff;
    color: white;
    padding: 12px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: block;
    margin-top: 5px;
}

.login-container button:hover, .login-container button:focus {
    background-color: #0056b3;
    outline: 2px solid #0056b3;
}

.mensaje-error {
    color: var(--color-error);
    margin-top: 10px;
    font-size: 0.95em;
    background: #fdeaea;
    border-radius: 6px;
    padding: 8px 10px;
    border-left: 4px solid var(--color-error);
}

/* === Estilo Panel admin === */
.panel-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 25px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.panel-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.btn-agregar {
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 16px;
    background-color: #28a745;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.btn-agregar:hover, .btn-agregar:focus {
    background-color: #218838;
    outline: 2px solid #218838;
}

.tabla-scroll {
    overflow-x: auto;
}

.tabla-panel {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.tabla-panel th,
.tabla-panel td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: center;
}

.tabla-panel th {
    background-color: #f9f9f9;
    font-weight: bold;
}

.tabla-panel img {
    max-width: 60px;
    height: auto;
    border-radius: 6px;
}

.btn-accion {
    padding: 6px 12px;
    margin: 2px;
    border-radius: 5px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: bold;
    display: inline-block;
}

.btn-accion.editar {
    background-color: #007bff;
}

.btn-accion.eliminar {
    background-color: #dc3545;
}

/* === Estilo boton carrito === */
.boton-carrito {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 10px;
}

.btn-logout {
    display: inline-block;
    padding: 8px 15px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.btn-carrito:hover,
.btn-logout:hover,
.btn-carrito:focus,
.btn-logout:focus {
    background-color: #0056b3;
    outline: 2px solid #0056b3;
}

#carrito-contador {
    background: #fff;
    color: #007bff;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.9em;
    margin-left: 6px;
}

/* === Logs visuales === */
.log-accion {
    font-size: 0.97em;
    color: #555;
    background: #f8f9fa;
    border-left: 4px solid #2980b9;
    padding: 7px 12px;
    margin: 8px 0;
    border-radius: 6px;
    word-break: break-all;
}

@media (max-width: 1024px) {
    main, .panel-container {
        padding: 1em;
    }
    .tabla-panel th, .tabla-panel td {
        padding: 8px 6px;
    }
}

@media (max-width: 768px) {
    .productos {
        flex-direction: column;
        align-items: center;
    }
    .producto {
        width: 90%;
    }
    /* Solo afectar la navegación del header */
    header nav {
        font-size: 14px;
        padding: 15px 10px;
        flex-direction: column;
        gap: 10px;
    }
    header nav a {
        margin: 5px 0;
        padding: 8px 16px;
        border-radius: 6px;
        background: rgba(41, 128, 185, 0.1);
        min-width: 120px;
        text-align: center;
        display: inline-block;
    }
    header nav a:hover, header nav a:focus {
        background: rgba(41, 128, 185, 0.2);
        text-decoration: none;
    }
    .panel-container {
        padding: 10px 2vw;
    }
    .tabla-panel, table {
        font-size: 0.93em;
    }
    .filtros-panel {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 600px) {
    .tabla-panel, table {
        font-size: 0.89em;
    }
    .panel-container {
        margin: 10px 0;
    }
    .filtros-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5em;
    }
    .filtros-panel input, .filtros-panel select {
        max-width: 100%;
        font-size: 1em;
    }
}

/* === Estilos para página de inicio sin productos === */
.mensaje-inicio {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 3em 1em;
    text-align: center;
}

.contenido-centrado {
    background: white;
    padding: 3em 2em;
    border-radius: var(--borde-radius);
    box-shadow: var(--sombra-suave);
    max-width: 500px;
    margin: 0 auto;
}

.contenido-centrado h2 {
    color: var(--color-principal);
    margin-bottom: 1em;
    font-size: 1.8em;
    font-weight: 600;
}

.contenido-centrado p {
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 2em;
}

.iconos-categorias {
    display: flex;
    justify-content: center;
    gap: 1em;
    margin-top: 1.5em;
}

.iconos-categorias span {
    font-size: 2em;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.iconos-categorias span:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Responsive para mensaje de inicio */
@media (max-width: 768px) {
    .mensaje-inicio {
        min-height: 300px;
        padding: 2em 1em;
    }
    
    .contenido-centrado {
        padding: 2em 1.5em;
    }
    
    .contenido-centrado h2 {
        font-size: 1.5em;
    }
    
    .iconos-categorias span {
        font-size: 1.5em;
    }
}

/* === ESTILOS ADICIONALES PARA CARRITO === */

/* Notificaciones del carrito */
.carrito-notificacion {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    max-width: 300px;
    border-left: 4px solid #ddd;
}

.carrito-notificacion.show {
    transform: translateX(0);
}

.carrito-notificacion.success {
    border-left-color: var(--color-exito);
}

.carrito-notificacion.error {
    border-left-color: var(--color-error);
}

.carrito-notificacion.info {
    border-left-color: var(--color-info);
}

.notificacion-icono {
    font-size: 1.2em;
}

.notificacion-mensaje {
    flex: 1;
    font-size: 0.9em;
    color: var(--color-texto);
}

/* Modal de confirmación */
.modal-confirmacion {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.modal-confirmacion.show {
    opacity: 1;
}

.modal-contenido {
    background: white;
    border-radius: var(--borde-radius);
    padding: 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-confirmacion.show .modal-contenido {
    transform: scale(1);
}

.modal-contenido h3 {
    color: var(--color-error);
    margin: 0 0 15px 0;
    font-size: 1.3em;
}

.modal-contenido p {
    color: var(--color-texto);
    margin: 0 0 25px 0;
    line-height: 1.5;
}

.modal-botones {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-cancelar,
.btn-confirmar {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    min-width: 100px;
}

.btn-cancelar {
    background: #6c757d;
    color: white;
}

.btn-cancelar:hover {
    background: #5a6268;
}

.btn-confirmar {
    background: var(--color-error);
    color: white;
}

.btn-confirmar:hover {
    background: #c82333;
}

/* Estados de carga */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-qty.loading,
.btn-eliminar.loading,
.btn-eliminar-mobile.loading {
    background: #ccc !important;
    color: #666 !important;
}

/* Animaciones adicionales */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.carrito-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.quantity-buttons input:focus {
    animation: pulse 0.3s ease;
}

/* === MEJORAS ESPECÍFICAS PARA SCROLL EN CARRITO MÓVIL === */
@media (max-width: 768px) {
    .carrito-container {
        /* Asegurar que el contenedor del carrito permita scroll */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
        padding-bottom: 20px; /* Espacio extra al final */
    }
    
    .carrito-mobile {
        /* Contenedor de tarjetas debe permitir scroll */
        overflow: visible;
        padding-bottom: 100px; /* Espacio para el botón de WhatsApp */
    }
    
    .carrito-item-card {
        /* Tarjetas no deben tener restricciones de altura */
        max-height: none;
        overflow: visible;
    }
    
    /* Ajustar botón WhatsApp para no interferir con scroll */
    .btn-whatsapp {
        /* Reducir z-index para evitar conflictos */
        z-index: 99;
    }
    
    /* Asegurar que el footer no se quede pegado */
    .carrito-footer {
        position: relative;
        margin-bottom: 80px; /* Espacio para el botón WhatsApp */
    }
}

/* === CORRECCIÓN ESPECÍFICA PARA SCROLL EN CARRITO === */
@media (max-width: 768px) {
    /* Forzar scroll en el carrito móvil */
    .carrito-mobile {
        overflow-y: auto !important;
        max-height: none !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Asegurar que el contenedor principal no bloquee scroll */
    .carrito-container {
        overflow-y: auto !important;
        max-height: none !important;
        height: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Eliminar cualquier restricción de altura en el body/html en móvil */
    body {
        overflow-y: auto !important;
        height: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    html {
        overflow-y: auto !important;
        height: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* === CENTRADO DEL BOTÓN WHATSAPP EN TODAS LAS RESOLUCIONES === */

/* Pantallas grandes (Desktop) */
@media (min-width: 1025px) {
    .carrito-footer {
        text-align: center;
        max-width: 700px; /* Reducido de 800px */
        margin: 30px auto;
    }
    
    .whatsapp-btn {
        max-width: 300px; /* Reducido de 350px */
        margin: 0 auto;
        font-size: 1.05em; /* Reducido de 1.2em */
        padding: 14px 24px; /* Reducido de 18px 30px */
    }
    
    .total-carrito {
        justify-content: space-between; /* En desktop usar space-between */
        max-width: 450px; /* Reducido de 500px */
        margin: 0 auto 20px auto; /* Reducido margin-bottom */
        text-align: left; /* Texto alineado a la izquierda en desktop */
        font-size: 1.15em; /* Reducido tamaño */
        padding: 14px 16px; /* Reducido padding */
    }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .carrito-footer {
        text-align: center;
        padding: 20px 18px; /* Reducido padding */
    }
    
    .whatsapp-btn {
        max-width: 300px; /* Reducido de 350px */
        margin: 0 auto;
        font-size: 1.05em; /* Reducido de 1.15em */
        padding: 13px 22px; /* Reducido de 16px 28px */
    }
    
    .total-carrito {
        justify-content: space-between; /* En tablets también usar space-between */
        text-align: left;
        margin-bottom: 20px; /* Reducido de 25px */
        font-size: 1.1em; /* Reducido tamaño */
        padding: 14px 16px; /* Reducido padding */
    }
}

/* === OPTIMIZACIÓN ADICIONAL DEL FOOTER DEL CARRITO === */
.carrito-footer {
    padding: 20px; /* Reducido padding general */
}

/* Ajustes específicos para el footer en diferentes resoluciones */
@media (max-width: 768px) {
    .carrito-footer {
        padding: 18px 15px; /* Padding más compacto en móvil */
        margin-bottom: 70px; /* Espacio para el botón WhatsApp flotante */
    }
}

@media (max-width: 480px) {
    .carrito-footer {
        padding: 15px 10px; /* Padding aún más compacto */
        margin-bottom: 60px;
    }
}




