/* Reset de estilo básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Fuente básica */
body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

/* Cabecera */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background-color: #3e4e5e;
    color: white;
}

header img {
    max-width: 120px;
}

header h1 {
    font-size: 1.5rem;
}

/* Main Layout */
main {
    padding: 2rem;
    max-width: 1200px;
    margin: auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Sección de Tienda */
#eleTienda {
    margin-bottom: 2rem;
}

#eleTienda h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

select, input[type="text"], input[type="email"], input[type="tel"], input[type="number"] {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

select:focus, input:focus {
    outline: none;
    border-color: #3498db;
}

#divImagenTienda img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 1rem;
}

/* Sección de Errores */
#errores {
    margin: 2rem 0;
    display: none;
}

#textoErrores {
    font-size: 1.2rem;
    color: red;
    text-align: center;
}

/* Sección de Datos del Cliente */
#datosCliente h2,
#datosProductos h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

#camposCli label {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* Sección de Productos y Cálculos */
#datosProductos {
    margin-bottom: 2rem;
}

#div1 {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

#datosProducto,
#datosCant {
    flex: 1;
}

#datosCant button {
    background-color: #3498db;
    color: white;
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

#datosCant button:hover {
    background-color: #2980b9;
}

/* Precios */
#precios label,
#preciosMar label {
    display: block;
    font-size: 1rem;
    margin-top: 1rem;
}

#precios input,
#preciosMar input {
    width: 100%;
    padding: 0.8rem;
    margin-top: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #f9f9f9;
}

#precios input:read-only,
#preciosMar input:read-only{
    background-color: rgb(229, 237, 240);
}

/* Marcaje */
#marcaje {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #ecf0f1;
    border-radius: 8px;
}

#divFotolito {
    background-color: #f9cfcf;
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
}

#divFotolito p {
    text-align: center;
    font-weight: bold;
    color: #e74c3c;
}

/* Portes */

#portes{
    display: none;
    margin-top: 2rem;
    padding: 1rem;
    background-color: #ecf0f1;
    border-radius: 8px;
}

/* Tablas */
table {
    width: 100%;
    margin-top: 2rem;
    border-collapse: collapse;
}

table th,
table td {
    padding: 0.8rem;
    text-align: left;
    border: 1px solid #ddd;
}

table th {
    background-color: #3498db;
    color: white;
}

table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Botones */
button {
    padding: 0.8rem 2rem;
    margin-top: 1rem;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

button:hover {
    background-color: #2ecc71;
}

button:disabled {
    background-color: #95a5a6;
}

body, div, input, table, header, main {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.toggle-label {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

.toggle-ball {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    z-index: 2;
}

.toggle-icon {
    z-index: 1;
    font-size: 14px;
    width: 100%;
    text-align: center;
    color: #fff;
    transition: opacity 0.3s ease;
}

/* Ocultar checkbox real */
#modoOscuroToggle {
    display: none;
}

#modoOscuroToggle:checked + .toggle-label {
    background-color: #26a69a;
}

#modoOscuroToggle:checked + .toggle-label .toggle-ball {
    transform: translateX(24px);
}


/* Modo oscuro */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode header {
    background-color: #1f1f1f;
    color: white;
}

body.dark-mode main {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

/* Inputs */
body.dark-mode input,
body.dark-mode select {
    background-color: #2c2c2c;
    color: #e0e0e0;
    border: 1px solid #555;
}

body.dark-mode input:read-only{
    color: black;
}

/* Botones */
body.dark-mode button {
    background-color: #26a69a;
    color: white;
}
body.dark-mode button:hover {
    background-color: #2bbbad;
}

/* Tablas */
body.dark-mode table th {
    background-color: #263238;
}
body.dark-mode table td {
    background-color: #1c1c1c;
    color: #e0e0e0;
}

.dark-mode #portes {
    background-color: #2f3b46;
    color: #f0f0f0;
    border: 1px solid #4b5a69;
}

.dark-mode #divFotolito {
    background-color: #4b1e1e;
    color: #f9cfcf;
    border: 1px solid #e74c3c;
}

.dark-mode #marcaje {
    background-color: #2e3b48;
    color: #f0f0f0;
    border: 1px solid #4b5a69;
}

textarea{
    border-radius: 10px;
    padding: 20px;
}

/* Responsivo */
@media screen and (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: center;
    }

    #div1 {
        flex-direction: column;
    }

    #datosProducto,
    #datosCant {
        width: 100%;
    }

    table th, table td {
        font-size: 0.9rem;
        padding: 0.6rem;
    }

    button {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    body {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.2rem;
    }

    #eleTienda select,
    #camposCli input {
        font-size: 0.9rem;
    }

    table th, table td {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}