/* ============================================================
   styles.css — ComerciosEnTuCiudad
   ============================================================ */
:root {
  --primary: #14204a;
  --accent:  #0e8794;
  --accent2: #0b6a7a;
  --light:   #eef6fb;
  --gray:    #6c757d;
  --border:  #d5e5ee;
  --white:   #ffffff;
  --success: #28a745;
  --shadow:    0 2px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius:    12px;
  --radius-sm: 8px;
}

* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Segoe UI',system-ui,sans-serif; background:var(--light); color:var(--primary); }

.hidden { display:none !important; }

/* ---- Buttons ---- */
.btn { display:inline-flex; align-items:center; gap:8px; padding:10px 20px; border-radius:var(--radius-sm); border:none; cursor:pointer; font-size:14px; font-weight:600; transition:all .2s; text-decoration:none; }
.btn-primary   { background:var(--accent); color:white; }
.btn-primary:hover  { background:#0a6b78; transform:translateY(-1px); box-shadow:0 4px 12px rgba(14,135,148,.3); }
.btn-secondary { background:white; color:var(--primary); border:1.5px solid var(--border); }
.btn-secondary:hover { border-color:var(--accent); color:var(--accent); }
.btn-dark    { background:var(--accent2); color:white; }
.btn-sm      { padding:7px 14px; font-size:13px; }
.btn-danger  { background:#dc3545; color:white; }
.btn-danger:hover { background:#b02a37; }

/* ---- Badges ---- */
.badge      { display:inline-block; padding:4px 10px; border-radius:20px; font-size:12px; font-weight:600; }
.badge-blue { background:#e3f0ff; color:#1a56db; }

/* ---- Forms ---- */
.input    { width:100%; padding:10px 14px; border:1.5px solid var(--border); border-radius:var(--radius-sm); font-size:14px; outline:none; transition:.2s; background:white; }
.input:focus  { border-color:var(--accent); box-shadow:0 0 0 3px rgba(14,135,148,.1); }
.select   { width:100%; padding:10px 14px; border:1.5px solid var(--border); border-radius:var(--radius-sm); font-size:14px; outline:none; background:white; cursor:pointer; }
.select:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(14,135,148,.1); }
.textarea { width:100%; padding:10px 14px; border:1.5px solid var(--border); border-radius:var(--radius-sm); font-size:14px; outline:none; resize:vertical; min-height:100px; font-family:inherit; }
.textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(14,135,148,.1); }
.label    { display:block; font-size:13px; font-weight:600; margin-bottom:6px; }
.form-group { margin-bottom:20px; }

/* ---- Cards & layout ---- */
.card { background:white; border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; }
.alert { padding:12px 16px; border-radius:var(--radius-sm); font-size:14px; margin-bottom:16px; }
.alert-success { background:#d4edda; color:#155724; border:1px solid #c3e6cb; }
.alert-error   { background:#f8d7da; color:#721c24; border:1px solid #f5c6cb; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; }

/* ---- Spinner ---- */
.spinner { display:inline-block; width:20px; height:20px; border:3px solid rgba(255,255,255,.3); border-top-color:white; border-radius:50%; animation:spin .7s linear infinite; }
.spinner-dark { border-color:rgba(0,0,0,.1); border-top-color:var(--accent); }
@keyframes spin { to { transform:rotate(360deg); } }
.loading-overlay { position:fixed; inset:0; background:rgba(255,255,255,.8); display:flex; align-items:center; justify-content:center; z-index:9999; }

/* ---- Toast ---- */
#toast { position:fixed; bottom:24px; right:24px; background:var(--primary); color:white; padding:14px 20px; border-radius:var(--radius-sm); font-size:14px; z-index:9999; transition:.3s; transform:translateY(100px); opacity:0; max-width:300px; }
#toast.show { transform:translateY(0); opacity:1; }

/* ---- Navbar ---- */
#navbar { background:var(--primary); color:white; padding:0 5%; position:sticky; top:0; z-index:100; box-shadow:0 2px 10px rgba(0,0,0,.2); }
.nav-inner { display:flex; align-items:center; justify-content:space-between; height:64px; }
.logo { font-size:22px; font-weight:800; cursor:pointer; flex-shrink:0; }
.logo span { color:var(--accent); }
.nav-right { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.nav-link { color:rgba(255,255,255,.8); font-size:14px; cursor:pointer; padding:6px 10px; border-radius:6px; transition:.2s; white-space:nowrap; }
.nav-link:hover { color:white; background:rgba(255,255,255,.1); }
.avatar { width:36px; height:36px; border-radius:50%; background:var(--accent); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; cursor:pointer; flex-shrink:0; }

/* ── Avatar dropdown navbar ── */
.nav-user-menu    { position:static; }
.nav-avatar-btn   { display:flex; align-items:center; gap:5px; cursor:pointer; padding:4px 6px; border-radius:8px; transition:background .15s; }
.nav-avatar-btn:hover { background:rgba(255,255,255,.12); }

/* Dropdown: fixed en móvil para evitar overflow, absolute en desktop */
.nav-dropdown {
  display: none;
  position: fixed;
  top: 64px;
  right: 12px;
  width: 240px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  z-index: 500;
  overflow: hidden;
  animation: dropdownFade .15s ease;
}
.nav-dropdown.open { display:block; }
@keyframes dropdownFade { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }

.nav-dropdown-user  { padding:14px 16px 10px; border-bottom:1px solid var(--border); }
.nav-dropdown-name  { font-weight:700; font-size:14px; color:var(--dark); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nav-dropdown-email { font-size:12px; color:var(--gray); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.nav-dropdown-item  { padding:12px 16px; font-size:14px; color:var(--dark); cursor:pointer; transition:background .12s; display:flex; align-items:center; gap:10px; white-space:nowrap; }
.nav-dropdown-item:hover { background:var(--light); }
.nav-dropdown-item-danger { color:#dc3545; }
.nav-dropdown-item-danger:hover { background:#fff0f0; }
.nav-dropdown-item-mobile { display:none; }
.nav-dropdown-item-desktop { display:flex; }

/* ---- Pages ---- */
.page { display:none; min-height:calc(100vh - 64px); }
.page.active { display:block; }

/* ---- Hero ---- */
.hero { background:linear-gradient(135deg,var(--primary) 0%,var(--accent2) 100%); color:white; padding:80px 5% 100px; text-align:center; }
.hero h1 { font-size:clamp(28px,4vw,52px); font-weight:800; margin-bottom:16px; line-height:1.2; }
.hero p  { font-size:18px; opacity:.85; margin-bottom:40px; max-width:560px; margin-left:auto; margin-right:auto; }
.hero .hero-biz { margin:32px auto 0; max-width:620px; display:flex; flex-direction:column; align-items:center; gap:14px; }
.hero .hero-biz .hero-biz-text { font-size:15px; opacity:.85; margin:0; max-width:none; }
.hero .hero-biz-btn, .hero .hero-biz-btn:visited { display:inline-block; padding:10px 22px; border-radius:999px; border:1.5px solid rgba(255,255,255,.7);
  color:#fff; font-weight:700; font-size:15px; text-decoration:none; transition:background .15s, color .15s; }
.hero .hero-biz-btn:hover, .hero .hero-biz-btn:focus-visible { background:#fff; color:var(--primary); }
/* Ilustración de la portada: la escena dibujada a mano (ciudad, luna y pájaros), en blanco muy suave */
.hero { position:relative; isolation:isolate; }
.hero::before { content:""; position:absolute; inset:0; z-index:-1; pointer-events:none;
  background:url('/img/hero-escena.png') center bottom / auto 100% no-repeat; opacity:.16; }
.search-box { background:white; border-radius:var(--radius); padding:8px; display:flex; gap:8px; max-width:100%; margin:0 auto; box-shadow:0 8px 40px rgba(0,0,0,.2); align-items:center; }
.search-input-wrap { flex:1; position:relative; display:flex; align-items:center; }
.search-icon { position:absolute; left:12px; font-size:18px; pointer-events:none; display:flex; align-items:center; color:var(--gray); transition:opacity .15s; }
.search-box input  { flex:1; border:none; outline:none; padding:10px 16px 10px 38px; font-size:15px; color:var(--primary); min-width:0; }
.search-box select { border:none; outline:none; padding:10px; font-size:14px; color:var(--gray); background:var(--light); border-radius:var(--radius-sm); }

/* ---- Stats bar ---- */
.stats-bar    { background:white; padding:18px 5%; display:flex; justify-content:center; align-items:center; gap:0; border-bottom:1px solid var(--border); flex-wrap:nowrap; }
.stat-item    { display:flex; align-items:center; gap:10px; padding:0 28px; }
.stat-icon    { font-size:22px; flex-shrink:0; }
.stat-num     { font-size:22px; font-weight:800; color:var(--accent); line-height:1; }
.stat-label   { font-size:12px; color:var(--gray); margin-top:2px; }
.stat-divider { width:1px; height:36px; background:var(--border); flex-shrink:0; }

/* ---- Section ---- */
.section       { padding:60px 5%; }
.section-title { font-size:26px; font-weight:800; margin-bottom:8px; }
.section-sub   { color:var(--gray); margin-bottom:32px; }

/* ---- Categories grid ---- */
.categories-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:16px; margin-bottom:48px; }
.cat-card  { background:white; border-radius:var(--radius); padding:24px 16px; text-align:center; cursor:pointer; border:2px solid transparent; transition:.2s; box-shadow:var(--shadow); }

/* ── Sección categorías home ── */
.cats-section-header { display:flex; flex-direction:row-reverse; justify-content:flex-end; align-items:flex-end; gap:16px; margin-bottom:20px; }
.cats-toggle-btn     { display:none; } /* oculto en desktop */
.cats-drawer-header  { display:none; } /* oculto en desktop */
.cats-drawer         { } /* desktop: flujo normal */
.cat-card:hover { border-color:var(--accent); transform:translateY(-3px); box-shadow:var(--shadow-lg); }
.cat-icon  { font-size:32px; margin-bottom:10px; }
.cat-name  { font-size:13px; font-weight:600; }
.cat-count { font-size:12px; color:var(--gray); margin-top:4px; }

/* ---- Companies grid ---- */
.companies-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:24px; }
.company-card   { background:white; border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); transition:.2s; cursor:pointer; }
.company-card:hover { transform:translateY(-4px); box-shadow:var(--shadow-lg); }
.company-card-banner { height:100px; position:relative; display:flex; align-items:flex-end; padding:12px; }
.company-card-logo   { width:56px; height:56px; border-radius:10px; background:white; border:3px solid white; object-fit:cover; box-shadow:0 2px 8px rgba(0,0,0,.15); display:flex; align-items:center; justify-content:center; font-size:22px; font-weight:800; overflow:hidden; }
.company-card-body   { padding:14px 16px; }
.company-name  { font-size:16px; font-weight:700; margin-bottom:4px; }
.company-cat   { font-size:12px; color:var(--gray); margin-bottom:8px; }
.company-desc  { font-size:13px; color:var(--gray); line-height:1.5; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.company-meta  { display:flex; align-items:center; justify-content:space-between; margin-top:12px; padding-top:12px; border-top:1px solid var(--border); }

/* ---- Directory layout ---- */
.directory-layout { display:grid; grid-template-columns:260px 1fr; gap:28px; padding:40px 5%; }
.filters-panel    { background:white; border-radius:var(--radius); padding:0; box-shadow:var(--shadow); position:sticky; top:80px; align-self:start; }
/* En desktop filters-scroll-body lleva el padding y no tiene límite de altura */
.filters-scroll-body { padding:24px; }
.filter-title     { font-size:16px; font-weight:700; margin-bottom:20px; display:flex; justify-content:space-between; align-items:center; }
.filter-group     { margin-bottom:24px; }
.filter-label     { font-size:13px; font-weight:600; color:var(--gray); text-transform:uppercase; letter-spacing:.5px; margin-bottom:10px; }
.filter-option    { display:flex; align-items:center; gap:8px; margin-bottom:8px; cursor:pointer; font-size:14px; }
.filter-option input[type=checkbox] { accent-color:var(--accent); width:16px; height:16px; }


/* ── Filtros provincia/ciudad ── */
.filter-search-input {
  width:100%; padding:7px 10px; font-size:13px;
  border:1px solid var(--border); border-radius:var(--radius-sm);
  margin-bottom:8px; outline:none; box-sizing:border-box;
}
.filter-search-input:focus { border-color:var(--accent); }

.filter-scroll-list {
  max-height:160px; overflow-y:auto; padding-right:4px;
  scrollbar-width:thin; scrollbar-color:#ddd transparent;
}
.filter-scroll-list::-webkit-scrollbar { width:4px; }
.filter-scroll-list::-webkit-scrollbar-thumb { background:#ddd; border-radius:2px; }

/* Badge contador de filtros activos */
#filters-badge {
  display:none; align-items:center; justify-content:center;
  background:var(--accent); color:white;
  font-size:11px; font-weight:700;
  width:18px; height:18px; border-radius:50%;
  margin-left:6px; line-height:1;
}

/* ── Mapa de empresa (Leaflet) ── */
#company-map-small { position:relative; }
/* Leaflet usa z-index 400–1000 en sus capas, popups y controles. Sin esto,
   el mapa se pintaba por encima de la cabecera fija de la ficha (z-index 90)
   y del navbar (100) al hacer scroll. Con isolation el mapa queda en su
   propia "capa" y todo lo de Leaflet se queda dentro de ella. */
.leaflet-container { position:relative; z-index:0; isolation:isolate; }
#company-map-small .leaflet-control-attribution { font-size:9px; }
/* Ocultar los controles de zoom en el mapa pequeño (no interactivo) */
#company-map-small .leaflet-control-zoom { display:none; }

/* Popup del mapa grande */
#map-popup-overlay { animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* ---- Auth Modal ---- */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:500; align-items:center; justify-content:center; }
.modal-overlay.open { display:flex; }
.modal       { background:white; border-radius:var(--radius); padding:40px; width:100%; max-width:440px; max-height:90vh; overflow-y:auto; position:relative; }
.modal-close { position:absolute; top:16px; right:16px; background:none; border:none; font-size:22px; cursor:pointer; color:var(--gray); }
.modal-title { font-size:24px; font-weight:800; margin-bottom:8px; }
.modal-sub   { color:var(--gray); font-size:14px; margin-bottom:28px; }
.modal-switch { text-align:center; margin-top:20px; font-size:14px; color:var(--gray); }
.modal-switch span { color:var(--accent); cursor:pointer; font-weight:600; }

/* ---- Dashboard ---- */
.dashboard-layout { display:block; min-height:calc(100vh - 64px); }
body.in-dashboard .dashboard-layout { margin-left:240px; }
.sidebar       { background:var(--primary); color:white; padding:24px 0;
                 position:fixed; top:64px; left:0; bottom:0; width:240px;
                 overflow-y:auto; z-index:20; display:none; }
body.in-dashboard .sidebar { display:block; }
.sidebar-user  { padding:0 20px 24px; border-bottom:1px solid rgba(255,255,255,.1); margin-bottom:16px; }
.sidebar-avatar { width:48px; height:48px; border-radius:50%; background:var(--accent); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:18px; margin-bottom:12px; }
.sidebar-name  { font-weight:600; font-size:15px; }
.sidebar-email { font-size:12px; opacity:.6; margin-top:2px; }
.sidebar-nav   { padding:0 12px; }
.sidebar-item  { display:flex; align-items:center; gap:10px; padding:11px 12px; border-radius:var(--radius-sm); cursor:pointer; font-size:14px; color:rgba(255,255,255,.7); transition:.2s; margin-bottom:4px; }
.sidebar-item:hover, .sidebar-item.active { background:rgba(255,255,255,.1); color:white; }
.dash-content  { padding:36px 40px; }
.dash-header   { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:32px; }
.dash-title    { font-size:24px; font-weight:800; }
.dash-sub      { color:var(--gray); font-size:14px; margin-top:4px; }
.dash-stats    { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:32px; }
.stat-card       { background:white; border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); }
.stat-card-num   { font-size:28px; font-weight:800; color:var(--accent); }
.stat-card-label { font-size:13px; color:var(--gray); margin-top:4px; }
.my-company-row  { background:white; border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); display:flex; align-items:center; gap:16px; margin-bottom:12px; }
.my-company-logo { width:52px; height:52px; border-radius:10px; overflow:hidden; display:flex; align-items:center; justify-content:center; font-size:20px; font-weight:800; flex-shrink:0; }
.my-company-info { flex:1; }
.my-company-name { font-weight:700; font-size:16px; }
.my-company-cat  { font-size:13px; color:var(--gray); margin-top:2px; }
.my-company-actions { display:flex; gap:8px; }

/* ---- Company Form ---- */
.form-container  { max-width:860px; margin:0 auto; }
.form-section    { background:white; border-radius:var(--radius); padding:28px; box-shadow:var(--shadow); margin-bottom:24px; }
.form-section-title { font-size:17px; font-weight:700; margin-bottom:6px; display:flex; align-items:center; gap:10px; }
.form-section-sub   { font-size:13px; color:var(--gray); margin-bottom:24px; }
.step-num { width:28px; height:28px; border-radius:50%; background:var(--accent); color:white; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; flex-shrink:0; }

/* ---- Templates (color) ---- */
/* ── Selector de colores (plantillas) ── */
.templates-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; }
.template-card  { border:3px solid var(--border); border-radius:var(--radius); overflow:hidden; cursor:pointer; transition:.2s; }
.template-card:hover { border-color:var(--accent); transform:translateY(-2px); }
.template-card.selected { border-color:var(--accent); box-shadow:0 0 0 3px rgba(14,135,148,.2); }
.template-preview { height:80px; position:relative; overflow:hidden; display:flex; align-items:center; justify-content:center; }
.template-name   { padding:8px; font-size:13px; font-weight:600; text-align:center; }
.template-check  { position:absolute; top:6px; right:6px; width:22px; height:22px; border-radius:50%; background:var(--accent); color:white; display:flex; align-items:center; justify-content:center; font-size:11px; opacity:0; transition:.2s; }
.template-card.selected .template-check { opacity:1; }

/* ── Selector de layouts ── */
.layouts-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:16px; }
.layout-card  { border:3px solid var(--border); border-radius:var(--radius); overflow:hidden; cursor:pointer; transition:.2s; position:relative; }
.layout-card:hover { border-color:var(--accent); transform:translateY(-2px); }
.layout-card.selected { border-color:var(--accent); box-shadow:0 0 0 3px rgba(14,135,148,.2); }
.layout-preview-tabs { display:flex; gap:4px; padding:6px 8px 0; background:white; }
.layout-preview-tab  { flex:1; padding:4px; border:1px solid var(--border); border-radius:6px; background:var(--light); font-size:14px; cursor:pointer; transition:.15s; }
.layout-preview-tab.layout-preview-tab-active { background:var(--accent); border-color:var(--accent); }
.layout-preview     { height:90px; padding:10px; display:flex; flex-direction:column; gap:5px; background:var(--light); }
.layout-preview-bar { border-radius:3px; }
.layout-name        { padding:10px 10px 2px; font-size:13px; font-weight:600; }
.layout-desc        { padding:0 10px 4px; font-size:12px; color:var(--gray); }
.layout-mobile-note { padding:0 10px 10px; font-size:11px; color:var(--accent); font-weight:600; }
.layout-check       { position:absolute; top:36px; right:8px; width:22px; height:22px; border-radius:50%; background:var(--accent); color:white; display:flex; align-items:center; justify-content:center; font-size:11px; opacity:0; transition:.2s; }
.layout-card.selected .layout-check { opacity:1; }

/* ---- Upload areas ---- */
.upload-area { border:2px dashed var(--border); border-radius:var(--radius); padding:32px; text-align:center; cursor:pointer; transition:.2s; }
.upload-area:hover { border-color:var(--accent); background:rgba(14,135,148,.02); }
.upload-icon { font-size:36px; margin-bottom:8px; }
.upload-text { font-size:14px; color:var(--gray); }
.upload-text strong { color:var(--accent); }
.photos-preview { display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }
.photo-preview-item { width:90px; height:90px; border-radius:var(--radius-sm); overflow:hidden; position:relative; border:1px solid var(--border); display:flex; align-items:center; justify-content:center; }
.photo-preview-remove {
  position:absolute; top:4px; right:4px;
  width:22px; height:22px; border-radius:50%;
  background:rgba(220,53,69,.9); color:white;
  font-size:13px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; border:none; line-height:1;
  box-shadow:0 1px 4px rgba(0,0,0,.3);
  transition:.2s;
}
.photo-preview-remove:hover { background:#b02a37; transform:scale(1.1); }

/* ---- Company page ---- */
/* ============================================================
   COMPANY PAGE — header fijo + fondo temático
   ============================================================ */

/* Header fijo — mismo ancho que las cards, color del template */
.company-header-fixed {
  position: fixed;
  top: 64px; /* debajo del navbar */
  left: 0; right: 0;
  z-index: 90;
  /* background se aplica via JS con tpl.banner */
  box-shadow: 0 4px 24px rgba(0,0,0,0.22);
}

/* Contenedor interior con el mismo ancho máximo que las cards */
.company-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 5%;
  display: flex;
  align-items: center;
  gap: 18px;
}
.company-header-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; margin-left: auto;
}

/* Logo */
.company-logo-big {
  width: 64px; height: 64px;
  border-radius: 12px;
  border: 3px solid rgba(255,255,255,0.75);
  background: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800;
  overflow: hidden; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

/* Título y categoría */
.company-title-block { flex: 1; min-width: 0; }
.company-bigname {
  font-size: 20px; font-weight: 800; color: white;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.company-bigcat {
  font-size: 13px; color: rgba(255,255,255,0.85); margin-top: 3px;
}
.company-bigcat span { cursor: pointer; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.4); }
.company-bigcat span:hover { color: white; }

/* Área de contenido — empuja hacia abajo para no quedar debajo del header fijo */
.company-content-area {
  padding-top: 120px; /* valor base; JS lo ajusta a la altura real del header */
  background: linear-gradient(to bottom, transparent 0%, rgba(238,246,251,0.97) 100%, #eef6fb 140px);
  min-height: calc(100vh - 64px);
}

/* ---- Company page layouts ---- */
/* ── Área de contenido compartida ── */
.company-main .card  { padding:28px; margin-bottom:20px; }
.company-sidebar .card { padding:24px; margin-bottom:16px; }

/* ══════════════════════════════════════════════════════════════
   DOS COLUMNAS
   Desktop: main izq (flex:1) + sidebar der (320px fijo)
   Móvil:   stack completo en orden correcto, main/sidebar ocultos
══════════════════════════════════════════════════════════════ */
.company-page-body.layout-two-col {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  padding: 28px 5% 60px;
  max-width: 1200px;
  margin: 0 auto;
}
.company-page-body.layout-two-col .company-mobile-stack { display: none; }

/* ══════════════════════════════════════════════════════════════
   UNA COLUMNA
   Todo centrado en una sola columna, máx 760px
══════════════════════════════════════════════════════════════ */
/* layout-one-col — 1 columna centrada en desktop, company-page-mobile en móvil */
.company-page-body.layout-one-col {
  display: block;
  padding: 28px 5% 60px;
  max-width: 860px;
  margin: 0 auto;
}
.company-page-body.layout-one-col .company-main {
  width: 100%;
}

/* ══════════════════════════════════════════════════════════════
   FICHA LATERAL
   Desktop: igual que dos columnas
   Móvil:   stack con acordeón para horario e info de interés
══════════════════════════════════════════════════════════════ */
.company-page-body.layout-ficha-lateral {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  padding: 28px 5% 60px;
  max-width: 1200px;
  margin: 0 auto;
}
.company-page-body.layout-ficha-lateral .company-mobile-stack { display: none; }

/* Acordeón móvil */
.mobile-accordion { overflow: hidden; }
.mobile-accordion-btn {
  width: 100%; padding: 14px 16px;
  background: none; border: none;
  text-align: left; font-size: 14px; font-weight: 600;
  cursor: pointer; color: var(--dark);
  display: flex; justify-content: space-between; align-items: center;
}
.accordion-arrow { transition: transform .25s; display: inline-block; font-size: 11px; }
.mobile-accordion.open .accordion-arrow { transform: rotate(180deg); }
.mobile-accordion-body {
  max-height: 0; overflow: hidden;
  transition: max-height .35s ease;
  padding: 0 8px;
}
.mobile-accordion.open .mobile-accordion-body { max-height: 2000px; }
.mobile-accordion-body .card {
  box-shadow: none !important;
  border-top: 1px solid var(--border);
  border-radius: 0;
}

/* ══════════════════════════════════════════════════════════════
   REVISTA
   Desktop: galería a pantalla completa arriba, luego 2 col
   Móvil:   galería normal + stack 1 col
══════════════════════════════════════════════════════════════ */
.company-page-body.layout-revista { display: block; }

/* Galería top — misma card que en móvil, centrada con el mismo ancho que el contenido */
.company-page-body.layout-revista .revista-gallery-top {
  padding: 28px 5% 0;
  max-width: 1200px;
  margin: 0 auto;
}
.company-page-body.layout-revista .revista-gallery-top .card {
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.company-page-body.layout-revista .revista-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  padding: 28px 5% 60px;
  max-width: 1200px;
  margin: 0 auto;
}
.company-page-body.layout-revista .company-mobile-stack { display: none; }

/* ══════════════════════════════════════════════════════════════
   MÓVIL — todos los layouts
══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* DOS COLUMNAS en móvil → stack */
  .company-page-body.layout-two-col {
    display: block;
    padding: 16px 4% 40px;
    max-width: 100%;
  }
  .company-page-body.layout-two-col .company-main,
  .company-page-body.layout-two-col .company-sidebar  { display: none !important; }
  .company-page-body.layout-two-col .company-mobile-stack { display: block !important; }

  /* FICHA LATERAL en móvil → stack con acordeón */
  .company-page-body.layout-ficha-lateral {
    display: block;
    padding: 16px 4% 40px;
    max-width: 100%;
  }
  .company-page-body.layout-ficha-lateral .company-main,
  .company-page-body.layout-ficha-lateral .company-sidebar { display: none !important; }
  .company-page-body.layout-ficha-lateral .company-mobile-stack { display: block !important; }

  /* REVISTA en móvil */
  .company-page-body.layout-revista .revista-body  { display: none !important; }
  .company-page-body.layout-revista .company-mobile-stack {
    display: block !important;
    padding: 16px 4% 40px;
  }
  .company-page-body.layout-revista .revista-gallery-top .card {
    border-radius: var(--radius);
    margin: 12px 0;
    padding: 16px;
    box-shadow: var(--shadow);
  }
}

/* ── Mobile page body — 1 columna limpia ── */
.company-page-mobile {
  padding: 16px 16px 56px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* Cards en móvil: padding cómodo, sombra suave, sin margin-bottom (usa gap del flex) */
.company-page-mobile .card {
  padding: 20px 18px;
  margin-bottom: 0 !important;
  border-radius: var(--radius);
  box-shadow: 0 1px 8px rgba(0,0,0,0.07);
}
.company-page-mobile .info-block-title {
  font-size: 15px;
  margin-bottom: 14px;
  padding-bottom: 10px;
}

/* ── Ficha lateral — drawer móvil ── */
.ficha-drawer-btn {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1090;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 14px 0 0 14px;
  padding: 18px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: -3px 0 20px rgba(0,0,0,0.22);
  transition: background .2s;
  min-width: 58px;
}
.ficha-drawer-btn:hover,
.ficha-drawer-btn.active { background: var(--accent); }
.ficha-drawer-btn-icon { font-size: 26px; }
.ficha-drawer-btn-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.ficha-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1100;
  backdrop-filter: blur(2px);
}
.ficha-drawer-overlay.open { display: block; }

.ficha-drawer-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(85vw, 320px);
  background: white;
  z-index: 1110;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 32px rgba(0,0,0,.2);
}
.ficha-drawer-panel.open { transform: translateX(0); }

.ficha-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  background: var(--light);
}
.ficha-drawer-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--gray);
  line-height: 1;
  padding: 4px;
}
.ficha-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}
/* Cards dentro del drawer sin sombra extra */
.ficha-drawer-body .card {
  box-shadow: none;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.services-tags { display:flex; flex-wrap:wrap; gap:8px; }
.service-tag { background:var(--light); border:1px solid var(--border); padding:7px 14px; border-radius:20px; font-size:13px; font-weight:500; }
.company-sidebar .card { padding:24px; margin-bottom:16px; }
.contact-icon svg { display:block; }

/* ── Redes sociales ── */
.rrss-links     { display:flex; flex-direction:column; gap:8px; }
.rrss-btn       { display:flex; align-items:center; gap:10px; padding:10px 14px; border-radius:var(--radius-sm); font-size:13px; font-weight:600; text-decoration:none; transition:filter .15s, transform .1s; }
.rrss-btn:hover { filter:brightness(.93); transform:translateX(2px); }
.rrss-icon      { width:20px; height:20px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.rrss-icon svg  { display:block; }
.rrss-label     { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:200px; }
.rrss-web       { background:#f3e5f5; color:#7b1fa2; }
.rrss-facebook  { background:#e7f3ff; color:#1877f2; }
.rrss-instagram { background:#fce4ec; color:#c2185b; }
.rrss-twitter   { background:#f5f5f5; color:#000000; }
.rrss-linkedin  { background:#e8f0fb; color:#0a66c2; }
.rrss-youtube   { background:#fff0f0; color:#ff0000; }
.rrss-tiktok    { background:#f0f0f0; color:#000000; }
.contact-icon svg { display:block; }
.contact-row { display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid var(--border); font-size:14px; }
.contact-row:last-child { border-bottom:none; }
.contact-icon { width:36px; height:36px; border-radius:8px; background:var(--light); display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.photos-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:12px; }
.photo-thumb { width:100%; aspect-ratio:1; border-radius:var(--radius-sm); object-fit:cover; }
.map-placeholder { width:100%; height:180px; background:linear-gradient(135deg,#e3f0ff,#f3e5f5); border-radius:var(--radius-sm); display:flex; align-items:center; justify-content:center; font-size:13px; color:var(--gray); text-align:center; padding:16px; }
.review-card { background:var(--light); border-radius:var(--radius-sm); padding:16px; margin-bottom:12px; }
.review-top  { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.review-author { font-weight:600; font-size:14px; }
.review-text   { font-size:13px; color:var(--gray); line-height:1.6; }
.stars-input   { display:flex; gap:4px; margin-bottom:16px; }
.star-btn { font-size:24px; background:none; border:none; cursor:pointer; color:#ddd; }
.star-btn.active { color:#ffc107; }
.stars { color:#ffc107; }

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ---- Responsive ---- */

/* ── Filtros móvil: FAB + drawer ── */
/* FAB de filtros: solo visible en móvil, inline junto al contador */
#filters-fab { display:none; }
#filters-overlay {
  display:none;
  position:fixed; inset:0; background:rgba(0,0,0,.45);
  z-index:199; backdrop-filter:blur(2px);
}
#filters-overlay.active { display:block; }
.filters-apply-btn { display:none; } /* oculto en desktop */


/* ── Hamburguesa dashboard (oculta en desktop) ── */
.dash-hamburger-btn  { display:none; }
@media (max-width:768px) {
  /* Navbar responsive */
  #navbar { padding:0 3%; }
  .nav-inner { height:56px; gap:8px; }
  .logo { font-size:16px; line-height:1.2; max-width:100px; }
  .nav-link { font-size:12px; padding:5px 7px; }
  .nav-right { gap:5px; }
  .avatar { width:30px; height:30px; font-size:12px; }
  /* Ocultar links de directorio y +comercio en móvil (van en el dropdown) */
  .nav-link-desktop { display:none; }
  /* Mostrar items de móvil en el dropdown */
  .nav-dropdown-item-mobile { display:flex; }
  .nav-dropdown-item-desktop { display:none; }
  /* En móvil el dropdown ya es fixed, ajustar top al navbar reducido */
  .nav-dropdown { top:56px; right:8px; width:calc(100vw - 16px); max-width:280px; }

  /* Botones de la cabecera de empresa en móvil */
  .company-header-inner { flex-wrap:wrap; gap:8px; padding:12px; }
  .company-header-actions { width:100%; display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-start; }
  .company-header-actions .btn { font-size:12px; padding:6px 10px; }

  /* Header fijo → relativo en móvil (no hay espacio para fijo) */
  .company-header-fixed { position:relative; top:0; }
  .company-content-area { padding-top:0 !important; }

  /* Móvil: sidebar dashboard como drawer desde la derecha */
  .sidebar,
  body.in-dashboard .sidebar {
    display: block !important;
    position: fixed;
    top: 0; bottom: 0; right: 0; left: auto;
    width: min(80vw, 280px);
    z-index: 150;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    pointer-events: none;
  }
  .sidebar.dash-open {
    transform: translateX(0);
    pointer-events: auto;
    box-shadow: -4px 0 32px rgba(0,0,0,.3);
  }
  /* Sin margen izquierdo — sidebar no ocupa espacio en móvil */
  .dashboard-layout,
  body.in-dashboard .dashboard-layout { margin-left: 0 !important; }
  body.in-dashboard #site-footer { padding-left: 0 !important; }
  .dash-content { padding: 20px 16px; }
  /* Admin panel responsive */
  .admin-card          { padding: 16px; }
  .admin-tab-btn       { padding: 10px 16px; font-size: 13px; }
  .admin-card-header   { flex-direction: column; align-items: flex-start; gap: 10px; }
  .admin-btn-new       { width: 100%; }
  .admin-form-grid     { grid-template-columns: 1fr; }
  .admin-search-wrap .input { max-width: 100%; }
  .admin-item-actions  { justify-content: flex-start; }
  #dash-admin .grid-2  { grid-template-columns: 1fr; }



  .grid-2, .grid-3 { grid-template-columns:1fr; }
  /* Hero compacto en móvil */
  .hero    { padding:28px 5% 36px; }
  .hero h1 { font-size:22px; margin-bottom:8px; }
  .hero p  { font-size:14px; margin-bottom:20px; }
  .hero .hero-biz { margin-top:20px; gap:10px; }
  .hero .hero-biz .hero-biz-text { font-size:13px; }
  .hero .hero-biz-btn { font-size:14px; padding:9px 18px; }
  .hero::before { background-size:100% auto; opacity:.14; }

  .search-box { flex-direction:row; flex-wrap:wrap; }
  .search-input-wrap { flex-basis:100%; }
  .search-box input  { width:100%; }
  .search-box .btn { flex:1; }
  /* Ocultar título "Explora por categoría" en móvil */
  .cats-section-header .section-title,
  .cats-section-header .section-sub { display:none; }
  /* Stats: todo visible en móvil sin scroll horizontal */
  .stats-bar    { padding:10px 0; gap:0; overflow:hidden; flex-wrap:nowrap; justify-content:center; }
  .stat-item    { flex:1; padding:0 4px; gap:5px; justify-content:center; min-width:0; }
  .stat-icon    { font-size:16px; flex-shrink:0; }
  .stat-num     { font-size:15px; }
  .stat-label   { font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .stat-divider { height:24px; flex-shrink:0; }

  /* Botón toggle categorías: visible en móvil */
  .cats-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Ocultar grid de categorías en móvil (va dentro del drawer) */
  .cats-section-header { margin-bottom: 0; }

  /* Drawer lateral izquierdo de categorías */
  .cats-drawer {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(80vw, 300px);
    z-index: 200;
    background: white;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    padding: 0;
    box-shadow: none;
    -webkit-overflow-scrolling: touch;
  }
  .cats-drawer.cats-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.2);
  }
  .cats-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
  }
  /* En móvil las cat-cards en el drawer van en columna */
  .cats-drawer .categories-grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 8px 0;
  }
  .cats-drawer .cat-card {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
  }
  .cats-drawer .cat-icon { font-size: 22px; }
  .cats-drawer .cat-name { font-size: 15px; font-weight: 600; }
  .cats-drawer .cat-count { font-size: 12px; color: var(--gray); margin-top: 0; margin-left: auto; }
  .dash-stats { grid-template-columns:1fr 1fr; }

  /* Filas de empresa: de horizontal a vertical en móvil */
  /* Selector de estilos en móvil */
  .templates-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .template-preview { height: 60px; }
  .template-name  { padding: 6px; font-size: 12px; }
  .layouts-grid   { grid-template-columns: 1fr 1fr; gap: 10px; }
  .layout-preview { height: 70px; }
  .layout-name    { font-size: 12px; padding: 6px 8px 2px; }
  .layout-desc    { font-size: 11px; padding: 0 8px 2px; }
  .layout-mobile-note { font-size: 10px; padding: 0 8px 6px; }

  .my-company-row {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
  }
  .my-company-info { flex-basis: calc(100% - 52px - 12px); }
  .my-company-actions {
    flex-basis: 100%;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
  }

  /* Directorio: una sola columna, los filtros se ocultan */
  .directory-layout {
    grid-template-columns: 1fr;
    padding: 16px 4%;
    gap: 0;
  }

  /* Panel filtros: drawer desde la izquierda */
  .filters-panel {
    position: fixed;
    top: 0; left: 0;
    width: min(85vw, 320px);
    height: 100%;
    z-index: 200;
    border-radius: 0 16px 16px 0;
    overflow: visible;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    padding: 0;
    display: block;
  }
  .filters-panel.filters-open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,.18);
  }

  /* Zona scrollable: toda la altura menos el botón fijo (57px) */
  .filters-scroll-body {
    position: absolute;
    top: 0; left: 0; right: 0;
    bottom: 57px;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    padding: 24px 24px 16px;
    background: white;
    border-radius: 0 16px 0 0;
  }

  /* Botón "Ver resultados" — fijo al fondo del drawer */
  .filters-apply-btn {
    display: block;
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 57px;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    padding: 16px;
    line-height: 1;
  }
  .filters-apply-btn:active { filter: brightness(.9); }

  /* Botón cerrar visible solo en móvil */
  #filters-close-btn { display:block !important; }

  /* FAB de filtros: inline en móvil, junto al contador de resultados */
  #filters-fab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s;
  }
  #filters-fab:active { opacity: .85; }

  /* Badge de filtros activos */
  #filters-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 800;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    padding: 0 4px;
  }
  #filters-badge:empty { display:none; }
}

/* ---- Lightbox ---- */
#lb-overlay { animation: fadeInLb .15s ease; }
@keyframes fadeInLb { from { opacity:0; } to { opacity:1; } }
#lb-overlay button:hover { background: rgba(255,255,255,.25) !important; }
[data-lightbox-src]:hover img { opacity:.85; }
[data-lightbox-src] { transition:.15s; }

/* ============================================================
   Admin panel — estilos responsive
   ============================================================ */

/* Cabecera */
.admin-panel-header { margin-bottom: 20px; }

/* Tabs */
.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}
.admin-tab-btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  color: var(--gray);
  transition: all .2s;
  white-space: nowrap;
}
.admin-tab-btn.admin-tab-active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

/* Card contenedor */
.admin-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* Cabecera de cada card */
.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.admin-card-title { font-size: 17px; font-weight: 700; }
.admin-card-sub   { font-size: 13px; color: var(--gray); margin-top: 4px; }
.admin-btn-new    { white-space: nowrap; flex-shrink: 0; }
.admin-count-badge {
  background: var(--light);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
  white-space: nowrap;
}

/* Buscador de empresas */
.admin-search-wrap { margin-bottom: 16px; }
.admin-search-wrap .input { width: 100%; max-width: 420px; }

/* Formularios de categoría */
.admin-form {
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 20px;
}
.admin-form-new  { background: var(--light); border-left: 4px solid var(--accent); }
.admin-form-edit { background: #fff8e1;       border-left: 4px solid #f59e0b; }
.admin-form-title   { font-weight: 700; margin-bottom: 14px; font-size: 15px; }
.admin-form-grid    { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.admin-form-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Items lista (categorías y empresas) */
.admin-item-card {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-item-card:last-child { border-bottom: none; }
.admin-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-item-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}


/* Icono de contacto: SVGs en lugar de emoji */
.contact-icon svg { display:block; }
/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  background: var(--primary);
  color: rgba(255,255,255,.8);
  position: relative;
  z-index: 30;
}
/* En el panel de control el footer debe quedar a la derecha del sidebar */
body.in-dashboard #site-footer {
  padding-left: 240px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 5% 32px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
}
.footer-brand { }
.footer-logo {
  font-size: 20px;
  font-weight: 800;
  color: white;
  cursor: pointer;
  margin-bottom: 10px;
  display: inline-block;
}
.footer-logo span { color: var(--accent); }
.footer-tagline { font-size: 13px; color: rgba(255,255,255,.45); line-height: 1.5; }
.footer-links { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.35);
  margin-bottom: 4px;
}
.footer-link {
  font-size: 13.5px;
  color: rgba(255,255,255,.65);
  cursor: pointer;
  text-decoration: none;
  transition: color .15s;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}
.footer-link:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 16px 5%;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,.3);
}

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: 28px; padding: 36px 5% 24px; }
  .footer-links { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-links { grid-template-columns: 1fr; }
}


/* Tarjetas de comercio como enlaces reales (abrir en pestaña nueva) */
a.company-card, a.featured-card, a.mv-item, a.cat-card {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
a.company-card, a.featured-card, a.cat-card { display: block; }
a.company-card:focus-visible, a.featured-card:focus-visible, a.mv-item:focus-visible {
  outline: 2px solid #0e8794;
  outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════════════
   FICHA: migas de pan y comercios relacionados (versión JS)
══════════════════════════════════════════════════════════════ */
.company-extra { max-width:1200px; margin:0 auto; padding-left:5%; padding-right:5%; box-sizing:border-box; }
.company-crumbs { padding-top:6px; padding-bottom:4px; }
.company-crumbs ol {
  list-style:none; margin:0; padding:0; display:flex; align-items:center; gap:6px;
  overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch;
}
.company-crumbs ol::-webkit-scrollbar { display:none; }
.company-crumbs li { display:flex; align-items:center; gap:6px; flex:0 0 auto; min-width:0; }
.company-crumbs li + li::before { content:"›"; color:#94a3b8; font-size:18px; line-height:1; font-weight:700; }
.company-crumbs a, .company-crumbs [aria-current] {
  display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:999px;
  font-size:13px; font-weight:600; line-height:1.2; white-space:nowrap; text-decoration:none;
  -webkit-tap-highlight-color:transparent;
}
.company-crumbs a {
  background:#ffffff; color:#14204a; border:1px solid #e2e8f0; box-shadow:0 1px 3px rgba(0,0,0,.08);
  transition:background .15s, border-color .15s;
}
.company-crumbs a:visited { color:#14204a; }
.company-crumbs a:hover, .company-crumbs a:focus-visible { background:#f1f5f9; border-color:#cbd5e1; }
.company-crumbs [aria-current] {
  background:#14204a; color:#ffffff; border:1px solid #14204a;
  max-width:60vw; overflow:hidden; text-overflow:ellipsis; display:inline-block;
}
@media (max-width:600px) {
  .company-crumbs a, .company-crumbs [aria-current] { font-size:12px; padding:5px 10px; }
  .company-crumbs [aria-current] { max-width:45vw; }
}
#company-related { padding-bottom:48px; }
#company-related:empty { display:none; }
.company-related-title { font-size:20px; font-weight:800; color:#14204a; margin:8px 0 16px; }
.related-block + .related-block { margin-top:36px; }
#company-related .mvm-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:12px; }
#company-related .mvm-head .company-related-title { margin:8px 0 0; font-size:18px; }

/* ══════════════════════════════════════════════════════════════
   FICHA PINTADA EN EL SERVIDOR (SEO). Se ve un instante al cargar
   la URL directamente, hasta que el JS monta la versión interactiva.
══════════════════════════════════════════════════════════════ */
.ssr-company { background:var(--light, #eef6fb); min-height:calc(100vh - 64px); padding-bottom:48px; }
.ssr-wrap { max-width:860px; margin:0 auto; padding:0 5%; box-sizing:content-box; }
.ssr-hero { color:#fff; padding:28px 0; }
.ssr-hero-inner { display:flex; align-items:center; gap:18px; }
.ssr-logo { width:72px; height:72px; flex-shrink:0; border-radius:14px; background:#fff; overflow:hidden;
            display:flex; align-items:center; justify-content:center; font-size:28px; font-weight:800; color:#14204a; }
.ssr-logo img { width:100%; height:100%; object-fit:cover; }
.ssr-hero h1 { font-size:26px; font-weight:800; margin:0 0 6px; line-height:1.2; }
.ssr-hero p { margin:0; opacity:.85; font-size:14px; }
.ssr-crumbs { display:flex; flex-wrap:wrap; gap:6px; font-size:13px; color:var(--gray); padding:16px 0; }
.ssr-crumbs a { color:var(--gray); text-decoration:none; }
.ssr-crumbs [aria-current] { color:#14204a; font-weight:600; }
.ssr-card { background:#fff; border-radius:var(--radius, 12px); box-shadow:var(--shadow, 0 2px 10px rgba(0,0,0,.06));
            padding:24px; margin-bottom:16px; }
.ssr-card h2 { font-size:17px; font-weight:700; color:#14204a; margin:0 0 12px; }
.ssr-lead { font-size:15px; line-height:1.6; color:#1f2937; margin:0 0 12px; }
.ssr-about { font-size:15px; line-height:1.8; color:#4a5260; }
.ssr-about p { margin:0 0 14px; }
.ssr-about h3 { font-size:16px; color:#14204a; margin:18px 0 8px; }
.ssr-about ul { padding-left:20px; margin:0 0 14px; }
.ssr-tags { list-style:none; padding:0; margin:0; display:flex; flex-wrap:wrap; gap:8px; }
.ssr-tags li { border:1px solid var(--border, #e5e7eb); border-radius:999px; padding:6px 14px; font-size:13px; font-weight:600; }
.ssr-dl { display:grid; grid-template-columns:110px 1fr; gap:8px 12px; margin:0; font-size:14px; }
.ssr-dl dt { color:var(--gray); }
.ssr-dl dd { margin:0; color:#1f2937; word-break:break-word; }
.ssr-dl a { color:#0e8794; }
.ssr-hours { border-collapse:collapse; font-size:14px; }
.ssr-hours th { text-align:left; font-weight:600; padding:4px 24px 4px 0; color:#1f2937; }
.ssr-hours td { padding:4px 0; color:#4a5260; }
.ssr-related { list-style:none; padding:0; margin:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:8px 16px; }
.ssr-related a { color:#14204a; font-weight:600; text-decoration:none; }
.ssr-related a:hover { text-decoration:underline; }
.ssr-related span { color:var(--gray); font-size:13px; }
@media (max-width:600px) {
  .ssr-hero h1 { font-size:21px; }
  .ssr-logo { width:56px; height:56px; }
  .ssr-dl { grid-template-columns:1fr; gap:2px; }
  .ssr-dl dd { margin-bottom:10px; }
}

/* Lightbox: ocultar la barra de la tira de fotos (WebKit) */
.lb-track::-webkit-scrollbar { display:none; }

/* Número de comercios junto a cada categoría en los filtros */
.filter-count { color:var(--gray); font-size:12px; font-weight:400; }
.filter-empty { font-size:12px; color:var(--gray); padding:4px 0 8px; }

/* Botón de Google en los formularios de acceso y registro */
.google-btn { display:flex; justify-content:center; min-height:44px; margin:4px 0 0; }
.auth-sep { display:flex; align-items:center; gap:12px; margin:16px 0; color:var(--gray); font-size:13px; }
.auth-sep::before, .auth-sep::after { content:""; flex:1; height:1px; background:var(--border); }

/* ── Filtros en móvil: panel desde la izquierda y pestaña siempre visible en el borde izquierdo ── */
@media (max-width: 768px) {
  .filters-panel {
    left: 0; right: auto;
    transform: translateX(-100%);
    border-radius: 0 16px 16px 0;
  }
  .filters-panel.filters-open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,.18);
  }
  .filters-scroll-body { border-radius: 0 16px 0 0; }

  /* Pestaña fija en el borde izquierdo, a media altura: estrecha y alargada */
  #filters-fab {
    position: fixed;
    left: 0; right: auto; top: 50%;
    transform: translateY(-50%) rotate(180deg);   /* el texto se lee de abajo arriba */
    z-index: 150;
    writing-mode: vertical-rl;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 34px;
    padding: 22px 0;
    border-radius: 12px 0 0 12px;                 /* con el giro, queda redondeado hacia la derecha */
    background: linear-gradient(180deg, #1f3266 0%, #14204a 100%);
    color: #fff;
    border: 2px solid var(--accent);
    border-right: none;                           /* (es el lado pegado al borde tras el giro) */
    box-shadow: -4px 0 18px rgba(14,135,148,.35), -2px 2px 10px rgba(0,0,0,.25);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: opacity .2s, width .15s;
  }
  #filters-fab svg { transform: rotate(180deg); flex-shrink: 0; color: var(--accent); }
  #filters-fab .ff-label { white-space: nowrap; }
  #filters-fab #filters-badge { writing-mode: horizontal-tb; transform: rotate(180deg); }
  #filters-fab:active { width: 38px; }

  /* Botón pequeño junto al número de resultados */
  #filters-inline-btn {
    display: inline-flex; align-items: center; gap: 6px;
    margin-left: auto;
    padding: 6px 12px;
    background: #fff;
    color: #14204a;
    border: 1.5px solid var(--accent);
    border-radius: 999px;
    font-size: 13px; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
  }
  #filters-inline-btn svg { color: var(--accent); }
  #filters-inline-btn:active { background: #e0f2f4; }
  #filters-badge-inline {
    display: none; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
    background: var(--accent); color: #fff; font-size: 11px; font-weight: 800;
  }
  body.filters-is-open #filters-fab { opacity: 0; pointer-events: none; }
  /* Con el panel abierto, el botón del chatbot se oculta para que pulsar fuera solo cierre el panel */
  body.filters-is-open #chat-fab, body.filters-is-open .chat-fab { visibility: hidden; }
}

/* El botón junto a los resultados solo existe en móvil */
#filters-inline-btn { display:none; }
@media (max-width: 768px) { #filters-inline-btn { display:inline-flex; } }
/* ── Directorio: ordenar y paginación ───────────────────────── */
.dir-sort { margin-left:auto; display:flex; align-items:center; gap:8px; font-size:14px; color:var(--gray); }
.dir-sort select { padding:8px 32px 8px 12px; border:1.5px solid var(--border); border-radius:10px; background:var(--white);
  color:var(--primary); font:inherit; font-weight:600; cursor:pointer; }
.dir-sort select:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(14,135,148,.18); }
.dir-pagination { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; margin-top:32px; }
.dir-pagination:empty { display:none; }
.dir-page { min-width:40px; height:40px; padding:0 12px; border:1.5px solid var(--border); border-radius:10px; background:var(--white);
  color:var(--primary); font:inherit; font-weight:600; cursor:pointer; transition:border-color .15s, background .15s, color .15s; }
.dir-page:hover { border-color:var(--accent); color:var(--accent); }
.dir-page.active { background:var(--accent); border-color:var(--accent); color:#fff; cursor:default; }
.dir-page-gap { padding:0 4px; color:var(--gray); }
@media (max-width: 768px) {
  .dir-sort span { display:none; }
  .dir-sort select { padding:7px 28px 7px 10px; font-size:13px; }
  .dir-page { min-width:36px; height:36px; padding:0 10px; font-size:14px; }
}

/* ── Instalar como app (solo con sesión) ─────────────────────── */
.pwa-banner { position:relative; margin-top:28px; padding:22px 20px 20px; border-radius:var(--radius);
  background:linear-gradient(135deg, var(--primary), var(--accent2)); color:#fff; box-shadow:var(--shadow); text-align:center; }
.pwa-banner-head { display:flex; align-items:center; gap:14px; text-align:left; padding-right:28px; max-width:520px; margin:0 auto; }
.pwa-banner-head img { border-radius:14px; flex-shrink:0; box-shadow:0 4px 12px rgba(0,0,0,.18); }
.pwa-banner-text { display:flex; flex-direction:column; gap:3px; font-size:16px; }
.pwa-banner-text span { opacity:.85; font-size:14px; line-height:1.4; }
.pwa-banner-close { position:absolute; top:10px; right:10px; width:32px; height:32px; display:flex; align-items:center; justify-content:center;
  border:0; border-radius:50%; background:rgba(255,255,255,.12); color:#fff; font-size:15px; cursor:pointer; transition:background .15s; }
.pwa-banner-close:hover { background:rgba(255,255,255,.25); }
.pwa-banner-btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; margin-top:18px; padding:12px 30px; min-width:200px;
  border:0; border-radius:999px; background:#fff; color:var(--primary); font:inherit; font-size:15px; font-weight:700; cursor:pointer;
  box-shadow:0 6px 16px rgba(0,0,0,.18); transition:transform .15s, box-shadow .15s; }
.pwa-banner-btn svg { color:var(--accent); }
.pwa-banner-btn:hover { transform:translateY(-1px); box-shadow:0 8px 22px rgba(0,0,0,.24); }
.pwa-banner-btn:active { transform:translateY(0); }
.pwa-ios-overlay { position:fixed; inset:0; z-index:2000; background:rgba(20,32,74,.55); display:flex; align-items:flex-end; justify-content:center; padding:16px; }
.pwa-ios-box { background:#fff; border-radius:20px; padding:24px; max-width:420px; width:100%; text-align:center; box-shadow:var(--shadow-lg); }
.pwa-ios-box img { border-radius:14px; }
.pwa-ios-box h3 { margin:12px 0 8px; color:var(--primary); }
.pwa-ios-box ol { text-align:left; margin:0 0 18px; padding-left:22px; line-height:1.7; color:var(--primary); }
.pwa-ios-box .btn { width:100%; }
