
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(160deg, #eaf2ff 0%, #ffffff 45%, #fff8db 100%);
    background-attachment: fixed;
    min-height: 100vh;
}
title{
    text-align: center;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
h1, h2 {
    color: #333;
}
.section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}
.form-group {
    margin-bottom: 15px;
}
label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
input, select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}
button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}
button:hover {
    background-color: #45a049;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
th {
    background-color: #f2f2f2;
}
tr:nth-child(even) {
    background-color: #f9f9f9;
}
.search-box {
    margin-bottom: 20px;
}
.btn-danger {
    background-color: #f44336;
}
.btn-danger:hover {
    background-color: #d32f2f;
}
.btn-primary {
    background-color: #2196F3;
}
.btn-primary:hover {
    background-color: #0b7dda;
}
.total-section {
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 20px;
    text-align: right;
}
.welcome-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.1em;
}

/* ===== Estilo para el punto de venta ===== */
.ml-tabs-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 3px solid #FFE600;
}
.ml-tab-btn {
    background-color: #eeeeee;
    color: #333;
    border: none;
    padding: 12px 20px;
    margin-right: 0;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95em;
}
.ml-tab-btn:hover {
    background-color: #e0e0e0;
}
.ml-tab-btn.active {
    background-color: #FFE600;
    color: #333;
}
.ml-card {
    background-color: white;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 24px;
}
.ml-card h2 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
}
.ml-price {
    color: #333;
    font-size: 1.8em;
    font-weight: bold;
}
.ml-summary-box {
    background-color: #fffbe6;
    border: 1px solid #FFE600;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 15px 0;
    font-size: 1.1em;
}
.ml-btn-ml {
    background-color: #3483fa;
}
.ml-btn-ml:hover {
    background-color: #2968c8;
}
.ml-cancel-box {
    text-align: center;
    padding: 30px 0;
}

/* ============================================
   Responsivo (tablet y celular)
   ============================================ */

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 15px;
        border-radius: 6px;
    }
    h1 {
        font-size: 1.5em;
    }
    .section, .ml-card {
        padding: 15px;
    }
    .welcome-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .welcome-bar button {
        width: 100%;
    }
    .ml-tabs-nav {
        flex-wrap: wrap;
        gap: 6px;
    }
    .ml-tab-btn {
        flex: 1 1 calc(50% - 6px);
        padding: 10px 8px;
        font-size: 0.85em;
        text-align: center;
    }
    button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
        box-sizing: border-box;
    }
    td button {
        width: auto;
        display: inline-block;
        margin-bottom: 4px;
    }
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .auth-container {
        margin: 30px auto !important;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.3em;
    }
    .ml-tab-btn {
        flex: 1 1 100%;
    }
    .ml-price {
        font-size: 1.4em;
    }
    th, td {
        padding: 6px;
        font-size: 0.9em;
    }
}

/* ============================================
   Catálogo de productos (estilo Mercado Libre)
   ============================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 15px;
}
.product-card {
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease;
}
.product-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}
.product-card-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.product-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.product-card-name {
    margin: 0;
    font-size: 0.95em;
    color: #333;
    min-height: 2.4em;
}
.product-card-stock {
    margin: 0 0 8px 0;
    font-size: 0.85em;
    color: #777;
}
.product-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.product-card-qty {
    width: 60px;
    flex: 0 0 60px;
}
.product-card-actions button {
    flex: 1;
    margin-right: 0;
    white-space: nowrap;
}

/* Miniaturas en tablas (carrito y gestión de productos) */
.table-thumb {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    background-color: #f5f5f5;
}

/* Vista previa de imagen en los formularios de admin */
.image-preview {
    margin-top: 8px;
    width: 120px;
    height: 120px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f5f5f5;
}

/* Contador de items en la pestaña "Carrito" */
.cart-count-badge {
    background-color: #f44336;
    color: white;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.75em;
    margin-left: 6px;
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    .product-card-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .product-card-qty {
        width: 100%;
        flex: none;
    }
}

/* ============================================
   Checkout: entrega, forma de pago y confirmación
   ============================================ */
.delivery-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.delivery-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}
.delivery-option input {
    width: auto;
}
.ml-payment-box {
    background-color: #eef6ff;
    border: 1px solid #b3d7ff;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 15px 0;
    font-size: 0.95em;
    color: #1b4f91;
}
.confirmacion-box {
    text-align: center;
}
.confirmacion-titulo {
    font-size: 1.3em;
    font-weight: bold;
    color: #2e7d32;
    margin-bottom: 10px;
}
.confirmacion-acciones {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}
.btn-ticket {
    display: inline-block;
    background-color: #3483fa;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
}
.btn-ticket:hover {
    background-color: #2968c8;
}

@media (max-width: 480px) {
    .confirmacion-acciones {
        flex-direction: column;
    }
    .confirmacion-acciones button,
    .confirmacion-acciones .btn-ticket {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
}

/* Aviso de "Subiendo imagen... / Imagen subida" en el formulario de admin */
.upload-status {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.85em;
    color: #2e7d32;
}

/* Filtros del catálogo (buscador + categoría) */
.catalog-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.catalog-filters .search-box,
.catalog-filters .form-group {
    flex: 1 1 220px;
    margin-bottom: 15px;
}

/* Etiqueta de categoría dentro de la tarjeta del catálogo */
.product-card-category {
    display: inline-block;
    background-color: #f0f0f0;
    color: #666;
    font-size: 0.75em;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 4px;
    align-self: flex-start;
}

@media (max-width: 480px) {
    .catalog-filters {
        flex-direction: column;
        gap: 0;
    }
}

/* Botones de acción dentro de la pestaña Carrito */
.cart-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}
.cart-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .cart-actions {
        flex-direction: column-reverse;
    }
    .cart-actions button {
        width: 100%;
    }
}

/* Campo de contraseña con ícono de ojo para mostrar/ocultar */
.password-wrapper {
    position: relative;
}
.password-wrapper input {
    padding-right: 40px;
}
.toggle-password {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    margin: 0;
    cursor: pointer;
    color: #777;
    display: flex;
    align-items: center;
}
.toggle-password:hover {
    color: #333;
    background: none;
}
.toggle-password svg {
    fill: currentColor;
}

/* ============================================
   Fondo decorativo del login / registro
   (una "cinta" amarilla tipo boleto, asomando detrás
   de la tarjeta blanca, a juego con el resto del sistema)
   ============================================ */
.auth-container {
    position: relative;
    margin-top: 130px !important;
}
.auth-container::before {
    content: '';
    position: absolute;
    top: -34px;
    left: 6%;
    right: 6%;
    height: 40px;
    background-color: #FFE600;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.auth-container::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 6%;
    right: 6%;
    height: 12px;
    background-image:
        linear-gradient(135deg, transparent 6px, #FFE600 6px),
        linear-gradient(-135deg, transparent 6px, #FFE600 6px);
    background-position: left top;
    background-size: 12px 12px;
    background-repeat: repeat-x;
}

@media (max-width: 768px) {
    .auth-container {
        margin-top: 70px !important;
    }
}
