@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* =========================
   DESIGN TOKENS
   -------------------------
   El framework expone su paleta, radios, sombras y medidas como
   custom properties. Todos los valores por defecto son los originales,
   asi que el look por defecto NO cambia: sigue siendo el tema claro.

   Para tematizar (p. ej. dark mode) basta con redefinir estos tokens
   en una hoja cargada despues. No hace falta tocar ninguna regla.
========================= */

:root {
  /* --- Medidas y ritmo --- */
  --container-max: 1100px;
  --container-pad: 20px;
  --row-pad-y: 40px;

  /* --- Superficies y texto (tema claro) --- */
  --color-bg: #fcfcfc;
  --color-surface: #ffffff;
  --color-surface-2: #f4f6f8;
  --color-text: #333333;
  --color-text-muted: #616161;
  --color-border: #e0e0e0;
  --color-header-bg: #ffffff;

  /* --- Color de marca del framework --- */
  --color-primary: #1976d2;
  --color-primary-dark: #1565c0;
  --color-on-primary: #ffffff;  /* texto sobre el color primario */

  /* --- Superficies oscuras fijas (drawer y footer) --- */
  --color-drawer-bg: #1a237e;
  --color-drawer-link: #ffffff;
  --color-drawer-link-hover: #90caf9;
  --color-footer-bg: #212121;
  --color-footer-bg-2: #141414;
  --color-footer-text: #ffffff;
  --color-footer-link: #bdbdbd;
  --color-footer-muted: #9e9e9e;

  /* --- Formas y sombras --- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-header: 0 2px 10px rgba(0, 0, 0, 0.08);
  --shadow-drawer: -4px 0 15px rgba(0, 0, 0, 0.2);
  --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.03);
  --overlay: rgba(0, 0, 0, 0.5);

  /* --- Tipografia --- */
  --font-base: 'Roboto', sans-serif;

  /* --- Anillo de foco (accesibilidad) --- */
  --focus-ring: 0 0 0 3px rgba(25, 118, 210, 0.45);
}

/* =========================
   STRUCTURE & RESETS
========================= */

* {
  box-sizing: border-box;
}

/* Los medios nunca desbordan su contenedor */
img {
  max-width: 100%;
  height: auto;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  font-family: var(--font-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

.row {
  width: 100%;
  padding: var(--row-pad-y) 0px;
}

.desktopContainer {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.fullContainer {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.debug {
  outline: 1px solid red;
  outline-offset: -1px;
}

.nested-box {
  background: #e8f5e9;
  min-height: 250px;
}

.bg {
  background: rgba(0, 0, 0, 0.05);
  z-index: -1;
}

/* =========================
   HEADER & NAVIGATION
========================= */

.site-header {
  width: 100%;
  background-color: var(--color-header-bg);
  box-shadow: var(--shadow-header);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-square {
  width: 45px;
  height: 45px;
  object-fit: contain;
  display: block;
}

.desktop-menu {
  display: flex;
  gap: 25px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.desktop-menu a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s ease;
}

.desktop-menu a:hover {
  color: var(--color-primary);
}

/* Mobile Nav Trigger & Drawer */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.mobile-menu-btn img {
  width: 30px;
  height: 30px;
  display: block;
}

.mobile-menu-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px; /* Wider panel */
  max-width: 85vw; /* Prevents overflow on very small devices */
  height: 100vh;
  background-color: var(--color-drawer-bg);
  box-shadow: var(--shadow-drawer);
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  padding: 25px;
}

/* Add: Centered social icons container inside mobile drawer */
.mobile-social-icons {
  margin-top: auto; /* Pushes the icons to the bottom of the drawer */
  display: flex;
  justify-content: center;
  gap: 20px;
  padding-top: 20px;
}

.mobile-menu-drawer.active {
  right: 0;
}

.mobile-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.mobile-close-btn {
  background: none;
  border: none;
  color: var(--color-drawer-link);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.mobile-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-links a {
  color: var(--color-drawer-link);
  text-decoration: none;
  font-size: 18px;
  font-weight: 400;
  display: block;
  transition: transform 0.2s ease, color 0.2s ease;
}

.mobile-links a:hover {
  transform: translateX(6px);
  color: var(--color-drawer-link-hover);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 1999;
}

.nav-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   GRID SYSTEM
========================= */

.grid { display: grid; gap: 20px; }
.grid0gap { display: grid; gap: 0px; }
.gap-10 { gap: 10px; }
.gap-30 { gap: 30px; }

.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-5 { grid-template-columns: repeat(5, 1fr); }
.cols-6 { grid-template-columns: repeat(6, 1fr); }

/* Asymmetric Columns */
.cols-300-auto { grid-template-columns: 300px 1fr; }
.cols-auto-250 { grid-template-columns: 1fr 250px; }
.cols-1-2 { grid-template-columns: 1fr 2fr; }
.cols-2-1 { grid-template-columns: 2fr 1fr; }

/* =========================
   9 POINT ALIGNMENT
========================= */

.layer {
  display: grid;
  position: relative;
}

.layer > * { 
  grid-area: 1 / 1; 
}

.tl { place-self: start start; }
.tc { place-self: start center; }
.tr { place-self: start end; }

.cl { place-self: center start; }
.cc { place-self: center; }
.cr { place-self: center end; }

.bl { place-self: end start; }
.bc { place-self: end center; }
.br { place-self: end end; }

/* =========================
   CARDS & BUTTONS
========================= */

.card {
  background: var(--color-surface);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.card button,
.card .btn {
  margin-top: auto;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: center;
  transition: background-color 0.2s;

  /* Los <button> NO heredan la tipografia del documento, a diferencia de los
     <a>: sin esto, un <button class="btn"> sale en la fuente y el tamano del
     navegador (Arial ~13px) mientras que un <a class="btn"> sale con los del
     sitio, y se ven distintos sin motivo. Declararlo aca hace que .btn se vea
     igual en los dos casos. A los <a> no les cambia nada, porque ya heredaban. */
  font-family: inherit;
  font-size: inherit;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

/* =========================
   FOOTER
========================= */

.site-footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-text);
  width: 100%;
}

.footer-top {
  padding: 50px 0 40px 0;
}

.site-footer a {
  color: var(--color-footer-link);
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: var(--color-footer-text);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-icons {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.social-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.social-icon:hover {
  transform: translateY(-3px);
}

.social-icon img {
  width: 100%;
  height: 100%;
}

.footer-bottom {
  background-color: var(--color-footer-bg-2);
  padding: 20px 0;
  font-size: 13px;
  color: var(--color-footer-muted);
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.legal-links {
  display: flex;
  gap: 20px;
}

/* =========================
   UTILITIES
========================= */

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.aspect-square { aspect-ratio: 1 / 1; }
.aspect-16-9 { aspect-ratio: 16 / 9; }

.hide-mobile { display: block; }
.hide-desktop { display: none; }

/* Demo Styles */
.box {
  background: #e3f2fd;
  padding: 20px;
  border-radius: 4px;
}

.altoUno {
  min-height: 250px;
  background-color: #e0f7fa;
  padding: 20px;
  border-radius: 6px;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {
  .desktopContainer {
    max-width: 100%;
  }

  /* Responsive visibility */
  .hide-mobile { display: none !important; }
  .hide-desktop { display: block !important; }

  /* Navigation */
  .desktop-menu { display: none; }
  .mobile-menu-btn { display: block; }

  /* Grid Fallbacks to 1 column */
  .cols-2, .cols-3, .cols-4, .cols-5, .cols-6, 
  .cols-300-auto, .cols-auto-250, .cols-1-2, .cols-2-1 {
    grid-template-columns: 1fr;
  }

  /* Force multi-column overrides */
  .m-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .m-cols-3 { grid-template-columns: repeat(3, 1fr); }

  /* Order helpers */
  .m-order-first { order: -1; }
  .m-order-last { order: 99; }

  /* Footer adjustments */
  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}

/* =========================
   ACCESSIBILITY
========================= */

/* Foco visible y consistente para navegacion por teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Respeta a quien pidio menos movimiento en su sistema operativo */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}