/* ============================
   GALLEROS.MX - SISTEMA DE DISEÑO
   ============================ */

:root {
  /* Colores principales */
  --color-primary: #E11D2E;
  --color-primary-dark: #B71422;
  --color-primary-light: #FF3344;
  --color-gold: #D4A437;
  --color-gold-light: #E8B946;

  /* Modo Oscuro */
  --bg-dark: #0A0A0A;
  --bg-dark-2: #141414;
  --bg-dark-3: #1F1F1F;
  --bg-card-dark: #1A1A1A;
  --text-dark: #FFFFFF;
  --text-dark-2: #B0B0B0;
  --text-dark-3: #707070;
  --border-dark: #2A2A2A;

  /* Modo Claro */
  --bg-light: #FFFFFF;
  --bg-light-2: #F5F5F7;
  --bg-light-3: #EBEBED;
  --bg-card-light: #FFFFFF;
  --text-light: #0A0A0A;
  --text-light-2: #4A4A4A;
  --text-light-3: #8A8A8A;
  --border-light: #E5E5E5;

  /* Variables activas (por defecto oscuro) */
  --bg: var(--bg-dark);
  --bg-2: var(--bg-dark-2);
  --bg-3: var(--bg-dark-3);
  --bg-card: var(--bg-card-dark);
  --text: var(--text-dark);
  --text-2: var(--text-dark-2);
  --text-3: var(--text-dark-3);
  --border: var(--border-dark);

  /* Espaciado */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radios */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.15);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 24px rgba(225, 29, 46, 0.4);

  /* Tipografía */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Bebas Neue', Impact, sans-serif;

  /* Transiciones */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modo claro */
body.light-mode {
  --bg: var(--bg-light);
  --bg-2: var(--bg-light-2);
  --bg-3: var(--bg-light-3);
  --bg-card: var(--bg-card-light);
  --text: var(--text-light);
  --text-2: var(--text-light-2);
  --text-3: var(--text-light-3);
  --border: var(--border-light);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
}

/* ============================
   RESET Y BASE
   ============================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { background: none; border: none; cursor: pointer; color: inherit; font-family: inherit; }
img { max-width: 100%; display: block; }
img[src*=".jpg"], img[src*=".jpeg"], img[src*=".webp"] {
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg-3) 100%);
  min-height: 100px;
}

/* Logo images - transparent background */
.logo img, .modal-avatar, .sncac-hero img, .sncac-banner img {
  background: transparent !important;
  min-height: auto !important;
}

/* Fallback for failed images */
.ad-image img::before {
  content: '🐓';
  position: absolute;
  font-size: 3rem;
  opacity: 0.3;
}
input, select, textarea { font-family: inherit; }

/* ============================
   LAYOUT PRINCIPAL
   ============================ */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================
   HEADER / NAVEGACIÓN
   ============================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.logo-text {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-suffix {
  color: var(--text-2);
  font-weight: 500;
  font-size: 1rem;
  margin-left: 2px;
}

.search-bar {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: none;
}

.search-bar input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text);
  font-size: 0.95rem;
  transition: all var(--transition);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--bg-3);
}

.search-bar svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  width: 18px;
  height: 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  position: relative;
  transition: background var(--transition);
}

.icon-btn:hover { background: var(--bg-2); }
.icon-btn svg { width: 22px; height: 22px; }

.icon-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--color-primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 0 0 2px var(--bg);
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background var(--transition);
}
.theme-toggle:hover { background: var(--bg-2); }
.theme-toggle svg { width: 20px; height: 20px; }

/* ============================
   NAVEGACIÓN MÓVIL (TAB BAR)
   ============================ */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--bg);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  justify-content: space-around;
  padding: 8px 4px env(safe-area-inset-bottom, 8px);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: color var(--transition);
  position: relative;
  min-width: 60px;
}

.mobile-nav-item.active { color: var(--color-primary); }
.mobile-nav-item svg { width: 24px; height: 24px; }
.mobile-nav-item.center { transform: translateY(-12px); }

.mobile-nav-item.center .nav-center-btn {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  color: white;
}

.mobile-nav-item.center svg { width: 28px; height: 28px; }

/* ============================
   CONTENIDO PRINCIPAL
   ============================ */
.main-content {
  flex: 1;
  padding-bottom: 90px;
}

@media (min-width: 768px) {
  .main-content { padding-bottom: var(--space-xl); }
}

/* ============================
   HERO / BANNER
   ============================ */
.hero {
  margin: var(--space-md);
  padding: var(--space-xl) var(--space-lg);
  background: linear-gradient(135deg, var(--color-primary) 0%, #7A0F1A 100%);
  border-radius: var(--radius-lg);
  color: white;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(212, 164, 55, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.hero p {
  font-size: 0.95rem;
  opacity: 0.95;
  position: relative;
  z-index: 1;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* ============================
   BOTONES
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary {
  background: white;
  color: var(--color-primary);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn-secondary {
  background: rgba(255,255,255,0.15);
  color: white;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover { background: var(--bg-2); }

.btn-block { width: 100%; }
.btn-lg { padding: 16px 24px; font-size: 1rem; }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; }

.btn svg { width: 18px; height: 18px; }

/* ============================
   CATEGORÍAS
   ============================ */
.section {
  padding: var(--space-lg) var(--space-md);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-md);
  gap: var(--space-md);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-2);
  margin-top: 2px;
}

.link-action {
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.link-action:hover { text-decoration: underline; }
.link-action svg { width: 16px; height: 16px; }

.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

@media (min-width: 768px) {
  .categories-grid { grid-template-columns: repeat(8, 1fr); gap: var(--space-md); }
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  transition: all var(--transition);
  color: var(--text);
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.category-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.category-icon svg { width: 24px; height: 24px; }
.category-name { font-size: 0.75rem; font-weight: 600; }

/* ============================
   ANUNCIOS / PRODUCTOS
   ============================ */
.ads-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 600px) {
  .ads-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .ads-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  .ads-grid { grid-template-columns: repeat(4, 1fr); }
}

.ad-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.ad-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.ad-image {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-3);
}

.ad-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.ad-card:hover .ad-image img { transform: scale(1.05); }

.ad-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--color-gold);
  color: #1A1A1A;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ad-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all var(--transition);
}

.ad-fav:hover { background: var(--color-primary); }
.ad-fav.active { background: var(--color-primary); }
.ad-fav svg { width: 18px; height: 18px; }

.ad-body { padding: var(--space-md); flex: 1; display: flex; flex-direction: column; gap: 6px; }
.ad-title { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
.ad-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-top: auto;
}
.ad-meta { font-size: 0.8rem; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.ad-meta svg { width: 14px; height: 14px; }

/* ============================
   CARRUSEL DESTACADOS
   ============================ */
.carousel {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }

.carousel .ad-card { flex: 0 0 280px; scroll-snap-align: start; }
@media (min-width: 600px) { .carousel .ad-card { flex: 0 0 320px; } }

/* ============================
   FILTROS
   ============================ */
.filter-tabs {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: var(--space-md);
  padding-bottom: 4px;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  transition: all var(--transition);
}

.filter-tab.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.filter-tab:hover:not(.active) { background: var(--bg-3); color: var(--text); }

/* ============================
   COMUNIDAD / TIPS
   ============================ */
.community-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
}

.community-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.community-image {
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  position: relative;
}

.community-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
}

.community-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--color-primary);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 1;
}

.community-body { padding: var(--space-md); flex: 1; display: flex; flex-direction: column; gap: 8px; }
.community-title { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.community-text { font-size: 0.85rem; color: var(--text-2); }
.community-meta { font-size: 0.75rem; color: var(--text-3); margin-top: auto; padding-top: 8px; }

/* ============================
   TIPS BANNER
   ============================ */
.tips-banner {
  margin: var(--space-md);
  padding: var(--space-md);
  background: linear-gradient(135deg, var(--color-gold) 0%, #B88A2A 100%);
  border-radius: var(--radius-md);
  color: #1A1A1A;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.tips-icon {
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tips-content { flex: 1; }
.tips-content h3 { font-size: 0.95rem; font-weight: 800; margin-bottom: 2px; }
.tips-content p { font-size: 0.8rem; opacity: 0.85; }

.tips-banner svg { width: 24px; height: 24px; color: white; }

/* ============================
   CALENDARIO / EVENTOS
   ============================ */
.calendar-container {
  padding: var(--space-md);
}

.calendar-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, #7A0F1A 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-lg);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.calendar-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(212, 164, 55, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.calendar-event-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #FFD700 0%, #B8860B 50%, #FFD700 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  line-height: 1;
  position: relative;
  z-index: 1;
}

.calendar-event-subtitle {
  font-size: 1rem;
  margin-top: var(--space-sm);
  opacity: 0.95;
  position: relative;
  z-index: 1;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.calendar-nav-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: capitalize;
}

.calendar-nav button {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background var(--transition);
}

.calendar-nav button:hover { background: var(--bg-3); }
.calendar-nav button svg { width: 18px; height: 18px; }

.calendar-grid {
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.calendar-weekday {
  padding: 10px 4px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
}

.calendar-day {
  background: var(--bg-card);
  min-height: 80px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}

@media (min-width: 768px) { .calendar-day { min-height: 100px; padding: 8px; } }

.calendar-day:hover { background: var(--bg-2); }
.calendar-day.other-month { opacity: 0.4; }
.calendar-day.today { background: var(--bg-2); }

.calendar-day.today .day-number {
  background: var(--color-primary);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.calendar-day.has-event {
  background: linear-gradient(180deg, rgba(225,29,46,0.08) 0%, transparent 100%);
}

.day-number {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  align-self: flex-start;
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.day-event {
  background: var(--color-primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.day-event.weekend { background: var(--color-gold); color: #1A1A1A; }
.day-event.weekday { background: var(--color-primary); }

/* ============================
   EVENT FLYER
   ============================ */
.event-flyer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.event-flyer-hero {
  background: linear-gradient(135deg, #0F3B5C 0%, #1A5A7A 50%, #2A7A9A 100%);
  padding: var(--space-lg);
  color: white;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.event-flyer-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(212,164,55,0.15) 0%, transparent 40%);
  pointer-events: none;
}

.event-flyer-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.event-flyer-location {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.event-flyer-location svg { width: 16px; height: 16px; }

.event-flyer-date {
  text-align: right;
}

.event-flyer-date .date-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(180deg, #FFD700 0%, #B8860B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.event-flyer-date .date-text {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.event-flyer-title {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #FFD700 0%, #B8860B 50%, #FFD700 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  line-height: 0.9;
  text-align: center;
  margin: var(--space-md) 0;
}

.event-flyer-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 600px) {
  .event-flyer-content { grid-template-columns: 1fr; }
}

.event-flyer-specs,
.event-flyer-prices {
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.1);
}

.event-flyer-specs h4,
.event-flyer-prices h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-gold);
  margin-bottom: var(--space-sm);
  font-weight: 800;
}

.event-flyer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-flyer-list .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.event-flyer-list .row:last-child { border-bottom: none; }
.event-flyer-list .row .price { color: var(--color-gold); font-weight: 800; }

.event-flyer-logo {
  position: relative;
  z-index: 1;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #FFD700 0%, #B8860B 100%);
  border-radius: var(--radius-full);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 900;
  color: #1A1A1A;
  text-align: center;
  padding: 8px;
  border: 3px solid rgba(255,255,255,0.3);
  line-height: 1.1;
}

.event-flyer-tribute {
  position: relative;
  z-index: 1;
  text-align: center;
  font-family: 'Georgia', serif;
  font-style: italic;
  color: var(--color-gold);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: var(--space-sm);
}

.event-flyer-tribute-label {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.7;
  margin-bottom: 4px;
}

/* ============================
   PÁGINA DE GALLO / BALANZA
   ============================ */
.gallo-hero {
  position: relative;
  height: 50vh;
  min-height: 320px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: var(--space-lg);
}

.gallo-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 50%, rgba(0,0,0,0.3) 100%);
}

.gallo-hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.gallo-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-gold);
  color: #1A1A1A;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gallo-info { flex: 1; min-width: 200px; }
.gallo-name { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 4px; }
.gallo-location { color: var(--text-2); font-size: 0.9rem; display: flex; align-items: center; gap: 4px; }
.gallo-location svg { width: 16px; height: 16px; }

.gallo-actions { display: flex; gap: var(--space-sm); }

.gallo-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 var(--space-md);
  margin-top: var(--space-md);
}

.gallo-tag-pill {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
}

.gallo-price-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  margin: var(--space-md);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: var(--radius-md);
  color: white;
}

.gallo-price-label { font-size: 0.85rem; opacity: 0.9; }
.gallo-price { font-size: 2rem; font-weight: 900; letter-spacing: -0.02em; }

.gallo-contact-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  padding: 0 var(--space-md);
  margin-bottom: var(--space-md);
}

@media (min-width: 600px) {
  .gallo-contact-actions { grid-template-columns: 2fr 1fr 1fr; }
}

/* ============================
   BALANZA DIGITAL (CONTROL)
   ============================ */
.balance-section {
  margin: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.balance-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-gold) 100%);
}

.balance-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.balance-title { font-size: 1.2rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.balance-title svg { width: 24px; height: 24px; color: var(--color-primary); }

.balance-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #00C853;
}

.balance-status .pulse {
  width: 8px;
  height: 8px;
  background: #00C853;
  border-radius: var(--radius-full);
  box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(0, 200, 83, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 200, 83, 0); }
}

/* Physical Scale Replica */
.balance-device {
  max-width: 380px;
  margin: 0 auto var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* The hanging hook assembly */
.balance-hook {
  position: relative;
  width: 80px;
  height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.balance-hook::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  border: 4px solid #4A4A4A;
  border-radius: 50%;
  border-bottom-color: transparent;
  background: linear-gradient(180deg, transparent 0%, transparent 50%, #2A2A2A 50%);
}

.balance-hook::after {
  content: '';
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 35px;
  background: linear-gradient(180deg, #4A4A4A 0%, #2A2A2A 100%);
}

/* The sling with rooster */
.balance-sling {
  width: 240px;
  height: 260px;
  position: relative;
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(74,144,194,0.4) 0%, transparent 60%),
    linear-gradient(135deg, #1E3A5F 0%, #2A5080 50%, #1E3A5F 100%);
  border-radius: 20px 20px 80px 80px;
  border: 3px solid #0A1F3A;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3), inset 0 0 30px rgba(0,0,0,0.4);
  overflow: hidden;
}

.balance-sling::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 24px;
  background: linear-gradient(180deg, #2A2A2A 0%, #1A1A1A 100%);
  border-radius: 0 0 6px 6px;
  z-index: 2;
}

.balance-sling::after {
  content: '';
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 8px;
  background: linear-gradient(180deg, #4A4A4A 0%, #2A2A2A 100%);
  border-radius: 4px;
  z-index: 2;
}

.balance-rooster {
  width: 200px;
  height: 200px;
  object-fit: cover;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
  animation: roosterSway 3s ease-in-out infinite;
  margin-top: 30px;
  border-radius: 50%;
}

@keyframes roosterSway {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-3px); }
}

/* The digital scale body */
.balance-body {
  width: 240px;
  background: linear-gradient(180deg, #1A1A1A 0%, #0A0A0A 100%);
  border-radius: 28px;
  padding: 16px;
  box-shadow:
    0 20px 40px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -1px 0 rgba(0,0,0,0.5);
  border: 2px solid #2A2A2A;
  position: relative;
  margin-top: 12px;
}

.balance-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 8px;
  background: #0A0A0A;
  border-radius: 0 0 12px 12px;
}

/* Connection cable between sling and body */
.balance-cable {
  width: 2px;
  height: 30px;
  background: linear-gradient(180deg, #4A4A4A 0%, #2A2A2A 100%);
  margin: 0 auto 0;
}

/* Hook on top of scale body */
.balance-body-hook {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 16px;
  background: linear-gradient(180deg, #4A4A4A 0%, #2A2A2A 100%);
  border-radius: 4px 4px 0 0;
}

.balance-body-hook::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border: 3px solid #4A4A4A;
  border-radius: 50%;
  background: transparent;
  border-bottom-color: transparent;
}

.balance-display {
  background: linear-gradient(180deg, #8FB39C 0%, #6B9B85 100%);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,0.4),
    inset 0 -1px 0 rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
}

.balance-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
}

.balance-display-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Courier New', monospace;
}

.balance-label { font-size: 0.7rem; color: #1A3A2A; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }

.balance-value {
  font-size: 2.4rem;
  font-weight: 900;
  color: #0A1F0A;
  text-shadow: 0 0 8px rgba(10, 31, 10, 0.3);
  font-family: 'Courier New', monospace;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: right;
}

.balance-value .unit { font-size: 0.9rem; font-weight: 700; margin-left: 4px; opacity: 0.7; }

.balance-stability {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: #1A3A2A;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  margin-top: 6px;
  text-transform: uppercase;
}

.balance-stability .dot {
  width: 6px;
  height: 6px;
  background: #00C853;
  border-radius: 50%;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

.balance-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.balance-btn {
  background: linear-gradient(180deg, #3A3A3A 0%, #1A1A1A 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #4A4A4A;
  transition: all var(--transition);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}

.balance-btn:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.balance-btn.active {
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-color: var(--color-primary);
  color: white;
}

.balance-btn.full { grid-column: span 2; }
.balance-btn.tare { background: linear-gradient(180deg, #D4A437 0%, #B8860B 100%); border-color: #D4A437; color: #1A1A1A; }

/* Weight History */
.balance-history {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.balance-history h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: 6px;
}

.balance-history h3 svg { width: 18px; height: 18px; color: var(--color-primary); }

.weight-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.weight-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  position: relative;
  cursor: pointer;
  transition: transform var(--transition);
}

.weight-bar:hover { transform: scaleY(1.05); }

.weight-bar::after {
  content: attr(data-value);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--transition);
}

.weight-bar:hover::after { opacity: 1; }

.weight-bar.target {
  background: linear-gradient(180deg, var(--color-gold) 0%, #B8860B 100%);
}

.weight-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 4px;
}

/* Weight Records */
.weight-records {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: var(--space-md);
}

.weight-record {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg-2);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.weight-record-date { color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.weight-record-date svg { width: 14px; height: 14px; }
.weight-record-value { font-weight: 800; color: var(--color-primary); }
.weight-record-diff { font-size: 0.75rem; font-weight: 700; }
.weight-record-diff.up { color: #00C853; }
.weight-record-diff.down { color: #FF3344; }

/* ============================
   MENSAJERÍA
   ============================ */
.chat-list {
  display: flex;
  flex-direction: column;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}

.chat-item:hover { background: var(--bg-2); }

.avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar.verified::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  background: #1DA1F2;
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid var(--bg);
}

.chat-info { flex: 1; min-width: 0; }
.chat-name {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.chat-name svg { width: 14px; height: 14px; color: #1DA1F2; }

.chat-preview {
  font-size: 0.85rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-meta { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chat-time { font-size: 0.75rem; color: var(--text-3); }
.chat-badge {
  background: var(--color-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* ============================
   PERFIL
   ============================ */
.profile-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, #7A0F1A 100%);
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(212,164,55,0.2) 0%, transparent 70%);
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  background: white;
  margin: 0 auto var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-primary);
  position: relative;
  box-shadow: var(--shadow-lg);
  border: 4px solid white;
}

.profile-avatar.verified::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  background: #1DA1F2;
  border-radius: 50%;
  background-image: url("data:imagesvg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
  background-size: 18px;
  background-position: center;
  background-repeat: no-repeat;
  border: 3px solid white;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
}

.profile-handle { font-size: 0.9rem; opacity: 0.9; position: relative; }
.profile-bio { font-size: 0.85rem; margin-top: var(--space-sm); opacity: 0.9; position: relative; max-width: 400px; margin-left: auto; margin-right: auto; }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.profile-stat { text-align: center; }
.profile-stat-value { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.profile-stat-label { font-size: 0.75rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* ============================
   FORMULARIO PUBLICAR
   ============================ */
.publish-steps {
  display: flex;
  justify-content: space-between;
  margin: var(--space-md);
  position: relative;
}

.publish-steps::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 36px;
  right: 36px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-3);
  transition: all var(--transition);
}

.step.active .step-num { background: var(--color-primary); border-color: var(--color-primary); color: white; }
.step.done .step-num { background: var(--color-gold); border-color: var(--color-gold); color: #1A1A1A; }
.step-label { font-size: 0.7rem; color: var(--text-3); font-weight: 600; }
.step.active .step-label, .step.done .step-label { color: var(--text); }

.form-group { margin-bottom: var(--space-md); }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.95rem;
  transition: border var(--transition);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-textarea { resize: vertical; min-height: 100px; }

/* ============================
   BOTTOM SPACER
   ============================ */
.bottom-spacer { height: 80px; }

@media (min-width: 768px) { .bottom-spacer { display: none; } }

/* ============================
   ANIMACIONES
   ============================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

/* ============================
   UTILIDADES
   ============================ */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-gold { color: var(--color-gold); }
.mt-md { margin-top: var(--space-md); }
.mb-md { margin-bottom: var(--space-md); }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* ============================
   DESKTOP NAV (sidebar)
   ============================ */
.desktop-nav {
  display: none;
}

@media (min-width: 1024px) {
  .desktop-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-md);
    background: var(--bg);
    border-right: 1px solid var(--border);
    width: 240px;
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
  }

  .desktop-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    color: var(--text-2);
    font-weight: 600;
    transition: all var(--transition);
  }

  .desktop-nav-item:hover { background: var(--bg-2); color: var(--text); }
  .desktop-nav-item.active { background: var(--color-primary); color: white; }
  .desktop-nav-item svg { width: 22px; height: 22px; }
  .desktop-nav-item .badge {
    margin-left: auto;
    background: var(--color-primary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
  }
  .desktop-nav-item.active .badge { background: white; color: var(--color-primary); }

  .desktop-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
  }

  .search-bar { display: block; }
  .mobile-nav { display: none; }
  .main-content { padding-bottom: var(--space-lg); }
}

/* ============================
   EVENT LIST (mobile)
   ============================ */
.event-list { display: flex; flex-direction: column; gap: var(--space-md); }

.event-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.event-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-primary); }

.event-date {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
  text-align: center;
}

.event-date-day { font-size: 1.8rem; font-weight: 900; line-height: 1; }
.event-date-month { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.event-date-year { font-size: 0.65rem; opacity: 0.8; }

.event-info { padding: var(--space-md); display: flex; flex-direction: column; gap: 4px; }
.event-name { font-size: 1rem; font-weight: 700; }
.event-location { font-size: 0.85rem; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.event-location svg { width: 14px; height: 14px; }
.event-meta { font-size: 0.75rem; color: var(--text-3); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.event-meta span { display: flex; align-items: center; gap: 4px; }
.event-meta svg { width: 14px; height: 14px; }

/* ============================
   CHAT PAGE LAYOUT (Mensajes)
   ============================ */
.chat-page-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: calc(100vh - 80px);
  overflow: hidden;
}

@media (max-width: 900px) {
  .chat-page-layout { grid-template-columns: 1fr; }
  .chat-sidebar.hidden-mobile { display: none; }
  .chat-thread-panel { display: block !important; }
  .chat-thread.hidden-mobile { display: none !important; }
}

.chat-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  overflow: hidden;
}

.chat-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.chat-sidebar .chat-list {
  flex: 1;
  overflow-y: auto;
}

.chat-item.active {
  background: var(--bg-3) !important;
  border-left: 3px solid var(--color-primary);
}

/* Panel de conversación */
.chat-thread-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.chat-thread-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl);
}

.chat-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-thread-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

.chat-back-btn {
  display: none;
}

@media (max-width: 900px) {
  .chat-back-btn { display: flex; }
}

.chat-thread-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
}

.chat-thread-user .avatar {
  width: 44px;
  height: 44px;
  font-size: 0.95rem;
}

.chat-thread-user-info { flex: 1; min-width: 0; }

.chat-thread-user-name {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.95rem;
}

.chat-thread-user-status {
  font-size: 0.75rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}

.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.chat-thread-actions {
  display: flex;
  gap: var(--space-sm);
}

/* Mensajes */
.chat-thread-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.chat-message-group {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  margin-bottom: var(--space-xs);
}

.chat-message-group.them { align-self: flex-start; }
.chat-message-group.me { align-self: flex-end; align-items: flex-end; }

.chat-message-time-divider {
  font-size: 0.7rem;
  color: var(--text-3);
  text-align: center;
  margin: var(--space-sm) 0;
  font-weight: 500;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.4;
  max-width: 100%;
  word-wrap: break-word;
  position: relative;
}

.chat-bubble.them {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-bubble.me {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-bubble-text { white-space: pre-wrap; }

.chat-attachment {
  margin-top: var(--space-sm);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 200px;
}

.chat-bubble.them .chat-attachment {
  background: var(--bg-3);
  border-color: var(--border);
}

.chat-attachment-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-bubble.them .chat-attachment-icon {
  background: var(--bg);
  color: var(--color-primary);
}

.chat-attachment-info { flex: 1; min-width: 0; }

.chat-attachment-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-attachment-size { font-size: 0.7rem; opacity: 0.8; }

.chat-attachment-download {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.chat-attachment-download:hover { opacity: 1; }

/* Input de mensaje */
.chat-thread-input {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}

.chat-thread-input input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast);
}

.chat-thread-input input:focus { border-color: var(--color-primary); }

.chat-send-btn {
  background: var(--color-primary) !important;
  color: white !important;
  width: 42px;
  height: 42px;
}

.chat-send-btn:hover { background: var(--color-primary-dark) !important; }

/* ============================
   PEDIGREE / ÁRBOL GENEALÓGICO
   ============================ */
.pedigree-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.pedigree-tree {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  overflow-x: auto;
}

.pedigree-generation {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  position: relative;
}

.pedigree-generation:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 16px;
  border-bottom: 2px solid var(--border);
  border-left: 2px solid var(--border);
  border-right: 2px solid var(--border);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.pedigree-great-grandparents { gap: var(--space-sm); }
.pedigree-great-grandparents .pedigree-node { min-width: 100px; padding: var(--space-xs) var(--space-sm); }

.pedigree-grandparents { gap: var(--space-lg); }
.pedigree-subject { justify-content: center; }

.pedigree-node {
  background: var(--bg-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  min-width: 130px;
  text-align: center;
  position: relative;
  transition: all var(--transition);
}

.pedigree-node:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.pedigree-node.champion {
  border-color: var(--color-gold);
  background: linear-gradient(135deg, var(--bg-2) 0%, rgba(212, 164, 55, 0.1) 100%);
}

.pedigree-subject .pedigree-node {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  min-width: 160px;
  padding: var(--space-md);
  transform: scale(1.1);
}

.pedigree-subject .pedigree-node-name { font-size: 1.05rem; }

.pedigree-titles {
  position: absolute;
  top: -10px;
  right: -8px;
  background: var(--color-gold);
  color: #1A1A1A;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.pedigree-node-name {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.pedigree-node-line {
  font-size: 0.7rem;
  opacity: 0.8;
  font-style: italic;
}

.pedigree-node-sex {
  font-size: 0.8rem;
  margin-top: 2px;
  opacity: 0.7;
}

.pedigree-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-sm);
}

.pedigree-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
}

.pedigree-info-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-3);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  font-weight: 600;
}

.pedigree-info-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

/* ============================
   ESTUDIOS VETERINARIOS
   ============================ */
.vet-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.vet-status-badge.healthy {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.vet-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.vet-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.vet-summary-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vet-summary-content { flex: 1; min-width: 0; }
.vet-summary-value { font-size: 1.1rem; font-weight: 800; }
.vet-summary-label { font-size: 0.75rem; color: var(--text-2); }

.vet-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: var(--space-md) 0 var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
}

.vet-records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-sm);
}

.vet-record-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
}

.vet-record-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.vet-record-date {
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 600;
}

.vet-record-status {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.vet-record-status.good {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.vet-record-status.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.vet-record-name {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.vet-record-details {
  font-size: 0.75rem;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vet-certifications { margin-top: var(--space-lg); }

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-sm);
}

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  position: relative;
  transition: all var(--transition);
}

.cert-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.cert-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cert-content { flex: 1; min-width: 0; }
.cert-name { font-weight: 700; font-size: 0.9rem; }
.cert-issuer { font-size: 0.75rem; color: var(--text-2); margin: 2px 0; }
.cert-date { font-size: 0.7rem; color: var(--text-3); }

.cert-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================
   PROFILE ENHANCEMENTS
   ============================ */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.info-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}

.info-row:last-child { border-bottom: none; }
.info-row:hover { background: var(--bg-2); }

.info-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
}

.info-icon svg { width: 20px; height: 20px; }

.info-content { flex: 1; min-width: 0; }

.info-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-3);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  font-weight: 600;
}

.info-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

/* Ranch */
.ranch-hero {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 200px;
  margin-bottom: var(--space-md);
}

.ranch-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.4);
}

.ranch-hero-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-lg);
  color: white;
}

.ranch-name {
  font-family: var(--font-display);
  font-size: 2.5rem;
  letter-spacing: 0.05em;
  margin: 0 0 4px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.ranch-tagline {
  font-size: 1rem;
  opacity: 0.9;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  margin: 0;
}

.ranch-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.ranch-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  transition: all var(--transition);
}

.ranch-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.ranch-stat-icon { font-size: 1.8rem; margin-bottom: var(--space-xs); }
.ranch-stat-value { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.ranch-stat-label { font-size: 0.7rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

/* Social Media */
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-sm);
}

.social-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  position: relative;
}

.social-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.social-card.facebook:hover { border-color: #1877F2; }
.social-card.instagram:hover { border-color: #E4405F; }
.social-card.tiktok:hover { border-color: #000; }
.social-card.youtube:hover { border-color: #FF0000; }
.social-card.whatsapp:hover { border-color: #25D366; }

.social-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.social-card.facebook .social-icon { background: linear-gradient(135deg, #1877F2 0%, #0c63d4 100%); }
.social-card.instagram .social-icon { background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.social-card.tiktok .social-icon { background: linear-gradient(135deg, #000 0%, #25F4EE 50%, #FE2C55 100%); }
.social-card.youtube .social-icon { background: linear-gradient(135deg, #FF0000 0%, #cc0000 100%); }
.social-card.whatsapp .social-icon { background: linear-gradient(135deg, #25D366 0%, #128C7E 100%); }

.social-content { flex: 1; min-width: 0; }

.social-name { font-weight: 700; font-size: 0.95rem; }
.social-handle { font-size: 0.8rem; color: var(--text-2); margin: 2px 0; }
.social-stats { font-size: 0.7rem; color: var(--text-3); }

.social-arrow {
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.social-card:hover .social-arrow { transform: translateX(4px); color: var(--color-primary); }
