
/* index.php */
body { font-family: sans-serif; padding: 20px; background: #f9f9f9; }
.swiper { width: 100%; max-width: 600px; height: auto; margin: auto; }
.producto { text-align: center; background: white; padding: 15px; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.producto img { max-width: calc(100% - 4em); height: auto; border-radius: 8px; }
.estado { margin: 10px 0; font-weight: bold; }
.estado .agotado { color: #f00; }
.estado .disponible { color: #0a7; }
button { padding: 10px 15px; font-size: 14px; background: #0a7; color: white; border: none; border-radius: 5px; cursor: pointer; }
button:disabled { background: #aaa; }
.modal-img{max-width: 100%; height: auto; border-radius: 8px;}

/* producto.php */
body { font-family: sans-serif; background-color: #f4f4f4; padding: 20px; }
.producto { max-width: 600px; margin: auto; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.producto img { max-width: calc(100% - 4em); height: auto; border-radius: 8px; }
.producto h1 { font-size: 24px; margin-bottom: 10px; }
.producto p { font-size: 18px; margin: 5px 0; }
.producto .precio { font-weight: bold; font-size: 20px; color: #0a7; }
.producto .descripcion { margin-top: 15px; }

/* balance-clientes.php */
.tabla-clientes {
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tabla-clientes th,
.tabla-clientes td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.tabla-clientes th {
    background-color: #e0e0e0; /* gris claro para encabezado */
    color: #333;
    font-weight: bold;
}

.tabla-clientes tr:nth-child(even) {
    background-color: #f9f9f9; /* blanco/gris claro */
}

.tabla-clientes tr:nth-child(odd) {
    background-color: #ffffff;
}

.tabla-clientes tr:hover {
    background-color: #f1f1f1;
}

@media (max-width: 600px) {
    .tabla-clientes,
    .tabla-clientes thead,
    .tabla-clientes tbody,
    .tabla-clientes th,
    .tabla-clientes td,
    .tabla-clientes tr {
        display: block;
        width: 100%;
    }

    .tabla-clientes thead {
        display: none;
    }

    .tabla-clientes td {
        position: relative;
        padding-left: 50%;
        border: none;
        border-bottom: 1px solid #ddd;
    }

    .tabla-clientes td::before {
        position: absolute;
        left: 16px;
        top: 12px;
        white-space: nowrap;
        font-weight: bold;
        color: #666;
        content: attr(data-label);
    }
}

/* productos_apartados.css (puedes integrarlo a styles.css o importarlo aparte) */

/* Contenedor para evitar overflow horizontal */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* smooth scroll en móvil */
}

/* Tabla general */
table {
    width: 100%;
    border-collapse: collapse;
    max-width: 100%;
    table-layout: fixed;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Encabezados */
thead tr {
    background-color: #ccc;
}

thead th {
    padding: 10px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #999;
}

/* Filas alternadas */
tbody tr:nth-child(odd) {
    background-color: #f9f9f9;
}

tbody tr:nth-child(even) {
    background-color: #fff;
}

/* Celdas */
td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
}

/* Responsive - apilar filas */
@media (max-width: 600px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        display: none; /* ocultamos encabezados normales */
    }

    tbody tr {
        margin-bottom: 1.5em;
        box-sizing: border-box;
        border: 1px solid #ccc;
        border-radius: 8px;
        padding: 10px;
    }

    td {
        padding-left: 45%;
        position: relative;
        white-space: normal;
        border: none;
        border-bottom: 1px solid #eee;
    }

    td:last-child {
        border-bottom: 0;
    }

    /* Etiquetas a la izquierda usando data-label */
    td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        top: 10px;
        font-weight: bold;
        color: #555;
        white-space: nowrap;
    }
}
