/* ==========================================================================
   GLOBAL.CSS - Variables, Navegación, Tarjetas y Footer
   ========================================================================== */

/* --- 1. VARIABLES GLOBALES --- */
:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --dark: #111827;
    --dark-light: #1f2937;
    --bg-light: #f8fafc;
    --text-main: #111827;
    --text-muted: #6b7280;
    --white: #ffffff;
    --font-titles: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* --- 2. RESET Y BASE --- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 85px; }
body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--bg-light);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .logo, .menu-principal > li > a { font-family: var(--font-titles); letter-spacing: -0.02em; }
a { text-decoration: none; color: inherit; }

/* --- 3. HEADER Y NAVEGACIÓN --- */
header {
    background: var(--dark); position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.nav-container {
    max-width: 1200px; margin: 0 auto; display: flex;
    justify-content: space-between; align-items: center; padding: 0 20px; height: 75px;
}
.logo { color: var(--white) !important; font-size: 1.6em; font-weight: 800; display: flex; align-items: center; gap: 10px; letter-spacing: -1px; }

.menu-principal { list-style: none; display: flex; gap: 5px; margin: 0; padding: 0; }
.menu-principal > li > a {
    color: #d1d5db !important; font-weight: 600; padding: 10px 15px;
    text-transform: uppercase; font-size: 0.85em; transition: 0.3s; border-radius: 5px;
}
.menu-principal > li > a:hover { color: var(--white) !important; background: var(--dark-light); }

.tiene-dropdown { position: relative; }
.dropdown {
    position: absolute; top: 100%; left: 0; background: var(--dark); min-width: 240px;
    list-style: none; padding: 10px 0; opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: 0.3s; border-top: 3px solid var(--primary); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}
.tiene-dropdown:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a { display: block; color: #9ca3af !important; padding: 12px 20px; font-size: 0.9em; border-bottom: 1px solid #1f2937; transition: 0.2s; }
.dropdown a:hover { background: var(--dark-light); color: var(--white) !important; padding-left: 25px; }

.menu-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 10px; z-index: 1100; }
.bar { width: 25px; height: 3px; background-color: white; transition: 0.3s; border-radius: 2px; }

/* Responsive Header */
@media (max-width: 768px) {
    html { scroll-padding-top: 70px; }
    .menu-toggle { display: flex; }
    .nav-menu {
        position: fixed; top: 0; right: -100%; width: 80%; max-width: 300px; height: 100vh;
        background: var(--dark); padding: 100px 30px; transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5); z-index: 1050;
    }
    .nav-menu.active { right: 0; }
    .menu-principal { flex-direction: column; gap: 20px; }
    .menu-principal a { font-size: 1.1em; display: block; }
    .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: rgba(255, 255, 255, 0.05); margin-top: 10px; display: none; }
    .tiene-dropdown:hover .dropdown { display: block; }
    .menu-toggle.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* --- 4. GRID UNIVERSAL Y TARJETAS --- */
.contenedor { max-width: 1100px; margin: 20px auto; padding: 0 20px; }
.grid-articulos { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; }
.tarjeta {
    background: var(--white); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); border: 1px solid #edf2f7; display: flex; flex-direction: column;
}
.tarjeta .etiqueta {
    color: var(--text-muted); /* Color gris */
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px; /* Separación con el título */
    display: inline-block; /* Necesario para que el span respete el margen vertical */
}
.tarjeta:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); color: var(--primary); }
.tarjeta img { width: 100%; height: 220px; object-fit: cover; }
.tarjeta-contenido { display: flex; flex-direction: column; padding: 25px; flex-grow: 1; }
.fecha { margin-top: auto; color: var(--text-muted); font-size: 0.85em; }
.tarjeta h2, .tarjeta h3 { margin: 0 0 15px; font-size: 1.2em; line-height: 1.4; color: var(--text-main); transition: color 0.2s ease; }
.tarjeta p { color: var(--text-muted); font-size: 0.95em; margin-bottom: 20px; }
/* Estilo de la etiqueta en las tarjetas */

/* Estilo para categoria.php */
.cabecera-categoria { text-align: center; margin-bottom: 40px; padding: 20px 0; border-bottom: 1px solid #e5e7eb; }
.cabecera-categoria span { color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-size: 0.85em; font-weight: 700; }
.cabecera-categoria h1 { font-size: 2.8rem; color: var(--text-main); margin-top: 10px; }

/* --- 5. FOOTER --- */
footer { background: var(--dark); color: #6b7280; padding: 80px 20px 40px; margin-top: 100px; text-align: center; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 25px; margin-bottom: 40px; }
.footer-links a { color: #9ca3af; font-size: 0.85em; transition: 0.3s; }
.footer-links a:hover { color: var(--white); }
.copy { font-size: 0.8em; border-top: 1px solid #1f2937; padding-top: 30px; margin-top: 30px; }