#form-container{
    max-width: 50%;
}
.form-create.form-import{
    max-width: 50%;
}
.container{
    max-width: 95%;
    margin:0 auto;
    min-height: 900px;
}
.footer{
    background-color: #000;
    color: #fff;
    margin-top: 50px;
    padding: 20px 0;
}
.footer p{
    color: #fff;
    margin-bottom: 0;
    text-align: center;
    font-size: 1em;
}
.container-footer{
    max-width: 95%;
    margin:0 auto;
}
.nav{
    padding: 15px 50px; 
    background: #000; 
    color: white; 
    margin-bottom: 20px;
}
.nav a{
    color: white; 
    margin-right: 15px;
}
.nav a.logout{
    color: white; 
    float: right;
}


.btn-edit {
    padding: 6px 12px;
    background-color: #3498db; /* Azul */
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: inline-block;
}

/* Botón Borrar - Nuevo */
.btn-delete {
    padding: 6px 12px;
    background-color: #e74c3c; /* Rojo elegante */
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin-left: 5px; /* Espacio respecto al botón anterior */
}

/* Efectos visuales para mejorar la experiencia */
.btn-edit:hover { background-color: #2980b9; }
.btn-delete:hover { background-color: #c0392b; }

.btn-add {
    padding: 10px 20px;
    background-color: #fff;
    color: #27ae60;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 20px;
    display: inline-block;
    font-weight: normal;
    border: 1px solid #27ae60;
    font-weight: bold;
}

/* Efecto al pasar el ratón */
.btn-add:hover { 
    background-color: #219150;
    color: #fff; 
}

.btn-save {
    padding: 10px 20px;
    background-color: #2c3e50; /* Azul oscuro elegante */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    width: 100%;
}

.btn-save:hover {
    background-color: #34495e;
}

/* Opcional: Para que el enlace 'Cancelar' se vea bien */
.btn-cancel {
    color: #fff;
    text-decoration: none;
    font-size: 1em;
    background: #7f8c8d;
    width: 100%;
    display: inline-block;
    margin: 10px 0;
    padding: 10px 0;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}
.btn-cancel:hover {
    color: #fff;
}



/* =======================================================
   style.css - Estilos CSS (Versión Unificada y Responsive)
   ======================================================= */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px; /* Base padding para desktop */
    background-color: #f4f7f6; /* Color de fondo actualizado */
    color: #333;
}

h1, h2 {
    color: #000;
    border-bottom: 2px solid #000; /* Añadido de tu versión anterior */
    padding-bottom: 10px; /* Añadido de tu versión anterior */
}

hr {
    border: 0;
    height: 1px;
    background-color: #ccc;
    margin: 20px 0;
}

/* --- Mensajes --- */
.success {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* --- Botones y Enlaces Genéricos (CRUD, Navegación) --- */
a {
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-edit, .btn-delete, .btn-back {
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    margin: 10px 0;
    display: inline-block;
    text-align: center;
    border:0;
    padding: 10px 15px;

}

.btn-edit {
    background-color: #f39c12;
    color: white;
}
.btn-delete {
    background-color: #e74c3c;
    color: white;
    border: none;
    cursor: pointer;
}
.btn-back {
    background-color: #7f8c8d;
    color: white;
    width: 100%;
}

/* =======================================================
   ESTILOS DE FORMULARIO (form-create)
   ======================================================= */
.form-create {
    /*background: white;*/
    padding: 20px;
    border-radius: 8px;
    /*box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);*/
    display: grid;
    grid-template-columns: 1fr; /* Una columna por defecto */
    gap: 15px;
    margin-bottom: 20px;
}

.form-create label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    grid-column: 1 / -1; /* Ocupa todo el ancho en móvil */
}

.form-create input[type="text"],
.form-create input[type="number"],
.form-create textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; 
}

.form-create button[type="submit"] {
    background-color: #fff;
    border: 1px solid #27ae60;
    color: #27ae60;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    grid-column: 1 / -1; /* Botón a ancho completo */
    margin-top: 10px;
    max-width: 100%;
    font-weight: bold;
}

/* Separación visual para el formato CSV */
.csv-format-box {
    background-color: #ecf0f1;
    border: 1px solid #bdc3c7;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

/* =======================================================
   ESTILOS DE TABLAS (Desktop First / Mobile Last)
   ======================================================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
}

th, td {
    border: 1px solid #ddd;
    padding: 12px 8px;
    text-align: left;
    font-size: 13px;
}

th {
    background-color: #000; /* Color oscuro para th principal */
    color: white;
    font-weight: bold;
}

/* Estilo para las filas de modelos principales */
.model-row {
    cursor: pointer;
    background-color: #ecf0f1;
    transition: background-color 0.3s;
}

.model-row:hover {
    background-color: #d5dbdb;
}

/* Estilo para la subtabla de acabados */
.acabados-subtable {
    width: 98%;
    margin: 10px auto;
    border: none;
}

.acabados-subtable th {
    background-color: #000; /* Color oscuro para th subtabla */
}

.acabados-subtable td {
    font-size: 0.9em;
}

/* --- Login Contenedor (Mantenido Responsive) --- */
.login-container {
    width: 90%; /* Responsive width */
    max-width: 300px; /* Limitador */
    margin: 100px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    box-sizing: border-box;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%; /* Ajuste a 100% de su contenedor */
    padding: 10px;
    margin: 8px 0;
    box-sizing: border-box;
}


/* =======================================================
   MEDIA QUERIES (Mobile View)
   ======================================================= */
@media (max-width: 768px) {
    
    body {
        padding: 10px; /* Reducir padding en móvil */
    }

    h1 {
        font-size: 1.5em;
        margin-bottom: 10px;
    }
    
    /* 🚨 CLAVE: Mueve los botones superiores para que sean una columna */
    div[style*="float: right;"] {
        float: none !important;
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 20px;
        margin-top: 10px !important;
    }
    
    div[style*="float: right;"] a, 
    div[style*="float: right;"] button {
        width: 100%;
        box-sizing: border-box;
        margin-right: 0 !important;
    }
    
    /* --- Tablas Responsive (CLAVE) --- */
    table, .acabados-subtable {
        border: 0;
    }

    table thead, .acabados-subtable thead {
        display: none;
    }

    table tr, .acabados-subtable tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
    }
    
    .acabados-detail-row {
        /* Eliminamos el !important aquí. Dejamos el control a JS. */
        /* El display:none original ya se aplica en index.php inline style. */
        /* Aseguramos que la celda que contiene la subtabla no tenga relleno/borde extra en móvil */
        padding: 0;
        border: none;
        margin: 0;
    }

    table td, .acabados-subtable td {
        display: block;
        text-align: right;
        border-bottom: 1px dotted #ccc;
        position: relative;
        padding-left: 50%;
        font-size: 1em;
    }

    table td::before, .acabados-subtable td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-left: 10px;
        font-weight: bold;
        text-align: left;
        color: #555;
    }
    .acabados-subtable td[data-label="P. Financiado"]::before {
        content: "P. Financiado";
    }
    .form-create textarea {
         grid-column: 1 / -1; /* Esto asegura que ocupe todo el ancho del grid */
    }
    .acabados-subtable td[data-label="SKU"]::before {
        content: "SKU";
    }
    .acabados-detail-row td {
        border: none;
        padding: 0;
    }

    .model-row td:nth-child(3)::before { content: "Acciones"; }

}

/* --- Media Query Específica para Formularios (Desktop) --- */
/*
@media (min-width: 768px) {
    
    .form-create {
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .form-create button[type="submit"] {
        grid-column: 1 / -1; 
    }
    
    .form-create-vehiculo {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .form-create-vehiculo label,
    .form-create-vehiculo input {
        grid-column: span 1;
    }
}*/



/* Estilos Generales */
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f4f7f6; padding: 0px; color: #333; }

/* Tabla Principal */
table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid #ddd; }
th { background-color: #000; color: white; }
tr.vehicle-row:hover { background-color: #f1f1f1; cursor: pointer; }

/* Detalles (Filas ocultas) */
.caracteristicas-detail-row, .acabados-detail-row { background-color: #fafafa; }
.caracteristicas-container, .acabados-container { padding: 20px; border: 1px solid #ddd; margin: 10px; border-radius: 8px; background: #fff; }

/* Estilo de Botones */
.btn-edit { background-color: #3498db; color: white; padding: 8px 12px; border-radius: 4px; text-decoration: none; font-size: 14px; transition: 0.3s; }
.btn-edit:hover { background-color: #2980b9; }

.btn-delete { background-color: #e74c3c; color: white; padding: 8px 12px; border-radius: 4px; text-decoration: none; font-size: 14px; }
.btn-delete:hover { background-color: #c0392b; }

/* Formulario de Edición (editar_caracteristicas.php) */
.edit-form { background: white; padding: 30px; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); max-width: 50%; margin-top: 20px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 5px; }
.form-group input, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; }

.btn-save { background-color: #27ae60; color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; }
.btn-save:hover { background-color: #219150; }


.form-group select{
    width: 100%;
    padding: 10px;
    border:1px solid #ccc;
}


/* Botón principal de acción */
.btn-primary { 
    background-color: #2c3e50; 
    color: white; 
    padding: 10px 15px; 
    border-radius: 5px; 
    text-decoration: none; 
    display: inline-block; 
    margin-bottom: 20px;
}
.btn-primary:hover { background-color: #34495e; }

/* Botón pequeño para añadir acabado */
.btn-add-acabado {
    background-color: #27ae60;
    color: white;
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 4px;
    text-decoration: none;
    margin-left: 10px;
    font-weight: bold;
}
.btn-add-acabado:hover { background-color: #219150; }

/* Ajuste para que las acciones en la tabla no ocupen mucho */
.actions-cell { white-space: nowrap; }
.actions-cell a { margin-right: 5px; }