/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --bg:        #0d0d0d;
  --bg-card:   #161616;
  --bg-input:  #1a1a1a;
  --gold:      #C9A84C;
  --gold-light:#e8c46a;
  --cream:     #F5F0E8;
  --muted:     #888;
  --danger:    #e05252;
  --success:   #4caf50;
  --border:    #2a2a2a;
  --radius:    8px;
  --transition:150ms ease;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100%; }
body {
  background: var(--bg);
  color: var(--cream);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100%;
  padding-top: 64px;
}
.site-main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }
ul { list-style: none; }
h1 { font-size: clamp(1.8rem, 5vw, 3.5rem); line-height: 1.15; }
h2 { font-size: clamp(1.4rem, 3vw, 2.5rem); line-height: 1.2; }

/* ── Container ─────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; box-sizing: border-box; }

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  overflow: visible;
  min-height: 64px;
  background: rgba(13,13,13,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 80px;
  padding-left: 0;
  margin-left: 0;
}
.nav-logo { display:flex; align-items:center; gap:1.75rem; text-decoration:none; margin-left:15px; padding-left:0; }
.nav-logo-text { font-size:1.2rem; font-weight:700; color:#F5F0E8; }
.nav-logo-text span { color:#C9A84C; }

.main-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--cream);
  padding: .4rem .8rem;
  border-radius: var(--radius);
  font-size: .9rem;
  transition: background var(--transition), color var(--transition);
}
.main-nav a:hover, .main-nav a.active { background: var(--bg-card); color: var(--gold); }
.btn-nav-perfil {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--cream) !important;
}
.btn-nav-admin {
  background: var(--gold) !important;
  color: var(--bg) !important;
  font-weight: 700;
}
.btn-nav-login {
  border: 1px solid var(--gold);
  color: var(--gold) !important;
}
.btn-nav-register {
  background: var(--gold) !important;
  color: var(--bg) !important;
  font-weight: 600;
}
.btn-nav-logout { color: var(--muted) !important; font-size: .85rem !important; }

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--cream); transition: var(--transition); }

/* ── Hero / Slider ─────────────────────────────────────────────── */
.hero {
  position: relative;
  height: 60.25vh !important;
  overflow: hidden;
  background: #0d0d0d;
}
.slider { position: relative; width: 100%; height: 100%; }
.slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity .8s ease;
}
.slide.active { opacity: 1; }
.slide::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(13,13,13,.2) 0%, rgba(13,13,13,.7) 100%);
}
.hero-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  z-index: 2; padding: 3rem 1.5rem;
  text-align: center;
}
.hero-title {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900;
  color: var(--cream);
  line-height: 1.1;
  text-shadow: 0 2px 16px rgba(0,0,0,.8);
}
.hero-title span { color: var(--gold); }
.hero-sub {
  font-size: 1.1rem;
  color: var(--cream);
  opacity: .85;
  margin: .75rem 0 1.5rem;
  text-shadow: 0 1px 8px rgba(0,0,0,.8);
}
.slider-dots {
  position: absolute;
  bottom: 1rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: .5rem; z-index: 3;
}
.slider-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.4); cursor: pointer;
  transition: background var(--transition);
}
.slider-dot.active { background: var(--gold); }

/* ── Botones ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.5rem;
  border-radius: var(--radius);
  font-size: .95rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all .2s ease;
  text-decoration: none;
}
.btn:hover { opacity: .88; transform: translateY(-1px); color: #FFFFFF; }
.btn:active { transform: translateY(0); }
.btn-gold  { background: var(--gold); color: #FFFFFF; }
.btn-gold:hover { background: #e8c46a; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(201,168,76,.3); opacity: 1; }
.btn-outline { background: transparent; border: 2px solid var(--gold); color: var(--gold); }
.btn-outline:hover { background: rgba(201,168,76,.1); transform: translateY(-1px); opacity: 1; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .4rem 1rem; font-size: .85rem; }
.btn-block { width: 100%; }

/* ── Secciones home ─────────────────────────────────────────────── */
.section { padding: 4rem 0; }
.section-title {
  font-size: 1.75rem; font-weight: 800;
  color: var(--cream); margin-bottom: .5rem;
}
.section-title span { color: var(--gold); }
.section-lead { color: var(--muted); margin-bottom: 2rem; }
.divider { width: 48px; height: 3px; background: var(--gold); border-radius: 2px; margin: .75rem 0 1.5rem; }

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), transform .2s ease, box-shadow .2s ease;
}
.card:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(201,168,76,.12); }
.card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; transition: transform .3s ease; }
.card:hover .card-img { transform: scale(1.03); }
.card-body { padding: 1.25rem; }
.card-title { font-size: 1.1rem; font-weight: 700; color: var(--cream); margin-bottom: .4rem; }
.card-text { font-size: .9rem; color: var(--muted); }
.card-price { font-size: 1.25rem; font-weight: 800; color: var(--gold); margin-top: .75rem; }

/* ── Formularios ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-size: .85rem; font-weight: 600;
  color: var(--muted); margin-bottom: .4rem; text-transform: uppercase; letter-spacing: .04em;
}
.form-control {
  width: 100%;
  padding: .7rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--cream);
  font-size: .95rem;
  transition: border-color var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.15);
}
.form-control::placeholder { color: #555; }
select.form-control { cursor: pointer; }

/* ── Auth pages ─────────────────────────────────────────────────── */
.auth-page {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 1rem;
}
.auth-box {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
}
.auth-logo {
  text-align: center; margin-bottom: 1.5rem;
}
.auth-logo h1 { font-size: 1.5rem; color: var(--gold); }
.auth-logo p  { font-size: .85rem; color: var(--muted); }

/* ── Alertas ────────────────────────────────────────────────────── */
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  margin-bottom: 1rem;
  border-left: 3px solid;
}
.alert-error   { background: rgba(224,82,82,.1); border-color: var(--danger); color: #f08080; }
.alert-success { background: rgba(76,175,80,.1); border-color: var(--success); color: #80c880; }
.alert-info    { background: rgba(201,168,76,.1); border-color: var(--gold); color: var(--gold); }

/* ── Dashboard perfil ───────────────────────────────────────────── */
.perfil-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
  padding: 2rem 0;
  min-height: 60vh;
}
.perfil-sidebar {
  display: block !important;
  min-width: 220px;
  width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  height: fit-content;
  position: sticky; top: 80px;
}
.perfil-menu-toggle { display: none; }
.perfil-sidebar .user-avatar {
  width: 64px; height: 64px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 900;
  color: var(--bg);
  margin: 0 auto 1rem;
}
.perfil-sidebar .user-name { text-align: center; font-weight: 700; margin-bottom: .25rem; }
.perfil-sidebar .user-pts  {
  text-align: center; font-size: 1.5rem; font-weight: 900;
  color: var(--gold);
}
.perfil-sidebar .user-pts small { display: block; font-size: .75rem; color: var(--muted); font-weight: 400; }
.sidebar-nav { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.sidebar-nav a {
  display: block; padding: .6rem .75rem;
  color: var(--cream); border-radius: var(--radius);
  font-size: .9rem; transition: background var(--transition), color var(--transition);
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(201,168,76,.1); color: var(--gold);
}
.perfil-content { flex: 1; min-width: 0; width: 100%; }

/* ── Cargar ticket layout ───────────────────────────────────────── */
.cargar-ticket-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-top: 1.5rem;
}
.cargar-ticket-ayuda { order: 1; }
.cargar-ticket-form  { order: 2; }

/* ── Tabla ──────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%; border-collapse: collapse;
  font-size: .9rem;
}
.data-table th {
  padding: .75rem 1rem; text-align: left;
  background: var(--bg-card); color: var(--muted);
  font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
  color: var(--cream);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }

/* Badges */
.badge {
  display: inline-block; padding: .2rem .6rem;
  border-radius: 20px; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge-gold      { background: rgba(201,168,76,.2); color: var(--gold); }
.badge-success   { background: rgba(76,175,80,.2); color: var(--success); }
.badge-danger    { background: rgba(224,82,82,.2); color: var(--danger); }
.badge-muted     { background: rgba(136,136,136,.2); color: var(--muted); }
.badge-canjeable { background: #1a4a1a; color: #4caf50; padding: .2rem .6rem; border-radius: 4px; font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.badge-canjeado  { background: #2a2a2a; color: #888;    padding: .2rem .6rem; border-radius: 4px; font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.badge-vencido   { background: #4a1a1a; color: #e05252; padding: .2rem .6rem; border-radius: 4px; font-size: .75rem; font-weight: 700; text-transform: uppercase; }

/* ── Código destacado ───────────────────────────────────────────── */
.code-display {
  background: var(--bg-input);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  margin: 1.5rem 0;
}
.code-display .code-text {
  font-size: 2.5rem; font-weight: 900;
  letter-spacing: .3em; color: var(--gold);
}
.code-display p { font-size: .85rem; color: var(--muted); margin-top: .5rem; }

/* ── Puntos progress ────────────────────────────────────────────── */
.pts-bar-wrap { margin: 1rem 0; }
.pts-bar-track {
  height: 8px; background: var(--border);
  border-radius: 4px; overflow: hidden;
}
.pts-bar-fill {
  height: 100%; background: var(--gold);
  border-radius: 4px; transition: width .6s ease;
}

/* ── Admin layout ───────────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 64px);
}
.admin-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  position: sticky; top: 64px; height: calc(100vh - 64px);
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.admin-sidebar h3 {
  font-size: .75rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted);
  margin: 1rem 0 .5rem;
}
.admin-sidebar a {
  display: block; padding: .55rem .75rem;
  color: var(--cream); border-radius: var(--radius);
  font-size: .9rem;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: rgba(201,168,76,.1); color: var(--gold);
}
.admin-main { padding: 2rem; min-width: 0; }
.admin-title {
  font-size: 1.5rem; font-weight: 800;
  color: var(--cream); margin-bottom: 1.5rem;
}

/* Stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.stat-card .stat-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; }
.stat-card .stat-value { font-size: 2rem; font-weight: 900; color: var(--gold); line-height: 1.2; }

/* ── Modal (verificación de edad) ──────────────────────────────── */
.age-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  background: rgba(0,0,0,.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.age-box {
  background: var(--bg-card);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center; max-width: 380px; width: 90%;
}
.age-box h2 { font-size: 1.5rem; color: var(--gold); margin-bottom: .5rem; }
.age-box p  { color: var(--muted); margin-bottom: 2rem; font-size: .95rem; }
.age-actions { display: flex; gap: 1rem; justify-content: center; }
.age-no { background: var(--bg-input); border: 1px solid var(--border); color: var(--muted); }

/* ── Campana de notificaciones (admin header) ───────────────────── */
.notif-bell-wrap {
  position: relative;
  display: inline-flex;
}
.notif-bell-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--cream);
  padding: .3rem .45rem;
  position: relative;
  border-radius: 6px;
  transition: background .15s;
  line-height: 1;
}
.notif-bell-btn:hover { background: rgba(255,255,255,.08); }
.notif-badge {
  position: absolute;
  top: -3px; right: -5px;
  background: #e05252;
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 0 4px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
}
.notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  z-index: 500;
  max-height: 420px;
  overflow-y: auto;
}
.notif-dropdown-header {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .82rem;
  font-weight: 700;
  position: sticky;
  top: 0;
  background: var(--bg-card);
}
.notif-item {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
}
.notif-item.unread { border-left-color: var(--gold); }

/* ── Calendario de cumpleaños ───────────────────────────────────── */
.calendario-header-dias {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.calendario-header-dias > div {
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  padding: .4rem 0;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.calendario-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  width: 100%;
}
.calendario-dia {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: .9rem;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
  user-select: none;
  cursor: default;
}
.calendario-dia.vacio {
  background: transparent;
  border: none;
}
.calendario-dia.hoy {
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
}
.calendario-dia.tiene-cumple {
  background: rgba(201, 168, 76, 0.15);
  border: 1px solid #C9A84C;
  cursor: pointer;
  color: var(--cream);
}
.calendario-dia.tiene-cumple:hover {
  background: rgba(201, 168, 76, 0.28);
}
.calendario-dia.tiene-cumple.hoy {
  background: rgba(201, 168, 76, 0.25);
  border-color: var(--gold);
}
.cal-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}
.cal-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 280px;
  max-height: 520px;
  overflow-y: auto;
}

/* ── Responsive ─────────────────────────────────────────────────── */

/* Tablet: 768px – 1023px */
@media (max-width: 1023px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-layout { grid-template-columns: 200px 1fr; }
}

/* Desktop: sidebar visible, rail/drawer ocultos */
@media (min-width: 768px) {
  .perfil-menu-toggle { display: none !important; }
  .perfil-sidebar     { display: block !important; }
  .sidebar-rail       { display: none !important; }
  .sidebar-drawer     { display: none !important; }
  .drawer-overlay     { display: none !important; }
  .perfil-layout      { margin-left: 0; }
}

/* Mobile: hasta 767px */
@media (max-width: 767px) {
  .container { padding: 0 1rem; }

  /* Navbar */
  .menu-toggle { display: flex; }
  .site-header { position: sticky; }
  .main-nav {
    display: none;
    position: absolute;
    top: 80px; left: 0; right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: .25rem;
    z-index: 200;
  }
  .main-nav.open { display: flex; }
  .main-nav a { text-align: center; padding: .6rem 1rem; }
  .nav-logo { gap: 1rem; margin-left: 8px; }
  .nav-logo-desktop { display: none !important; }
  .nav-logo-mobile  { display: block !important; height: 60px !important; }
  .nav-logo-text    { font-size: 1rem; }

  /* Hero */
  .hero { height: 45vh; }
  .hero-title { font-size: clamp(1.6rem, 6vw, 2.5rem); }
  .hero-content { padding: 2rem 1rem; }
  .hero-sub { font-size: .95rem; margin-bottom: 1rem; }

  /* Tipografía */
  body           { font-size: 0.9rem; }
  .section-title { font-size: clamp(1.2rem, 3vw, 2rem); }
  p, .card-text  { font-size: 0.85rem; }

  /* Secciones */
  .section { padding: 2rem 0; }
  .cards-grid { grid-template-columns: 1fr; }
  .contacto-grid { flex-direction: column !important; }
  .contacto-mapa { width: 100% !important; margin-top: 1.5rem; }
  .contacto-mapa .map-embed { height: 300px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Perfil & Admin */
  .perfil-layout {
    margin-left: 0 !important;
  }
  .perfil-content {
    margin-left: 44px;
    width: calc(100% - 44px);
    min-width: 0;
    overflow-x: hidden;
    padding: .75rem;
    box-sizing: border-box;
  }
  .perfil-sidebar { display: none !important; }
  .perfil-menu-toggle { display: none !important; }
  .cargar-ticket-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .cargar-ticket-ayuda { order: 1; }
  .cargar-ticket-form  { order: 2; }
  /* Nada se sale del contenedor */
  .perfil-content * { max-width: 100%; box-sizing: border-box; }
  /* Tablas con scroll horizontal */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
  /* Footer siempre encima del rail */
  .site-footer { position: relative; z-index: 200 !important; }
  .footer-mobile { position: relative !important; z-index: 200 !important; background: #111 !important; }
  /* Sidebar rail — fixed, siempre visible al scrollear */
  .sidebar-rail {
    position: fixed !important;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 44px;
    background: #111111;
    border-right: 1px solid #2a2a2a;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    padding: .5rem 0;
    z-index: 149;
    gap: .25rem;
    overflow: hidden;
  }
  .rail-toggle {
    background: none; border: none;
    color: #C9A84C; font-size: 1.3rem;
    cursor: pointer; padding: .4rem;
    margin-bottom: .5rem;
  }
  .rail-icon {
    position: relative;
    font-size: 1.1rem; padding: .4rem;
    border-radius: 6px; text-decoration: none;
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    -webkit-tap-highlight-color: transparent;
  }
  .rail-icon:hover { background: rgba(201,168,76,.15); }
  .rail-icon::after {
    content: attr(title);
    position: absolute;
    left: 50px; top: 50%;
    transform: translateY(-50%);
    background: #1a1a1a;
    color: #C9A84C;
    border: 1px solid #333;
    padding: .25rem .5rem;
    border-radius: 6px;
    font-size: .72rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
    z-index: 600;
  }
  /* Tooltip solo en dispositivos con hover real, nunca en touch */
  @media (hover: hover) and (pointer: fine) {
    .rail-icon:hover::after { opacity: 1; }
  }
  @media (hover: none) {
    .rail-icon::after { display: none !important; }
  }
  .rail-logout { margin-top: auto !important; margin-bottom: 130px !important; flex-shrink: 0 !important; color: #888; font-size: 1rem; }
  /* Drawer */
  .sidebar-drawer {
    position: fixed;
    top: 64px; left: -280px; bottom: 0;
    width: 280px;
    background: #161616;
    border-right: 1px solid #2a2a2a;
    z-index: 500;
    transition: left .3s ease;
    overflow-y: auto;
    padding: 1rem;
  }
  .sidebar-drawer.open { left: 0; }
  .drawer-overlay {
    position: fixed;
    top: 64px; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.6);
    z-index: 400;
    display: none;
  }
  .drawer-overlay.active { display: block; }
  .drawer-close,
  .sidebar-drawer > button#drawerCloseBtn {
    position: absolute !important;
    top: .75rem; right: .75rem;
    background: none; border: 1px solid #333;
    color: #F5F0E8; font-size: 1rem; cursor: pointer;
    width: 32px; height: 32px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    z-index: 600 !important;
  }
  .drawer-header {
    text-align: center;
    padding: 1rem 0;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 1rem;
  }
  .drawer-nav a {
    display: block; padding: .6rem .5rem;
    color: #888; text-decoration: none;
    border-radius: 6px; font-size: .95rem;
  }
  .drawer-nav a:hover { background: rgba(201,168,76,.1); color: #C9A84C; }
  /* Rail mobile */
  .sidebar-rail   { top: 75px !important; bottom: 0 !important; z-index: 149 !important; background: #111111 !important; border-right: 1px solid #2a2a2a !important; }
  .sidebar-drawer { top: 75px !important; bottom: 0 !important; }
  .drawer-overlay { top: 75px !important; bottom: 0 !important; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; overflow-y: visible; }
  .admin-main { padding: 1.25rem 1rem; }

  /* Tablas */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 560px; }

  /* Auth */
  .auth-box { padding: 1.75rem 1.25rem; }
}

/* Mobile pequeño: hasta 480px */
@media (max-width: 480px) {
  .nav-logo-text { display: none; }
  .nav-logo { gap: .75rem; }
  .hero { height: 29vh !important; }
  .hero-title { font-size: 1.6rem; }
  .section { padding: 1.5rem 0; }
  .age-actions { flex-direction: column; align-items: center; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Página en construcción ─────────────────────────────────────── */
.construccion {
  text-align: center; padding: 4rem 1rem;
}
.construccion h2 { font-size: 1.5rem; color: var(--gold); margin-bottom: .75rem; }
.construccion p  { color: var(--muted); }

/* ── Carta ──────────────────────────────────────────────────────── */
.carta-wrap { padding: 3rem 0; }
.carta-frame {
  width: 100%; height: 80vh; min-height: 500px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card);
}
.carta-img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }

/* ── Contacto ───────────────────────────────────────────────────── */
.contacto-grid {
  display: flex; flex-wrap: wrap;
  gap: 2rem; padding: 3rem 0;
}
.contacto-info,
.contacto-mapa { flex: 1 1 300px; }
.map-embed {
  width: 100%; height: 350px; border-radius: var(--radius);
  border: 1px solid var(--border);
}
.contacto-mapa { order: -1; }
.contacto-info h2 { font-size: 1.4rem; color: var(--gold); margin-bottom: 1rem; }
.contacto-info p  { color: var(--cream); margin-bottom: .75rem; }
.wa-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: #25d366; color: #fff; padding: .75rem 1.5rem;
  border-radius: var(--radius); font-weight: 700; font-size: 1rem;
  margin-top: 1rem;
}
.wa-btn:hover { background: #1ebe5d; color: #fff; }
.btn-whatsapp       { background: #25D366 !important; color: #ffffff !important; border: none; }
.btn-whatsapp:hover { background: #1ebe5d !important; color: #ffffff !important; }

/* ── Social icon (contacto) ─────────────────────────────────────── */
.social-icon {
  display: inline-block; padding: .4rem .9rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--muted); font-size: .85rem;
  width: fit-content;
}
.social-icon:hover { border-color: var(--gold); color: var(--gold); }

/* ── Animaciones ─────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.container { animation: fadeIn .4s ease; }

.nav-links a { position: relative; }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--gold);
  transition: width .2s ease;
}
.nav-links a:hover::after { width: 100%; }

/* ── Footer ─────────────────────────────────────────────────────── */
.site-footer {
  width: 100%;
  background: #111;
}
.footer-desktop { padding: 0; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}
.footer-col h4 {
  color: #C9A84C;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .6rem;
}
.footer-col a {
  display: block;
  color: #888;
  text-decoration: none;
  font-size: .8rem;
  margin-bottom: .25rem;
  line-height: 1.4;
}
.footer-col a:hover { color: #C9A84C; }
.footer-col p, .footer-tagline {
  color: #888;
  font-size: .8rem;
  margin-bottom: .25rem;
  line-height: 1.4;
}
.footer-social {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.footer-social a {
  display: inline-block;
  width: fit-content;
  padding: .3rem .75rem;
  border: 1px solid #444;
  border-radius: 6px;
  color: #888;
  font-size: .8rem;
}
.footer-social a:hover { border-color: #C9A84C; color: #C9A84C; }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: .5rem 2rem;
  border-top: 1px solid #2a2a2a;
  text-align: center;
  color: #555;
  font-size: .75rem;
  line-height: 1.8;
}
.footer-desktop img[alt="AFIP Data Fiscal"] { height: 60px !important; }
/* Footer mobile */
.footer-mobile {
  display: none;
  padding: .5rem .75rem;
}
.footer-mobile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-bottom: .3rem;
}
.footer-mobile-title {
  color: #C9A84C;
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  margin-bottom: .2rem;
}
.footer-mobile-col a {
  display: block;
  color: #888;
  font-size: .65rem;
  text-decoration: none;
  margin-bottom: .15rem;
}
.footer-mobile-col a:hover { color: #C9A84C; }
.footer-mobile-col img[alt="AFIP"] { height: 25px !important; }
.footer-mobile-bottom {
  text-align: center;
  color: #555;
  font-size: .6rem;
  margin: .1rem 0;
  line-height: 1.3;
}

@media (max-width: 1023px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}
/* Desktop: footer normal, no fijo */
@media (min-width: 768px) {
  .site-footer { position: static; }
  .footer-mobile  { display: none !important; }
  .footer-desktop { display: block; }
  body { padding-bottom: 0; }
}
/* Mobile: footer estático compacto */
@media (max-width: 767px) {
  .footer-desktop { display: none !important; }
  .footer-mobile  { display: block !important; position: static !important; }
  body { padding-bottom: 0 !important; }
}

/* Popup carta — full width en mobile */
@media (max-width: 767px) {
  #popupModal > div {
    max-width: 100% !important;
  }
}
