/* Importa una fuente profesional de Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

/* Estilos generales y del body */
body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f7fa; /* Un gris muy claro y profesional */
    color: #444;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
    gap: 30px;
}

/* ----------------------------------- */
/* --- Estilos de la BARRA LATERAL --- */
/* ----------------------------------- */
.sidebar {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 10px; /* Borde ligeramente más suave */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    border: 1px solid #e0e0e0;
}

.sidebar h3 {
    margin-top: 0;
    color: #1e3a5f; /* Azul oscuro para un look corporativo */
    font-size: 1.5em;
    font-weight: 700;
    border-bottom: 3px solid #73c000; /* Línea de acento verde */
    padding-bottom: 15px;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li a {
    display: block;
    text-decoration: none;
    color: #555;
    padding: 12px 18px;
    border-radius: 6px;
    transition: background-color 0.3s ease, color 0.3s ease, border-left 0.3s ease;
    font-weight: 500;
    font-size: 0.95em;
}

.sidebar li a:hover {
    background-color: #e6f7ff; /* Azul claro muy suave al pasar el ratón */
    color: #1e3a5f;
    font-weight: 600;
}

.sidebar ul li.current-page {
    /* Eliminamos el fondo gris para usar el borde izquierdo como indicador principal */
    background-color: transparent; 
    border-left: 5px solid #73c000; /* ¡Tu tono de verde en el borde izquierdo! */
    padding-left: 10px;
}

/* Estilo para el enlace en la página actual (resaltado) */
.sidebar ul li.current-page a,
.sidebar li a.active {
    background-color: #f0fff0; /* Fondo más suave, casi blanco */
    color: #73c000; /* Color del texto del enlace activo */
    font-weight: 700;
    border-radius: 0 6px 6px 0; /* Solo redondeado a la derecha, para resaltar el borde izquierdo */
}

/* --------------------------------------- */
/* --- Estilos de las TARJETAS PRODUCTO --- */
/* --------------------------------------- */
.products {
    flex-grow: 1;
    display: grid;
    gap: 25px; /* Más espacio entre tarjetas */
    padding: 5px;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); /* Tarjetas ligeramente más grandes */
}

.product-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); /* Sombra moderna y más suave */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid #f0f0f0; /* Borde muy sutil */
    min-height: 400px;
}

.product-card:hover {
    transform: translateY(-8px); /* Efecto de "levantamiento" más dramático */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18); /* Sombra más profunda al pasar el ratón */
}

.product-image-link { /* Clase nueva para el enlace de la imagen */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 200px; /* Imagen ligeramente más grande */
    overflow: hidden;
    background-color: #ffffff; /* ¡Fondo de la imagen ahora es blanco! */
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.product-card img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-card:hover img {
    transform: scale(1.05); /* Zoom sutil en la imagen al hacer hover en la tarjeta */
}

.product-title-link { /* Clase nueva para el enlace del título */
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-card h4 {
    color: #1e3a5f; /* Mismo azul corporativo */
    font-size: 1.1em;
    font-weight: 700;
    line-height: 1.3;
    margin: 15px 15px 5px;
    min-height: 55px; /* Más espacio para títulos largos */
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.product-title-link:hover h4 {
    color: #73c000; /* Resaltar el título al pasar el ratón */
}

.product-card p {
    color: #777;
    font-size: 0.9em;
    font-weight: 500;
    margin: 0 15px 10px;
}

.product-card .button-container {
    margin-top: auto;
    padding: 15px;
}

/* Estilo para el botón de Ficha Técnica */
.product-card a:not(.product-image-link):not(.product-title-link) {
    display: block; /* Cambiado a block para que ocupe todo el ancho del padding */
    width: auto;
    padding: 12px 15px;
    background-color: #73c000; 
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.3s ease, box-shadow 0.2s ease;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    box-shadow: 0 4px 8px rgba(115, 192, 0, 0.4); /* Sombra suave para el botón */
}

.product-card a:not(.product-image-link):not(.product-title-link):hover {
    background-color: #5a9e00; 
    box-shadow: 0 6px 12px rgba(115, 192, 0, 0.6);
    transform: none; /* Asegura que el botón no se escale */
}


/* --------------------------------------- */
/* --- Media Queries para responsividad --- */
/* --------------------------------------- */
@media (min-width: 768px) {
    .container {
        flex-direction: row;
        padding: 40px;
    }
    .sidebar {
        width: 250px; /* Un poco más angosto para optimizar el espacio */
    }
    .products {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Mejor adaptación en tablets */
    }
}

@media (min-width: 1024px) {
    .products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .products {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --------------------------------------- */
/* --- Estilos para el Modal (no modificado significativamente) --- */
/* --------------------------------------- */
.product-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.product-modal.show-modal {
    display: flex;
}

.modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    max-width: 700px;
    width: 100%;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

.modal-content h3 {
    color: #333;
    font-size: 1.8em;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.modal-body {
    line-height: 1.6;
    color: #555;
    font-size: 1.05em;
}

.modal-body h4 {
    color: #73c000;
    font-size: 1.3em;
    margin-top: 25px;
    margin-bottom: 8px;
    font-weight: 600;
}

.modal-body p {
    margin-bottom: 15px;
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fafafa;
}