.pyme-grid, #pymeGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

/* Modal IDs (nuevo marcado) */
#pymeModalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}
#pymeModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  max-width: 640px;
  width: calc(100% - 32px);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  border: 1px solid #e5e7eb;
  z-index: 1000;
}
.is-hidden { display: none !important; }
/*
  Mepyme — CSS base
  - Estilos limpios y modernos, sin librerías externas
  - Grid responsive para tarjetas de pymes
  - Header, hero y footer
  - Botones
  - Modal
  - Comentarios por secciones
*/

/* ==========================
   Variables y Reset básico
   ========================== */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb; /* azul moderno */
  --primary-hover: #1e40af;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  --container: 1100px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Enlace para saltar al contenido (accesibilidad) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
}

/* Contenedor general */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ==========================
   Header
   ========================== */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}
.logo {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.2px;
}
.nav__list {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}
.nav__item a {
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}
.nav__item a:hover, .nav__item a:focus-visible {
  background: #f1f5f9;
  outline: none;
}

/* ==========================
   Hero
   ========================== */
.hero {
  padding: 3rem 0 2rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--border);
}
.hero__inner {
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.2;
  margin: 0 0 0.75rem;
}
.hero p {
  max-width: 60ch;
  margin: 0 auto;
  color: var(--muted);
}
.btn {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.btn:hover, .btn:focus-visible { background: var(--primary-hover); outline: none; }

/* ==========================
   Sección Pymes / Grid
   ========================== */
.pymes { padding: 2rem 0; }
.section__header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.section__header h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}
.section__header p { color: var(--muted); }

/* Grid responsive (CSS Grid) */
.pyme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

/* ==========================
   Tarjetas de Pyme
   ========================== */
.pyme-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pyme-card__logo {
  width: 100%;
  height: auto;
  object-fit: cover;
  background: #f3f4f6;
}
.pyme-card__media { aspect-ratio: 16 / 9; background: #f3f4f6; }
.pyme-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pyme-card__content {
  padding: 1rem;
}
.pyme-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}
.pyme-card__desc { color: var(--muted); margin: 0 0 0.75rem; }
.pyme-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* Buttons for cards */
.btn {
  display: inline-block;
  text-align: center;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--primary-hover); outline: none; }
.btn-secondary { background: #eef2ff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover, .btn-secondary:focus-visible { background: #e0e7ff; outline: none; }

@media (max-width: 420px) {
  .pyme-card__actions { grid-template-columns: 1fr; }
}

/* ==========================
   Footer
   ========================== */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.footer__inner {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  padding: 1.25rem 0;
}
.footer__legal {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 0.75rem 0;
  color: var(--muted);
}
.social__list { list-style: none; display: flex; gap: 0.75rem; padding: 0; margin: 0; }

/* ==========================
   Modal
   ========================== */
.modal-open { overflow: hidden; }
.modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.modal__dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  width: min(90vw, 640px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.modal__header, .modal__footer { padding: 1rem; }
.modal__body { padding: 0 1rem 1rem; }
.modal__header h2 { margin: 0; font-size: 1.25rem; }
.modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: #eef2ff;
  color: #1f2937;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}
.modal__close:hover, .modal__close:focus-visible { background: #e0e7ff; outline: none; }
.modal__contacts { display: flex; gap: 0.75rem; }
.modal__contacts a { color: var(--primary); }

/* ==========================
   Estados de foco accesibles
   ========================== */
:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

/* ==========================
   Breakpoints / Responsive
   ========================== */
@media (min-width: 768px) {
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .header__inner { padding: 1rem 0; }
}
@media (min-width: 1024px) {
  .hero { padding: 4rem 0 3rem; }
}
