/* =====================================================
   Tuchweber — Mejoras responsive (mobile + tablet)
   Se carga DESPUÉS de site.css. Solo overrides.
   Breakpoints:
     - Tablet:  ≤ 900px
     - Mobile:  ≤ 640px
     - Mobile S:≤ 380px
   ===================================================== */

/* =========== TABLET (≤900px) — refuerzos ============ */
@media (max-width: 900px) {

  /* Container más ajustado */
  .tw-container { padding: 0 20px; }

  /* NAV — mostrar hamburguesa, ocultar items */
  .tw-nav__inner { gap: 12px; padding: 14px 20px; }
  .tw-nav__brand img { max-height: 28px; }
  .tw-nav__brand-meta { display: none; }
  .tw-nav__items { display: none !important; }
  .tw-nav__cta { padding: 8px 12px !important; font-size: 11px !important; }

  /* Section heads */
  .tw-section { padding: 64px 0; }
  .tw-section__head { padding-bottom: 32px; margin-bottom: 32px; }
  .tw-section__head h2 { font-size: clamp(32px, 7vw, 56px) !important; }
  .tw-section__head .tw-section__index { font-size: 11px; }

  /* HERO */
  .tw-hero { min-height: auto !important; padding: 100px 0 64px !important; }
  .tw-hero__inner { padding: 0 20px !important; }
  .tw-hero__title { font-size: clamp(40px, 9vw, 64px) !important; line-height: 1 !important; margin: 16px 0 20px !important; }
  .tw-hero__claim { font-size: 16px !important; margin-bottom: 24px !important; max-width: 100% !important; }
  .tw-hero__ctas { gap: 10px; }
  .tw-hero__ctas .tw-btn { flex: 1 1 auto; min-width: 140px; justify-content: center; }
  .tw-eyebrow { font-size: 10px !important; }

  /* CTA Band */
  .tw-cta-band { padding: 64px 0; }
  .tw-cta-band__inner { padding: 0 20px !important; gap: 32px !important; }
  .tw-cta-band h2 { font-size: clamp(32px, 7vw, 56px) !important; }
  .tw-cta-band__ctas { align-items: stretch !important; flex-direction: column; }
  .tw-cta-band__ctas .tw-btn { width: 100%; justify-content: center; }
  .tw-cta-band__contact { text-align: left !important; }

  /* FOOTER */
  .tw-footer { padding: 56px 0 24px; }
  .tw-footer__top { padding: 0 20px 40px !important; margin-bottom: 40px !important; gap: 24px !important; }
  .tw-footer__big { font-size: clamp(40px, 9vw, 72px) !important; }
  .tw-footer__social { align-items: flex-start !important; }
  .tw-footer__bottom { padding: 0 20px !important; flex-direction: column; gap: 16px; align-items: flex-start; }
  .tw-footer__bottom-meta { flex-wrap: wrap; gap: 16px !important; font-size: 11px; }

  /* PAGE HEAD */
  .tw-pagehead { padding: 80px 0 48px; }
  .tw-pagehead__title { font-size: clamp(40px, 9vw, 72px) !important; }
  .tw-pagehead__lead { font-size: 15px; margin-top: 16px !important; }

  /* PROJECT SINGLE */
  .tw-project-hero { min-height: 60vh !important; }
  .tw-project-hero__title { font-size: clamp(36px, 8vw, 64px) !important; }
  .tw-project-detail__lead { font-size: 18px !important; }
  .tw-project-detail__ficha { padding: 24px !important; }
  .tw-project-ficha dt { font-size: 10px; }
  .tw-project-ficha dd { font-size: 14px; }

  /* SERVICES grid → ya en 1 col, pero ajustamos paddings */
  .tw-service { padding: 32px 24px; }
  .tw-service__title { font-size: 24px !important; }

  /* METRICS */
  .tw-metrics-inner { gap: 0; }
  .tw-metric { padding: 24px 12px !important; }
  .tw-metric__num { font-size: clamp(36px, 9vw, 56px) !important; }
  .tw-metric__label { font-size: 11px; }

  /* PROJECT GRID */
  .tw-project__title { font-size: 22px !important; }
  .tw-project__meta { font-size: 11px; }

  /* BLOG */
  .tw-blog-list { gap: 32px; }
  .tw-post-card__title { font-size: 22px !important; }

  /* CONTACT */
  .tw-contact { gap: 40px !important; }
  .tw-contact__lead h2 { font-size: clamp(32px, 8vw, 56px) !important; }
  .tw-form__row label { font-size: 13px; }
  .tw-form__input, .tw-form__textarea { font-size: 16px; /* evita zoom en iOS */ }

  /* BIO / Sobre */
  .tw-bio { gap: 32px !important; }
  .tw-bio__copy h2 { font-size: clamp(32px, 8vw, 48px) !important; }
  .tw-bio__copy p { font-size: 15px !important; }
  .tw-bio__cred-grid { grid-template-columns: 1fr 1fr; gap: 16px; }

  /* Servicios single page */
  .tw-svc-detail__title { font-size: clamp(28px, 7vw, 44px) !important; }
  .tw-svc-detail__copy { font-size: 15px !important; }
  .tw-svc-detail__inner { gap: 24px !important; }

  /* Process */
  .tw-process__title { font-size: clamp(28px, 7vw, 40px) !important; }
}

/* =========== MOBILE (≤640px) — agresivo ============ */
@media (max-width: 640px) {

  body { font-size: 15px; }

  /* NAV — solo logo + CTA */
  .tw-nav__inner { padding: 12px 16px; }
  .tw-nav__cta { padding: 7px 10px !important; font-size: 10px !important; letter-spacing: 0.05em !important; }
  .tw-nav__brand img { max-height: 24px; }

  .tw-container { padding: 0 16px; }

  .tw-section { padding: 48px 0; }
  .tw-section__head { padding-bottom: 24px; margin-bottom: 24px; }

  /* HERO mobile */
  .tw-hero { padding: 80px 0 48px !important; min-height: 70vh !important; }
  .tw-hero__inner { padding: 0 16px !important; }
  .tw-hero__title { font-size: clamp(34px, 11vw, 48px) !important; }
  .tw-hero__claim { font-size: 15px !important; }
  .tw-hero__ctas { flex-direction: column; align-items: stretch; }
  .tw-hero__ctas .tw-btn { width: 100%; }

  /* Buttons globales */
  .tw-btn { padding: 12px 18px; font-size: 13px; }

  /* CTA / Section titles */
  .tw-section__head h2,
  .tw-cta-band h2,
  .tw-pagehead__title { font-size: clamp(28px, 9vw, 44px) !important; }

  .tw-footer__big { font-size: clamp(36px, 11vw, 56px) !important; }

  /* PROJECT */
  .tw-project-hero { min-height: 50vh !important; }
  .tw-project-hero__title { font-size: clamp(28px, 9vw, 44px) !important; }
  .tw-project-detail__ficha { padding: 20px !important; }

  /* Galería 1 col en mobile chico */
  .tw-project-gallery { grid-template-columns: 1fr !important; gap: 12px !important; }
  .tw-project-gallery__item,
  .tw-project-gallery__item.is-wide { grid-column: 1 / -1 !important; }

  /* METRICS — 1 col en mobile chico */
  .tw-metrics-inner { grid-template-columns: 1fr 1fr !important; }
  .tw-metric { border-right: 1px solid var(--tw-black-15) !important; border-bottom: 1px solid var(--tw-black-15) !important; padding: 24px 12px !important; }
  .tw-metric:nth-child(2n) { border-right: 0 !important; }
  .tw-metric__num { font-size: 32px !important; }
  .tw-metric__label { font-size: 10px !important; line-height: 1.3 !important; }

  /* VALUES en sobre — 1 col en mobile */
  .tw-values { grid-template-columns: 1fr !important; }
  .tw-value { border-right: 0 !important; border-bottom: 1px solid var(--tw-black-15) !important; }

  /* Process — 1 col */
  .tw-process__list { grid-template-columns: 1fr !important; }

  /* Footer columns */
  .tw-footer__inner { grid-template-columns: 1fr !important; gap: 32px; }
  .tw-footer__col { border-bottom: 1px solid rgba(247,247,246,.1); padding-bottom: 24px; }

  /* Tablas / fichas */
  .tw-project-ficha { gap: 12px; }
  .tw-project-ficha div { padding: 12px 0; }

  /* Form inputs anti-zoom iOS */
  .tw-form__input,
  .tw-form__textarea,
  .tw-form__select,
  input[type=text], input[type=email], input[type=tel], textarea, select { font-size: 16px !important; }

  /* Marquee speed más razonable */
  .tw-marquee__track { animation-duration: 30s !important; }

  /* Cred grid en bio — 1 col */
  .tw-bio__cred-grid { grid-template-columns: 1fr !important; }

  /* Blog cats sticky off */
  .tw-blog-cats { flex-direction: row !important; flex-wrap: wrap; position: static !important; gap: 8px; }
  .tw-blog-cats a { font-size: 12px; padding: 6px 10px; }
}

/* =========== MOBILE S (≤380px) ============ */
@media (max-width: 380px) {
  .tw-container { padding: 0 14px; }
  .tw-nav__inner { padding: 10px 14px; }
  .tw-nav__cta { font-size: 9px !important; padding: 6px 8px !important; }

  .tw-hero__title { font-size: 30px !important; }
  .tw-section__head h2,
  .tw-cta-band h2,
  .tw-pagehead__title { font-size: 28px !important; }

  .tw-metric__num { font-size: 28px !important; }
}

/* =========== Asegurar imágenes responsivas ============ */
img { max-width: 100%; height: auto; }
.tw-project__img,
.tw-post-card__img,
.tw-hero__bg { background-position: center !important; }

/* Evitar overflow horizontal */
html, body { overflow-x: hidden; }
.tw-page, main, section { max-width: 100vw; }

/* Touch targets — mínimo 44px en mobile */
@media (max-width: 900px) {
  .tw-btn,
  .tw-nav__item,
  a.tw-project,
  button { min-height: 44px; }
}

/* =====================================================
   MOBILE NAV — burger + overlay
   ===================================================== */
.tw-burger {
  display: none;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  transition: background .2s ease;
}
.tw-burger:hover { background: rgba(0,0,0,.04); }
.tw-burger span {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--site-fg, #0a0a0a);
  transition: transform .25s ease, opacity .2s ease;
  transform-origin: center;
}
.tw-burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.tw-burger.is-open span:nth-child(2) { opacity: 0; }
.tw-burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.tw-mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--site-bg, #f5f4ef);
  z-index: 999;
  padding: 88px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .25s ease;
  overflow-y: auto;
}
.tw-mobile-menu.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.tw-mobile-menu__items,
.tw-mobile-menu .tw-nav__items {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  align-items: stretch !important;
}
.tw-mobile-menu .tw-nav__item,
.tw-mobile-menu .tw-nav__menu > li > a,
.tw-mobile-menu a {
  display: block;
  font-family: var(--font-display, sans-serif);
  font-size: 28px !important;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding: 18px 0 !important;
  border-bottom: 1px solid rgba(0,0,0,.08);
  text-decoration: none;
  color: var(--site-fg, #0a0a0a) !important;
  text-transform: none !important;
}
.tw-mobile-menu .tw-nav__menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex !important;
  flex-direction: column !important;
}
.tw-mobile-menu__cta,
.tw-mobile-menu .tw-btn {
  margin-top: 32px;
  width: 100%;
  justify-content: center;
  padding: 16px !important;
  font-size: 14px !important;
  border-bottom: 0 !important;
}

@media (max-width: 900px) {
  .tw-burger { display: flex !important; }
}
