/* ============================================
   MERCAMA - Mercaders de Manises
   Estilos principales
   ============================================ */

:root {
  /* Paleta AAA — todas las combinaciones de texto cumplen WCAG 2.1 AAA (7:1) */
  --primary: #8B2D1B;        /* Terracota oscuro (8.44:1 sobre blanco) */
  --primary-dark: #5C1F11;   /* Hover, aún más oscuro */
  --primary-light: #E76F51;  /* Solo decorativo (gradientes/fondos) */
  --secondary: #2C3E50;      /* Azul profundo (10.98:1 sobre blanco) */
  --secondary-light: #34495E;
  --accent: #FFD24D;         /* Dorado claro: secondary encima → 7.62:1 */
  --accent-dark: #7C4A07;    /* Para texto de tipo-sorteo (7.40:1 sobre blanco) */
  --bg: #FFF8F0;             /* Crema claro */
  --bg-alt: #FFFFFF;
  --text: #1F2937;           /* 14.68:1 sobre blanco */
  --text-muted: #4B5563;     /* 7.56:1 sobre blanco / 7.17:1 sobre crema */
  --border: #E5E7EB;
  --success: #0B5A29;        /* Verde oscuro (8.37:1 sobre blanco) */
  --danger: #A41818;         /* Rojo oscuro (7.71:1 sobre blanco) */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 10px;
  --radius-lg: 16px;
  --container: 1180px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

h1, h2, h3, h4 { color: var(--secondary); font-weight: 700; line-height: 1.25; }
h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 1rem; }
h3 { font-size: 1.3rem; margin-bottom: .8rem; }
p { margin-bottom: 1rem; }

/* ===== HEADER ===== */
.site-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: var(--container);
  margin: 0 auto;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--secondary);
}
.brand img { height: 48px; width: auto; max-width: 100px; object-fit: contain; display: block; }
.brand-text { line-height: 1; }
.brand-text .name { font-size: 1.15rem; color: var(--primary); }
.brand-text .sub { font-size: .75rem; color: var(--text-muted); font-weight: 500; }

nav.main-nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
nav.main-nav > a, nav.main-nav .nav-group > a {
  color: var(--secondary);
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: .95rem;
  transition: all .2s;
  display: inline-block;
}
nav.main-nav > a:hover, nav.main-nav > a.active,
nav.main-nav .nav-group > a:hover, nav.main-nav .nav-group.open > a {
  background: var(--primary);
  color: white;
}
/* Enlaces destacados (Noticias, Directorio) */
nav.main-nav a.nav-cta {
  background: var(--primary);
  color: white;
  font-weight: 600;
}
nav.main-nav a.nav-cta:hover { background: var(--primary-dark); color: white; }
/* Dropdown */
.nav-group { position: relative; }
.nav-group > a { cursor: pointer; }
.nav-group > a::after {
  content: " ▾";
  font-size: .7em;
  opacity: .7;
  margin-left: 2px;
}
.nav-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg-alt);
  min-width: 220px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  z-index: 110;
  border: 1px solid var(--border);
}
.nav-group:hover .nav-dropdown,
.nav-group:focus-within .nav-dropdown,
.nav-group.open .nav-dropdown { display: block; }
.nav-dropdown a {
  display: block;
  padding: 9px 14px;
  font-size: .92rem;
  border-radius: 6px;
  color: var(--secondary);
  font-weight: 500;
  text-decoration: none;
  transition: all .15s;
}
.nav-dropdown a:hover {
  background: var(--bg);
  color: var(--primary);
  padding-left: 18px;
}

/* ===== DROPDOWN DE USUARIO LOGUEADO ===== */
.nav-user {
  position: relative;
  margin-left: 8px;
}
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  font-family: var(--font);
  font-size: .9rem;
  color: var(--secondary);
  font-weight: 500;
  transition: all .2s;
}
.nav-user-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.nav-user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  flex-shrink: 0;
}
.nav-user-btn:hover .nav-user-avatar { background: white; color: var(--primary); }
.nav-user-btn::after {
  content: " ▾";
  font-size: .7em;
  opacity: .6;
  margin-left: 2px;
}
.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-alt);
  min-width: 220px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  z-index: 120;
  border: 1px solid var(--border);
}
.nav-user.open .nav-user-dropdown,
.nav-user:focus-within .nav-user-dropdown { display: block; }
.nav-user-info {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.nav-user-info .name { font-weight: 600; color: var(--secondary); font-size: .95rem; }
.nav-user-info .role { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.nav-user-dropdown a, .nav-user-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  font-size: .92rem;
  border-radius: 6px;
  color: var(--secondary);
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  transition: all .15s;
}
.nav-user-dropdown a:hover, .nav-user-dropdown button:hover {
  background: var(--bg);
  color: var(--primary);
}
.nav-user-dropdown .logout { color: var(--danger); }
.nav-user-dropdown .logout:hover { background: rgba(164,24,24,.08); color: var(--danger); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--secondary);
}

/* ===== BANNER AVISO URGENTE ===== */
.urgent-banner {
  background: linear-gradient(135deg, var(--danger), #6E0F0F);
  color: white;
  padding: 16px 20px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  position: relative;
  border-bottom: 3px solid #4A0A0A;
  animation: bannerPulse 2.5s ease-in-out infinite;
}
.urgent-banner .icon { font-size: 1.3rem; margin-right: 10px; vertical-align: middle; }
.urgent-banner strong { display: inline-block; margin: 0 8px; }
.urgent-banner a {
  color: #FFD24D;
  text-decoration: underline;
  margin-left: 12px;
  font-weight: 700;
}
.urgent-banner a:hover { color: white; }
@keyframes bannerPulse {
  0%, 100% { background: linear-gradient(135deg, #A41818, #6E0F0F); }
  50% { background: linear-gradient(135deg, #DC2626, #911616); }
}

/* ===== HERO COMPACTO ===== */
.hero-compact {
  background: linear-gradient(135deg, rgba(139,45,27,.92), rgba(44,62,80,.88)),
              url('../assets/img/presentacion/pres2.jpg') center/cover;
  color: white;
  padding: 60px 20px 48px;
  text-align: center;
}
.hero-compact h1 { color: white; font-size: clamp(1.8rem,4vw,2.6rem); margin-bottom: 10px; }
.hero-compact p { font-size: 1.05rem; max-width: 760px; margin: 0 auto 22px; opacity: .96; }

/* ===== SECCIÓN HEADING DESTACADO ===== */
.section-heading-big {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}
.section-heading-big h2 {
  margin: 0;
  position: relative;
  padding-bottom: 10px;
}
.section-heading-big h2::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 64px; height: 4px;
  background: var(--primary);
  border-radius: 2px;
}
.section-heading-big .heading-extra {
  display: flex;
  gap: 10px;
  align-items: center;
}
.section-heading-big .badge-count {
  background: var(--primary);
  color: white;
  font-size: .8rem;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: .5px;
}

/* ===== NOTICIA DESTACADA EN HOME ===== */
.noticia-destacada {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 28px;
  border: 1px solid var(--border);
  position: relative;
  transition: transform .25s;
}
.noticia-destacada:hover { transform: translateY(-3px); }
.noticia-destacada .img {
  background-size: cover;
  background-position: center;
  background-color: var(--primary);
  min-height: 340px;
}
.noticia-destacada .body {
  padding: 36px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.noticia-destacada h3 { font-size: clamp(1.3rem, 2.4vw, 1.85rem); margin: 12px 0 10px; line-height: 1.2; }
.noticia-destacada .fecha { color: var(--text-muted); font-size: .9rem; margin-bottom: 14px; }
.noticia-destacada .resumen { font-size: 1.02rem; color: var(--text); margin-bottom: 22px; flex: 0; }
.noticia-destacada.aviso {
  border: 3px solid var(--danger);
  box-shadow: 0 0 0 6px rgba(164,24,24,.15), var(--shadow-lg);
}
.noticia-destacada.aviso::before {
  content: '⚠ AVISO IMPORTANTE';
  position: absolute;
  top: 0; left: 0;
  background: var(--danger);
  color: white;
  padding: 8px 22px;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: 1.5px;
  border-bottom-right-radius: 12px;
  z-index: 2;
}
.noticia-destacada.aviso .img {
  background-color: var(--danger);
}
@media (max-width: 760px) {
  .noticia-destacada { grid-template-columns: 1fr; }
  .noticia-destacada .img { min-height: 220px; }
  .noticia-destacada .body { padding: 24px 22px; }
}

/* ===== DIRECTORIO PREVIEW EN HOME ===== */
.dir-banner {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
  color: white;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 30px;
  align-items: center;
  margin-bottom: 30px;
  box-shadow: var(--shadow-lg);
}
.dir-banner h3 { color: white; font-size: 1.7rem; margin-bottom: 12px; }
.dir-banner p { opacity: .95; margin-bottom: 20px; font-size: 1.02rem; }
.dir-banner .btn { background: white; color: var(--secondary); }
.dir-banner .btn:hover { background: var(--accent); color: var(--secondary); }
.dir-banner .stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.dir-banner .stat { background: rgba(255,255,255,.12); padding: 12px 18px; border-radius: 10px; }
.dir-banner .stat-num { font-size: 1.8rem; font-weight: 700; line-height: 1; color: var(--accent); }
.dir-banner .stat-lbl { font-size: .82rem; opacity: .9; }
@media (max-width: 760px) {
  .dir-banner { grid-template-columns: 1fr; padding: 28px 22px; }
}

.dir-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.dir-cat-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 22px 14px;
  text-align: center;
  border: 2px solid var(--border);
  transition: all .2s;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.dir-cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  color: var(--text);
  box-shadow: var(--shadow);
}
.dir-cat-card .ico { font-size: 2rem; margin-bottom: 8px; line-height: 1; }
.dir-cat-card .name { font-weight: 600; color: var(--secondary); font-size: .95rem; }
.dir-cat-card .count { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

/* ===== NOTICIA-CARD VARIANTE AVISO ===== */
.noticia-card.aviso-card {
  border: 2px solid var(--danger);
  position: relative;
}
.noticia-card.aviso-card::before {
  content: '⚠';
  position: absolute;
  top: 10px; right: 10px;
  background: var(--danger);
  color: white;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(164,24,24,.4);
}

/* ===== HOME-INTRO compact ===== */
.home-intro {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  align-items: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.home-intro p { margin-bottom: 12px; }
.home-intro img { border-radius: var(--radius); }
@media (max-width: 760px) {
  .home-intro { grid-template-columns: 1fr; padding: 24px; }
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, rgba(139,45,27,.9), rgba(44,62,80,.85)),
              url('../assets/img/presentacion/pres2.jpg') center/cover;
  color: white;
  padding: 80px 20px;
  text-align: center;
}
.hero h1 { color: white; margin-bottom: 16px; }
.hero p { font-size: 1.15rem; max-width: 720px; margin: 0 auto 28px; opacity: .95; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  transition: all .2s;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; transform: translateY(-1px); }
.btn-outline { background: transparent; color: white; border: 2px solid white; }
.btn-outline:hover { background: white; color: var(--primary); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--secondary-light); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }

/* ===== SECTIONS ===== */
section { padding: 70px 0; }
.section-title { text-align: center; margin-bottom: 12px; }
.section-subtitle { text-align: center; color: var(--text-muted); max-width: 700px; margin: 0 auto 50px; }
.bg-alt { background: var(--bg-alt); }

/* ===== CARDS - quick access ===== */
.quick-access {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.qa-card {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform .25s, box-shadow .25s;
  color: var(--text);
  display: block;
}
.qa-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--text); }
.qa-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: white;
  font-size: 1.6rem;
}
.qa-card h3 { color: var(--secondary); margin-bottom: 6px; }
.qa-card p { color: var(--text-muted); margin: 0; font-size: .92rem; }

/* ===== GENERIC CARDS ===== */
.card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* ===== JUNTA ===== */
.junta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 30px;
}
.junta-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  border-top: 4px solid var(--primary);
  box-shadow: var(--shadow-sm);
}
.junta-card .cargo {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--primary);
  background: rgba(139,45,27,.1);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.junta-card .nombre { font-weight: 600; color: var(--secondary); }

/* ===== DIRECTORIO ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
  justify-content: center;
}
.filter-btn {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: .9rem;
  transition: all .2s;
  color: var(--text);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.comercios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.comercio-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform .2s;
}
.comercio-card:hover { transform: translateY(-3px); }
.comercio-card .body { padding: 20px; }
.comercio-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.comercio-card .cat {
  display: inline-block;
  font-size: .7rem;
  background: var(--accent);
  color: var(--secondary);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.comercio-card .desc { color: var(--text-muted); font-size: .9rem; margin: 0 0 10px; }
.comercio-card .ubic { color: var(--text-muted); font-size: .85rem; }
.comercio-card .ubic strong { color: var(--secondary); }

/* ===== NOTICIAS ===== */
.noticias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 26px;
}
.noticia-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform .2s;
}
.noticia-card:hover { transform: translateY(-3px); }
.noticia-card .img {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  background-size: cover;
  background-position: center;
}
.noticia-card .body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.noticia-card .tipo {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  align-self: flex-start;
}
.tipo-noticia { background: rgba(44,62,80,.1); color: var(--secondary); }
.tipo-sorteo { background: rgba(255,210,77,.25); color: var(--accent-dark); }
.tipo-evento { background: rgba(11,90,41,.12); color: var(--success); }
.tipo-aviso { background: rgba(164,24,24,.12); color: var(--danger); }
.noticia-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.noticia-card .fecha { font-size: .82rem; color: var(--text-muted); margin-bottom: 10px; }
.noticia-card .resumen { color: var(--text-muted); font-size: .92rem; flex: 1; }
.noticia-card .actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== GALERÍA ===== */
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.galeria-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .25s;
  box-shadow: var(--shadow-sm);
}
.galeria-grid img:hover { transform: scale(1.03); }

/* Lightbox simple */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 6px; }
.lightbox .close {
  position: absolute; top: 20px; right: 24px;
  background: white; color: var(--secondary);
  border: none; width: 44px; height: 44px;
  font-size: 1.5rem; border-radius: 50%; cursor: pointer;
}

/* ===== FORM ===== */
form .form-group { margin-bottom: 18px; }
form label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--secondary); }
form input, form select, form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font);
  background: white;
  transition: border-color .2s;
}
form input:focus, form select:focus, form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139,45,27,.15);
}
form textarea { resize: vertical; min-height: 120px; }

/* ===== LOGIN ===== */
.login-wrap {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, rgba(139,45,27,.1), rgba(44,62,80,.08));
}
.login-card {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
}
.login-card h2 { text-align: center; margin-bottom: 8px; }
.login-card .login-sub { text-align: center; color: var(--text-muted); margin-bottom: 28px; }
.login-card .btn { width: 100%; }
.login-info {
  margin-top: 18px;
  background: rgba(255,210,77,.18);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .85rem;
  color: var(--secondary);
}
.login-info strong { color: var(--primary); }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: .92rem;
}
.alert-success { background: rgba(11,90,41,.1); color: var(--success); border: 1px solid rgba(11,90,41,.25); }
.alert-error { background: rgba(164,24,24,.1); color: var(--danger); border: 1px solid rgba(164,24,24,.25); }
.alert-info { background: rgba(44,62,80,.08); color: var(--secondary); border: 1px solid rgba(44,62,80,.18); }

/* ===== TABLES (transparencia) ===== */
.tabla {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.tabla th, .tabla td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.tabla th { background: var(--secondary); color: white; font-weight: 600; }
.tabla tr:last-child td { border-bottom: none; }
.tabla tr:hover { background: rgba(139,45,27,.04); }

/* ===== ENTIDADES ===== */
.entidades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 30px;
  align-items: center;
  justify-items: center;
}
.entidad-logo {
  text-align: center;
  padding: 16px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .2s;
  width: 100%;
}
.entidad-logo:hover { transform: translateY(-3px); }
.entidad-logo img { max-height: 80px; width: auto; margin: 0 auto 10px; object-fit: contain; }
.entidad-logo .nombre { font-size: .85rem; font-weight: 600; color: var(--secondary); }

/* ===== DESCUBRE MANISES ===== */
.lugares {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}
.lugar {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 22px;
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow-sm);
}
.lugar h3 { color: var(--secondary); font-size: 1.05rem; }
.lugar p { color: var(--text-muted); font-size: .92rem; margin: 0; }

/* ===== MAPS ===== */
.map-embed {
  width: 100%;
  height: 380px;
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ===== DOCS list ===== */
.docs-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.doc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-alt);
  padding: 16px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: all .2s;
}
.doc-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); border-color: var(--primary); }
.doc-icon {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: rgba(139,45,27,.12);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.doc-item h4 { font-size: .95rem; margin-bottom: 2px; color: var(--secondary); }
.doc-item p { font-size: .8rem; color: var(--text-muted); margin: 0; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--secondary);
  color: rgba(255,255,255,.85);
  padding: 50px 20px 24px;
  margin-top: 60px;
}
.footer-partners {
  max-width: var(--container);
  margin: 0 auto 30px;
  padding: 24px 20px;
  background: transparent;
  border-top: 1px solid rgba(255,255,255,.15);
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.footer-partners h4 {
  text-align: center;
  color: white;
  margin-bottom: 18px;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: .9;
}
.footer-partners-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  justify-content: center;
}
.footer-partners-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  min-height: 60px;
  transition: opacity .2s, transform .2s;
  opacity: .85;
}
.footer-partners-grid a:hover { opacity: 1; transform: translateY(-2px); }
.footer-partners-grid img {
  max-height: 50px;
  max-width: 150px;
  width: auto;
  height: auto;
  object-fit: contain;
  /* Forzar todos los logos a blanco uniforme */
  filter: brightness(0) invert(1);
}
@media (max-width: 600px) {
  .footer-partners-grid { gap: 16px; }
  .footer-partners-grid img { max-height: 38px; max-width: 100px; }
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}
.site-footer h4 { color: white; margin-bottom: 14px; font-size: 1rem; }
.site-footer a { color: rgba(255,255,255,.85); display: block; padding: 4px 0; font-size: .92rem; }
.site-footer a:hover { color: var(--accent); }
.footer-bottom {
  max-width: var(--container);
  margin: 30px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.15);
  text-align: center;
  font-size: .85rem;
  color: rgba(255,255,255,.85);
  position: relative;
}
.footer-lock {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  transition: color .2s, background .2s;
  font-size: 1rem;
}
.footer-lock:hover {
  color: white;
  background: rgba(255,255,255,.12);
}
.footer-lock svg { width: 16px; height: 16px; display: block; }
@media (max-width: 600px) {
  .footer-lock { position: static; transform: none; margin: 12px auto 0; display: flex; }
}

/* ===== PAGE HEADER ===== */
.page-header {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
  color: white;
  padding: 50px 20px 40px;
  text-align: center;
}
.page-header h1 { color: white; }
.page-header p { opacity: .9; margin: 0; }

/* ===== ADMIN PANEL ===== */
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
  padding: 14px 18px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.admin-toolbar .user-info { font-size: .92rem; color: var(--text-muted); }
.admin-toolbar .user-info strong { color: var(--secondary); }
.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 6px;
}
.role-admin { background: var(--primary); color: white; }
.role-editor { background: var(--accent); color: var(--secondary); }

/* ===== HISTORIA BLOCK ===== */
.historia-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.historia-block img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ===== RESPONSIVE ===== */
@media (max-width: 980px) {
  nav.main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    flex-direction: column;
    padding: 16px;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--border);
    align-items: stretch;
  }
  nav.main-nav.open { display: flex; }
  nav.main-nav > a, nav.main-nav .nav-group > a { width: 100%; }
  /* Dropdowns en móvil: estáticos y siempre visibles dentro del grupo abierto */
  .nav-group { width: 100%; }
  .nav-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    background: var(--bg);
    padding: 4px 4px 4px 16px;
    border-radius: 0;
    border-left: 3px solid var(--primary);
    margin-top: 4px;
  }
  .nav-group.open .nav-dropdown { display: block; }
  .nav-group:hover .nav-dropdown { display: none; } /* anular hover en táctil */
  .nav-group.open:hover .nav-dropdown { display: block; }
  .nav-toggle { display: block; }
  .header-inner { position: relative; }
  .hero, .hero-compact { padding: 50px 20px; }
  section { padding: 50px 0; }
  .historia-block { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .brand img { height: 40px; }
  .brand-text .name { font-size: 1rem; }
  .brand-text .sub { font-size: .7rem; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
}
