/* Variables de Color */
:root {
    --dark-red: #8B0000; /* Lo mantenemos como un rojo muy oscuro para las sombras */
    --main-blood-red: #AE0505; /* Tu nuevo rojo principal */
    --black: #050505; /* Un negro aún más puro */
    --dark-gray: #151515; /* Gris muy oscuro para fondos intermedios */
    --off-white: #EDEDED; /* Blanco más suave para texto, tirando a gris claro */

    /* Variables específicas para el estilo de Bloodgear */
    --table-background-color: rgba(10, 10, 10, 0.95); /* Fondo semi-transparente oscuro más opaco */
    --table-border-color: var(--main-blood-red); /* Borde de tabla y campos, usando el nuevo rojo principal */
    --header-background-color: #100000; /* Un negro rojizo muy oscuro para encabezados */
    --row-even-color: rgba(30, 30, 30, 0.8); /* Fondo para filas pares o inputs ligeramente más claro */
    --row-hover-color: #380000; /* Un rojo oscuro para hover */
    --shadow-red-light: rgba(174, 5, 5, 0.3); /* Sombra más clara basada en el nuevo rojo */
    --shadow-red-strong: rgba(174, 5, 5, 0.7); /* Sombra más fuerte basada en el nuevo rojo */
}

/* Reset básico y fuente global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

/* Estilos del cuerpo - Fondo oscuro y texto claro */
body {
    background-color: var(--black);
    color: var(--off-white);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Contenedor general para centrar el contenido */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Estilos para el título H1 (generalmente para la página) */
h1 {
    font-size: 3.5em;
    font-weight: bold;
    color: var(--main-blood-red); /* Usando el nuevo rojo principal */
    text-align: center;
    letter-spacing: 3px;
    text-shadow: 0 0 15px var(--shadow-red-strong), 0 0 25px rgba(174, 5, 5, 0.3);
    margin-bottom: 40px;
    margin-top: 30px;
    text-transform: uppercase;
}

/* Estilos para H2 de sección */
section h2 {
    font-size: 2.5em;
    color: var(--main-blood-red); /* Usando el nuevo rojo principal */
    text-shadow: 0 0 12px var(--shadow-red-light), 0 0 20px rgba(174, 5, 5, 0.2);
    margin-bottom: 40px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: bold;
}

/* Estilos generales para enlaces */
a {
    color: var(--main-blood-red); /* Usando el nuevo rojo principal */
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

a:hover {
    color: var(--off-white);
    text-shadow: 0 0 8px var(--main-blood-red), 0 0 15px rgba(174, 5, 5, 0.2);
}

/* Botones generales */
.btn {
    display: inline-block;
    background-color: var(--dark-red); /* Fondo oscuro pero en la gama del rojo */
    color: var(--off-white);
    padding: 15px 30px;
    border-radius: 5px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    font-size: 1.1em;
    font-weight: bold;
    border: 1px solid var(--main-blood-red); /* Borde con el nuevo rojo principal */
    cursor: pointer;
    box-shadow: 0 0 15px var(--shadow-red-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    background-color: var(--main-blood-red); /* Resalta con el nuevo rojo principal */
    box-shadow: 0 0 25px var(--shadow-red-strong), 0 0 40px rgba(174, 5, 5, 0.5);
    transform: translateY(-2px);
}

/* Header */
.header {
    background-color: var(--dark-gray);
    color: var(--off-white);
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--main-blood-red); /* Borde con el nuevo rojo principal */
    box-shadow: 0 5px 20px rgba(0,0,0,0.5), 0 0 25px var(--shadow-red-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 80px;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
    padding: 0 20px;
}

/* AJUSTE: Estilos para el logo de imagen */
.logo {
    margin: 0;
    padding: 0;
}

.logo img {
    height: 60px; /* Mantener el tamaño original del logo */
    width: auto;
    display: block;
    object-fit: contain;
    /* *** MODIFICACIÓN: ELIMINADO EL EFECTO DE BRILLO (drop-shadow) *** */
    /* filter: drop-shadow(0 0 10px var(--main-blood-red)) drop-shadow(0 0 20px var(--shadow-red-strong)); */
    transition: filter 0.3s ease, transform 0.2s ease;
}

.logo img:hover {
    transform: scale(1.05);
    /* Mantener el efecto de hover si lo deseas, aunque sin el brillo inicial no será tan pronunciado */
    /* filter: drop-shadow(0 0 15px var(--main-blood-red)) drop-shadow(0 0 30px var(--shadow-red-strong)); */
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-nav ul li {
    margin-left: 30px;
}

.main-nav ul li a {
    color: var(--off-white);
    padding: 8px 0;
    font-weight: bold;
    font-size: 1.1em;
    transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main-nav ul li a:hover {
    color: var(--main-blood-red); /* Usando el nuevo rojo principal */
    text-shadow: 0 0 10px var(--main-blood-red), 0 0 20px rgba(174, 5, 5, 0.3);
    transform: translateY(-2px);
}

/* Nuevo contenedor para los botones de idioma fijo */
.top-right-fixed-container {
    position: fixed;
    top: 10px;
    right: 10px;
    transform: none;
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

/* Estilos para los botones de idioma (ahora dentro del nuevo contenedor) */
.language-switcher {
    display: flex;
    gap: 10px;
}

.language-switcher button {
    background-color: var(--dark-red);
    color: var(--off-white);
    border: 1px solid var(--main-blood-red); /* Usando el nuevo rojo principal */
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 8px rgba(174, 5, 5, 0.2);
}

.language-switcher button:hover {
    background-color: var(--main-blood-red); /* Usando el nuevo rojo principal */
    box-shadow: 0 0 15px var(--shadow-red-strong);
}

.language-switcher button.active {
    background-color: var(--main-blood-red); /* Usando el nuevo rojo principal */
    color: var(--black);
    border-color: var(--main-blood-red);
    box-shadow: 0 0 15px var(--shadow-red-strong);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://via.placeholder.com/1500x600/100000/ae0505?text=TU+BANNER+IMPACTANTE+AQUI') no-repeat center center/cover; /* Usando el nuevo rojo principal en el placeholder */
    color: var(--off-white);
    text-align: center;
    padding: 120px 0;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-bottom: 2px solid var(--main-blood-red); /* Borde con el nuevo rojo principal */
    box-shadow: inset 0 0 40px rgba(0,0,0,0.8);
    margin-bottom: 80px; /* Nuevo margen inferior para compensar el <hr> eliminado */
}

/* AJUSTE: Título "El Poder Espera en Cada Artículo" 50% más pequeño */
.hero h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: var(--main-blood-red); /* Usando el nuevo rojo principal */
    text-shadow: 0 0 20px var(--shadow-red-strong), 0 0 35px rgba(174, 5, 5, 0.4);
    text-transform: uppercase;
    letter-spacing: 4px;
}

.hero p {
    font-size: 1.5em;
    margin-bottom: 50px;
    color: var(--off-white);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

/* Secciones generales */
section {
    padding: 80px 0;
    text-align: center;
    background-color: var(--black);
}

section:last-of-type {
    border-bottom: none;
}

/* Modificación para el anclaje de categoría */
.category-menu {
    background-color: var(--dark-gray);
    padding: 25px 0;
    text-align: center;
    border-bottom: 2px solid var(--main-blood-red); /* Borde con el nuevo rojo principal */
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    position: sticky;
    top: 80px;
    z-index: 990;
    margin-bottom: 40px;
}

/* Estilos para el menú de categorías */
.category-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
}

.category-menu ul li {
    position: relative;
}

.category-menu ul li a {
    color: var(--off-white);
    font-weight: bold;
    /* --- MODIFICACIÓN: BOTONES DE CATEGORÍA 25% MÁS PEQUEÑOS --- */
    /* Originalmente tenías: padding: 10px 20px; font-size: 1.1em; */
    padding: 7.5px 15px; /* Reducido un 25% del padding original */
    font-size: 0.825em; /* Reducido un 25% del font-size original (1.1em * 0.75) */
    /* ------------------------------------------------------------- */
    border: 1px solid var(--dark-red); /* Borde con rojo oscuro */
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 0 8px rgba(174, 5, 5, 0.2);
    cursor: pointer;
    display: block;
}

.category-menu ul li a:hover,
.category-menu ul li a.active {
    background-color: var(--main-blood-red); /* Usando el nuevo rojo principal */
    color: var(--black);
    border-color: var(--main-blood-red);
    box-shadow: 0 0 15px var(--shadow-red-strong);
    transform: translateY(-2px);
}

/* Products Section */
.products {
    background-color: var(--black);
    padding-top: calc(80px + 70px + 40px + 80px); /* Ajustado para el sticky menu + margen */
    position: relative;
    z-index: 1;
    margin-bottom: 80px; /* Nuevo margen inferior para compensar el <hr> eliminado */
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
    /* --- INICIO DE LAS MODIFICACIONES PARA 3 POR LÍNEA --- */
    max-width: 960px; /* Limita el ancho máximo del contenedor de la cuadrícula para 3 columnas de 280px + 2*30px de gap */
    margin-left: auto; /* Centra la cuadrícula */
    margin-right: auto; /* Centra la cuadrícula */
    /* --- FIN DE LAS MODIFICACIONES PARA 3 POR LÍNEA --- */
}

.product-item {
    background-color: var(--table-background-color);
    border: 2px solid var(--main-blood-red); /* Borde con el nuevo rojo principal */
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 0 25px var(--shadow-red-strong);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 480px;
    min-width: 280px;
}

.product-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    border: 2px solid transparent;
    pointer-events: none;
    transition: border-color 0.3s ease;
}

.product-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 40px var(--shadow-red-strong), 0 0 60px rgba(174, 5, 5, 0.4);
    border-color: var(--main-blood-red); /* Usando el nuevo rojo principal */
}

.product-item p.category {
    font-size: 0.9em;
    color: var(--off-white);
    margin-top: 10px;
    margin-bottom: 0px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.product-item img {
    max-width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 15px;
    border: 1px solid var(--main-blood-red); /* Borde con el nuevo rojo principal */
    box-shadow: 0 0 10px var(--shadow-red-light);
    transition: transform 0.3s ease;
    cursor: pointer; /* Added cursor pointer to indicate clickability */
}

.product-item h3 {
    font-size: 0.9em;
    margin-bottom: 10px;
    color: var(--off-white);
    text-shadow: 0 0 5px rgba(255,255,255,0.2);
    text-transform: uppercase;
}

.product-item .price {
    font-size: 1.8em;
    color: var(--main-blood-red); /* Usando el nuevo rojo principal */
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 0 12px var(--shadow-red-strong);
    letter-spacing: 1px;
}

.marketplace-btn {
    background-color: var(--main-blood-red); /* Fondo con el nuevo rojo principal */
    color: var(--black);
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    box-shadow: 0 0 15px var(--shadow-red-strong);
    text-transform: uppercase;
    margin-top: auto;
}

.marketplace-btn:hover {
    background-color: var(--dark-red); /* Cambio a rojo oscuro en hover */
    color: var(--off-white); /* Texto blanco en hover */
    box-shadow: 0 0 25px var(--shadow-red-strong), 0 0 40px rgba(174, 5, 5, 0.5);
    transform: translateY(-2px);
}

/* Offers Section */
.offers {
    background-color: var(--black);
    padding-top: 80px;
    margin-bottom: 80px; /* Nuevo margen inferior para compensar el <hr> eliminado */
}

.offer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.offer-item {
    background-color: var(--table-background-color);
    border: 2px solid var(--main-blood-red);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 0 20px var(--shadow-red-strong);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.offer-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 0 35px var(--shadow-red-strong), 0 0 50px rgba(174, 5, 5, 0.4);
}

.offer-item img {
    max-width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid var(--main-blood-red);
    box-shadow: 0 0 10px var(--shadow-red-light);
}

.offer-item h3 {
    font-size: 1.6em;
    color: var(--off-white);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.offer-item p {
    font-size: 1em;
    color: var(--off-white);
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Contact Section */
.contact {
    padding-top: 80px;
    padding-bottom: 80px; /* Ajusta este padding si el espacio es excesivo */
    margin-bottom: 80px; /* Añadido margen inferior para la sección de contacto */
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    background-color: var(--dark-gray);
    border: 1px solid var(--main-blood-red);
    color: var(--off-white);
    padding: 15px;
    border-radius: 5px;
    font-size: 1em;
    width: 100%;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    border-color: var(--off-white);
    box-shadow: 0 0 15px var(--shadow-red-strong);
    outline: none;
}

.contact-form .btn {
    align-self: center; /* Centra el botón */
    margin-top: 20px;
}

/* Footer */
.footer {
    background-color: var(--dark-gray);
    color: var(--off-white);
    text-align: center;
    padding: 25px 0;
    font-size: 0.9em;
    border-top: 2px solid var(--main-blood-red);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5), 0 0 25px var(--shadow-red-light);
}

/* Media Queries para Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 25px;
    }
    .main-nav ul li {
        margin-left: 20px;
    }
    .top-right-fixed-container {
        position: static; /* Cambiar a estático en pantallas más pequeñas */
        margin-top: 10px;
        margin-right: 0;
        transform: none;
        width: 100%;
        justify-content: flex-end; /* Alinear a la derecha dentro del header */
        padding-right: 20px;
    }
    .header .container {
        flex-wrap: wrap;
        justify-content: center;
        height: auto;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .logo {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    .main-nav {
        width: 100%;
        text-align: center;
    }
    .main-nav ul {
        justify-content: center;
    }
    .products {
        padding-top: 80px; /* Ajustar padding ya que el top fijo cambia */
    }
    /* --- INICIO DE LAS MODIFICACIONES PARA RESPONSIVIDAD DEL GRID --- */
    .product-grid {
        max-width: unset; /* IMPORTANTE: Desactiva el max-width para que la cuadrícula se adapte en pantallas más pequeñas */
    }
    /* --- FIN DE LAS MODIFICACIONES PARA RESPONSIVIDAD DEL GRID --- */
}

@media (max-width: 768px) {
    h1 { font-size: 2.8em; margin-bottom: 30px; }
    section h2 { font-size: 2em; margin-bottom: 35px; }
    .hero { padding: 90px 0; min-height: 400px; }
    .hero h2 { font-size: 1.8em; letter-spacing: 3px; }
    .hero p { font-size: 1.2em; margin-bottom: 40px; }
    .btn, .marketplace-btn { padding: 12px 25px; font-size: 1em; }
    .main-nav ul {
        flex-direction: column;
        gap: 10px;
    }
    .main-nav ul li {
        margin-left: 0;
    }
    .category-menu {
        top: auto;
        position: static;
        margin-bottom: 20px;
        padding: 15px 0;
    }
    .products {
        padding-top: 50px;
    }
}

@media (max-width: 480px) {
    .container { padding: 0 15px; }
    .logo img {
        height: 40px;
    }
    .hero { padding: 60px 0; min-height: 300px; }
    .hero h2 { font-size: 1.5em; letter-spacing: 1px; }
    .hero p { font-size: 0.9em; margin-bottom: 30px; }
    .btn, .marketplace-btn { padding: 10px 18px; font-size: 0.9em; }
    section { padding: 50px 0; }
    section h2 { font-size: 1.8em; margin-bottom: 30px; letter-spacing: 1px; }
    .product-grid { grid-template-columns: 1fr; }
    .product-item {
        padding: 15px;
        height: 350px;
        border-width: 1px;
    }
    .product-item img { height: 120px; }
    .product-item h3 { font-size: 1.1em; }
    .product-item .price { font-size: 1.3em; }
    .offer-item { padding: 25px; }
    .offer-item h3 { font-size: 1.8em; }
    .offer-item p { font-size: 0.9em; }
    .contact-form { padding: 25px; }
    .form-group label { font-size: 0.9em; }
    .form-group input, .form-group textarea { padding: 10px; font-size: 0.9em; }
    .header {
        height: auto;
        padding: 8px 0;
    }
    .category-menu {
        top: auto;
        position: static;
    }
    .products {
        padding-top: 40px;
    }
}
/* Estilos para el Pop-up de Mensajes */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Fondo oscuro semitransparente */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Asegura que esté por encima de otros elementos */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background-color: var(--dark-gray); /* Fondo oscuro, similar al resto de tu tema */
    color: var(--off-white); /* Texto claro */
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    text-align: center;
    position: relative;
    border: 2px solid var(--main-blood-red); /* Borde rojo */
}

.popup-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2em;
    color: var(--off-white);
    cursor: pointer;
    line-height: 1;
}

.popup-close-btn:hover {
    color: var(--main-blood-red);
}

.popup-content h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: var(--main-blood-red); /* Título en rojo */
}

.popup-content p {
    font-size: 1.1em;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Estilos específicos para mensajes de éxito/error */
.popup-content.success {
    border-color: #28a745; /* Verde para éxito */
}
.popup-content.success h3 {
    color: #28a745;
}

.popup-content.error {
    border-color: #dc3545; /* Rojo para error */
}
.popup-content.error h3 {
    color: #dc3545;
}

/* Overlay para la imagen ampliada */
.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-overlay img {
    max-width: 90%;
    max-height: 90%;
    border: 3px solid var(--main-blood-red); /* Borde con el nuevo rojo principal */
    box-shadow: 0 0 30px var(--shadow-red-strong), 0 0 60px rgba(174, 5, 5, 0.5);
    border-radius: 8px;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.image-overlay.active img {
    transform: scale(1);
}

.image-overlay .close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5em;
    color: var(--off-white);
    cursor: pointer;
    text-shadow: 0 0 10px var(--shadow-red-strong);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.image-overlay .close-btn:hover {
    color: var(--main-blood-red); /* Usando el nuevo rojo principal */
    text-shadow: 0 0 15px var(--main-blood-red);
}