/* General */
* {
    margin: 0;
    padding: 0;
    font-family: poppins, sans-serif;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    box-sizing: border-box;
}

body {
    display: flex;
    min-height: 100vh;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    padding: 100px 0;
    background: linear-gradient(45deg, rgba(88,28,116,1) 0%, rgba(1,111,186,1) 72%);
    background-size: cover;
    background-attachment: fixed;
}

::-webkit-scrollbar {
    display: none;
}

/* Contenedor principal */
.contenedor-admin {
    display: flex;
    flex-direction: column;
    background: white;
    width: 1100px;
    max-width: 100%;
    margin: auto;
    padding: 25px 25px;
    border-radius: 25px;
    gap: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Header del panel de administración */
.header-admin {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.logo-principal {
    width: 200px;
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
}

/* Formulario y campos */
form {
    gap: 25px;
    display: flex;
    flex-direction: column;
}

.row {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 25px;
}

.campo {
    width: 100%;
    margin-bottom: 15px;
}

/* Imágenes y logo */
img.logo-actual {
    width: 50px;
    height: 50px;
}

.logo-actual {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Inputs y selects */
.file-input {
    width: 100%;
    max-width: 100%;
}

input#mostrar_stock_total {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

input:not([type="checkbox"]), select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    margin-bottom: 10px;
    box-sizing: border-box;
    max-width: 100%;
}

select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: white;
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1em;
    padding-right: 30px;
}

.select-container {
    width: 100%;
    margin-bottom: 20px;
}

.select-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

/* Checkboxes */
input[type="checkbox"] {
    width: auto;
    margin-left: 10px;
    margin-right: 10px;
    vertical-align: middle;
    height: 18px;
    width: 18px;
}

.row label + input[type="checkbox"] {
    margin-left: 10px;
}

/* Campos especiales */
.campo-readonly {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
    width: 100%;
    box-sizing: border-box;
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
    word-break: break-word;
}

#campoSucursales, #campoPrecioSecundario {
    margin-top: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #eee;
    width: 100%;
    box-sizing: border-box;
}

input#sucursales {
    width: 100%;
}

input#mostrar_precio_secundario {
    width: 20px;
}

input#mostrar_descuento {
    width: 20px;
}

/* Títulos y textos */
h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.nota {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    margin-bottom: 10px;
}

/* Mensajes y alertas */
.message, .actualizacion {
    padding: 10px;
    background-color: #d4edda;
    color: #155724;
    border-radius: 5px;
    margin-top: 10px;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    color: #721c24;
    background-color: #f8d7da;
    padding: 5px 10px;
    margin-top: 5px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 15px;
    width: 100%;
}

.error-message a {
    color: #721c24;
    text-decoration: underline;
}

/* Botones */
button {
    grid-column: span 2; /* El botón ocupa toda la fila */
    border-radius: 50px;
    outline: none;
    border: none;
    background: var(--color-principal);
    color: white;
    padding: 10px;
    box-sizing: border-box;
    font-size: 16px;
    transition: all 0.3s ease; 
    cursor: pointer;
    width: 100%;
}

button:hover {
    opacity: 0.8;
}

button[type="submit"] {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: var(--color-principal, #3498db);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-width: 100%;
}

button[type="submit"]:hover {
    opacity: 0.9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

button[type="submit"]:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Enlaces de administración */
.admin-links {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 100%;
}

.btn-admin {
    display: block;
    padding: 12px 15px;
    background-color: var(--color-principal, #3498db);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    width: 100%;
    box-sizing: border-box;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-admin:hover {
    opacity: 0.9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-logout {
    display: block;
    padding: 12px 15px;
    background-color: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    margin-top: 15px;
    width: 100%;
    box-sizing: border-box;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-logout:hover {
    opacity: 0.9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-link {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #856404;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

/* Estilos para el selector de color */
.style2 {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 40px;
    background-color: transparent;
    border: none;
    cursor: pointer;
}

.style2::-webkit-color-swatch {
    border-radius: 5px;
    border: none;
}

.style2::-moz-color-swatch {
    border-radius: 5px;
    border: none;
}

/* Media Queries para Responsive Design */

/* Tablets (hasta 1024px) */
@media screen and (max-width: 1024px) {
    .contenedor-admin {
        width: 90%;
        padding: 20px;
    }
    
    .logo-principal {
        width: 180px;
    }
    
    h1 {
        font-size: 22px;
    }
}

/* Tablets pequeñas y móviles grandes (hasta 768px) */
@media screen and (max-width: 768px) {
    body {
        padding: 50px 0;
    }
    
    .contenedor-admin {
        width: 95%;
        padding: 15px;
        gap: 15px;
    }
    
    .row {
        flex-direction: column;
        gap: 10px;
    }
    
    .campo {
        width: 100%;
    }
    
    .logo-principal {
        width: 150px;
    }
    
    h1 {
        font-size: 20px;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    button[type="submit"] {
        padding: 12px;
        font-size: 16px;
    }
    
    .btn-admin, .btn-logout {
        padding: 10px;
    }
    
    /* Ajustar campos con checkboxes */
    .row label {
        margin-bottom: 5px;
    }
    
    .row label + input[type="checkbox"] {
        margin-left: 0;
        margin-top: 5px;
    }
}

/* Móviles (hasta 480px) */
@media screen and (max-width: 480px) {
    body {
        padding: 20px 0;
    }
    
    .contenedor-admin {
        width: 100%;
        border-radius: 0;
        padding: 15px 10px;
    }
    
    .logo-principal {
        width: 120px;
    }
    
    h1 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    label {
        font-size: 14px;
    }
    
    input:not([type="checkbox"]), select, textarea {
        padding: 8px;
        font-size: 14px;
    }
    
    .nota {
        font-size: 11px;
    }
    
    button[type="submit"] {
        padding: 10px;
        font-size: 15px;
        margin-top: 15px;
        margin-bottom: 15px;
    }
    
    .admin-links {
        gap: 10px;
    }
    
    .btn-admin, .btn-logout {
        padding: 8px;
        font-size: 14px;
    }
    
    .error-message {
        font-size: 12px;
        padding: 5px 8px;
    }
    
    /* Ajustes adicionales para móviles pequeños */
    .campo-readonly {
        font-size: 13px;
        padding: 8px;
    }
    
    #campoSucursales, #campoPrecioSecundario {
        padding: 10px;
    }
    
    /* Mejorar la visualización de los checkboxes */
    input[type="checkbox"] {
        height: 16px;
        width: 16px;
    }
}

/* Móviles muy pequeños (hasta 360px) */
@media screen and (max-width: 360px) {
    .contenedor-admin {
        padding: 10px 8px;
    }
    
    .logo-principal {
        width: 100px;
    }
    
    h1 {
        font-size: 16px;
        margin-bottom: 8px;
        padding-bottom: 8px;
    }
    
    label {
        font-size: 13px;
    }
    
    input:not([type="checkbox"]), select, textarea {
        padding: 7px;
        font-size: 13px;
    }
    
    .nota {
        font-size: 10px;
    }
    
    button[type="submit"] {
        padding: 8px;
        font-size: 14px;
    }
    
    .btn-admin, .btn-logout {
        padding: 7px;
        font-size: 13px;
    }
}
