/* ==========================================================================
   ESTILOS GENERALES Y RESETEO DE NAVEGADOR
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #F4F1EB; /* Fondo Principal Neutro */
    color: #2F3336; /* Texto Oscuro */
    font-family: 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
}

/* NAVBAR CORPORATIVA COMPLETA */
.main-header {
    background-color: #3F4548; /* Color Principal Madera */
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 100%;
}

.main-header .logo {
    color: #FCFBF8; /* Texto Claro Cerámica */
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 3px;
}

.main-header .nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

.main-header .nav-links a {
    color: #FCFBF8;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1px;
    transition: color 0.3s ease;
    padding: 5px 0;
}

.main-header .nav-links a:hover, 
.main-header .nav-links a.active {
    color: #C9B8A6; /* Detalles Cremas */
    border-bottom: 2px solid #C9B8A6;
}

.main-header .btn-logout {
    background-color: #7A6F65;
    padding: 8px 15px !important;
    border-radius: 6px;
}
.main-header .btn-logout:hover {
    background-color: #8B9B8A !important;
    color: #FCFBF8 !important;
    border-bottom: none !important;
}

/* CONTENEDOR DE LA PÁGINA */
.menu-page {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* SECCIÓN DE FILTROS */
.menu-filters-section {
    margin-bottom: 35px;
}

.filter-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.search-group input {
    padding: 12px 24px;
    width: 350px;
    border: 1px solid #C9B8A6;
    background-color: #FCFBF8;
    color: #2F3336;
    border-radius: 30px;
    outline: none;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.category-group {
    display: flex;
    gap: 12px;
}

.btn-cat {
    background: #3F4548;
    color: #FCFBF8;
    border: none;
    padding: 10px 24px;
    cursor: pointer;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-cat.active, .btn-cat:hover {
    background: #C9B8A6; 
    color: #2F3336;
}

/* GRILLA EN FORMATO ESTRICTO DE 3 COLUMNAS */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

@media (max-width: 992px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .products-grid { grid-template-columns: 1fr; }
    .filter-wrapper { flex-direction: column; align-items: stretch; }
    .search-group input { width: 100%; }
}

.product-card {
    background: #3F4548; /* Fondo de Tarjeta Oscuro */
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0,0,0,0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

.card-img-container {
    width: 100%;
    height: 220px;
    background-color: #2F3336;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-info h3 {
    margin: 0 0 10px 0;
    color: #FCFBF8;
    font-size: 1.4rem;
}

.card-info .description {
    color: #E5E1DA;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.card-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.card-footer-row .price {
    font-size: 1.35rem;
    color: #C9B8A6;
    font-weight: 700;
}

.btn-add-car {
    background: #C9B8A6;
    color: #2F3336;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.btn-add-car:hover {
    background: #8B9B8A; /* Acento Verde Oliva */
    color: #FCFBF8;
}

/* PAGINACIÓN */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 45px;
}

.page-link {
    background: #3F4548;
    color: #FCFBF8;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.2s;
}

.page-link.active, .page-link:hover {
    background: #8B9B8A;
    color: #FCFBF8;
}

/* ==========================================================================
   SISTEMA DE MODAL FIJO
   ========================================================================== */
.modal {
    display: none; 
    position: fixed;
    z-index: 9999; /* Por encima de cualquier elemento */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(47, 51, 54, 0.8); /* Fondo opaco elegante */
}

.modal-content {
    background-color: #F4F1EB;
    margin: 10% auto;
    padding: 30px;
    border-radius: 16px;
    width: 85%;
    max-width: 750px;
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.35);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 38px;
    font-weight: bold;
    color: #7A6F65;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #2F3336;
}

.modal-body-layout {
    display: flex;
    gap: 30px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.modal-img-container {
    flex: 1;
    min-width: 280px;
    height: 280px;
}

.modal-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.modal-info-container {
    flex: 1.2;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.modal-info-container h2 {
    color: #3F4548;
    font-size: 2rem;
    margin-bottom: 12px;
}

.modal-info-container p {
    color: #2F3336;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.modal-footer-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.modal-price {
    font-size: 1.8rem;
    color: #3F4548;
    font-weight: bold;
}

.btn-add-car-modal {
    background-color: #8B9B8A; /* Verde Oliva */
    color: #FCFBF8;
    border: none;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-add-car-modal:hover {
    background-color: #3F4548;
}

/* MENSAJES DE ESTADO AJAX */
.loading-text, .no-products, .error-text {
    grid-column: span 3;
    text-align: center;
    color: #7A6F65;
    font-size: 1.2rem;
    padding: 50px 0;
}