/* SOCIAL PROP | Ajustes responsive v3 (sin alterar la estructura comercial) */
:root {
  --sp-page-gutter: clamp(16px, 3.2vw, 32px);
}

html { scroll-padding-top: calc(var(--header-height) + 16px); }
body { min-width: 280px; }
.container { width: min(calc(100% - var(--sp-page-gutter) * 2), var(--container)); }
button, a, select, input { touch-action: manipulation; }
.button, .nav-link, .filter-field, .project-link { overflow-wrap: anywhere; }
.brand img, .footer-brand img { object-fit: contain; }
.brand { min-width: 0; }
.hero-copy, .hero-side, .process-intro, .section-topline > div { min-width: 0; }
.hero-copy h1, .section-topline h2, .process-intro h2 { text-wrap: balance; overflow-wrap: break-word; }
.hero-lead { text-wrap: pretty; }
.hero-project, .advice-chip { min-width: 0; }
.project-rail, .partner-rail, .trust-grid { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.project-card, .partner-logo, .trust-item { min-width: 0; }
.project-body h3 { overflow-wrap: anywhere; }
.search-panel { min-width: 0; }
.filter-field { overflow: hidden; }
.filter-copy select { text-overflow: ellipsis; }
.mobile-header-contact, .search-mobile-heading { display: none; }

/* Navegación ajustada para notebooks: los CTA y el logo conservan espacio */
@media (min-width: 1181px) and (max-width: 1380px) {
  .header-inner { gap: 15px; }
  .primary-nav { gap: clamp(10px, 1.2vw, 19px); }
  .nav-link { font-size: 12px; }
  .header-actions { gap: 7px; }
  .header-actions .button { padding-inline: 10px; font-size: 12px; }
  .brand img { max-width: 190px; }
}

@media (max-width: 1180px) {
  .header-inner { grid-template-columns: auto 1fr auto; }
  .primary-nav {
    top: var(--header-height);
    height: calc(100dvh - var(--header-height));
    max-height: calc(100dvh - var(--header-height));
    overscroll-behavior: contain;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .primary-nav .mobile-nav-actions { margin-top: 12px; }
  .header-actions { align-items: center; }
  .hero-inner { gap: clamp(22px, 3vw, 40px); }
  .hero-copy h1 { font-size: clamp(43px, 5.1vw, 63px); }
  .search-button { grid-column: span 2; }
  .search-mobile-heading {
    display: flex;
    flex-direction: column;
    grid-column: 1 / -1;
    gap: 2px;
    padding: 0 3px 3px;
    margin: 0;
    color: var(--sp-deep);
    font-weight: 800;
    line-height: 1.4;
    font-size: 16px;
  }
  .search-mobile-heading small {
    color: var(--sp-muted);
    font-size: 12px;
    font-weight: 500;
  }
}

/* Tablet horizontal y vertical: portada en columnas cómodas, sin estrechar los CTA */
@media (min-width: 701px) and (max-width: 1000px) {
  .hero { min-height: auto; }
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 30px;
    padding-top: 52px;
    padding-bottom: 104px;
  }
  .hero-copy { max-width: 700px; }
  .hero-copy h1 { max-width: 700px; font-size: clamp(46px, 6.4vw, 60px); }
  .hero-actions { max-width: 690px; }
  .hero-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.85fr);
    align-items: center;
    gap: 18px;
    padding-top: 0;
  }
  .advice-chip { align-self: center; }
  .hero-project { width: 100%; }
  .hero-card-image { min-height: 120px; }
  .search-wrap { margin-top: -56px; }
  .search-panel { gap: 12px; padding: 16px; }
  .trust-grid { gap: 20px; }
}

/* Tablet: menos columnas por línea, acciones principales siempre completas */
@media (max-width: 900px) {
  .search-button { grid-column: 1 / -1; }
  .hero-copy h1 { font-size: clamp(45px, 6.2vw, 58px); }
  .process-card { gap: 30px; }
  .process-steps { gap: 22px; }
  .alliance-photo { min-height: 310px; }
  .alliance-content { padding-inline: var(--sp-page-gutter); }
  .partners-layout, .stories-layout { gap: 22px; }
}

@media (max-width: 700px) {
  :root { --sp-page-gutter: 16px; }
  .site-header { backdrop-filter: blur(16px); }
  .header-inner { display: flex; justify-content: space-between; gap: 9px; }
  .brand { flex: 0 1 auto; }
  .brand img { width: clamp(134px, 40vw, 176px); max-height: 42px; height: auto; }
  .menu-toggle { order: 3; flex: 0 0 44px; height: 44px; width: 44px; margin: 0; }
  .mobile-header-contact {
    display: inline-flex;
    order: 2;
    flex: 0 0 auto;
    min-height: 42px;
    padding: 10px 14px;
    font-size: 12px;
  }
  .primary-nav { width: min(390px, 100vw); }
  .nav-link { font-size: 15px; min-height: 49px; }
  .mobile-nav-actions .button { min-height: 48px; }

  .hero {
    background-position: 62% center;
    background-image: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.92) 47%, rgba(255,255,255,.52) 100%), url('assets/images/hero-santiago.webp');
  }
  .hero-inner { gap: 25px; padding-block: 38px 80px; }
  .hero-copy .eyebrow { margin-bottom: 11px; font-size: 10px; letter-spacing: .13em; }
  .hero-copy h1 { max-width: 550px; margin-bottom: 15px; font-size: clamp(34px, 9.2vw, 52px); line-height: 1.05; }
  .hero-lead { max-width: 520px; margin-bottom: 22px; font-size: 14px; line-height: 1.55; }
  .hero-actions { gap: 9px; }
  .hero-actions .button { min-height: 48px; font-size: 13px; }
  .hero-side { gap: 10px; }
  .hero-project {
    display: grid;
    grid-template-columns: minmax(116px, 39%) minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    max-width: 550px;
    border-width: 5px;
    border-radius: 16px;
  }
  .hero-card-image { min-height: 146px; height: 100%; }
  .hero-card-image span { top: 7px; left: 6px; max-width: calc(100% - 12px); white-space: normal; line-height: 1.2; padding: 5px 7px; font-size: 9px; }
  .hero-card-body { min-width: 0; padding: 10px 10px 6px; }
  .hero-card-body h2 { margin-bottom: 6px; font-size: 13px; line-height: 1.2; }
  .hero-card-body p { gap: 5px; margin: 3px 0; font-size: 10px; }
  .hero-card-body p .icon { width: 12px; height: 12px; }
  .hero-card-body a { min-height: 34px; margin-top: 7px; font-size: 11px; }
  .advice-chip { max-width: 550px; padding: 10px 12px; }
  .advice-chip strong { font-size: 12px; }
  .advice-chip small { font-size: 10px; }
  .icon-bubble { width: 36px; height: 36px; }

  .search-wrap { margin-top: -50px; }
  .search-panel { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 13px; border-radius: 18px; }
  .search-mobile-heading { font-size: 16px; }
  .filter-field { min-height: 60px; gap: 7px; padding: 8px; }
  .filter-icon { width: 29px; height: 29px; }
  .filter-icon .icon { width: 16px; height: 16px; }
  .filter-copy > span { font-size: 10px; }
  .filter-copy select { font-size: 11px; }
  .filter-chevron { right: 5px; bottom: 13px; width: 12px; }
  .search-button { grid-column: 1 / -1; min-height: 51px; font-size: 13px; }

  .trust-strip { padding: 25px 0 28px; }
  .trust-grid { grid-auto-columns: minmax(225px, 70vw); gap: 10px; }
  .trust-item { gap: 10px; justify-content: flex-start; }
  .trust-icon { height: 45px; width: 45px; }
  .trust-icon .icon { width: 21px; height: 21px; }
  .trust-item p { font-size: 12px; }

  .projects-section { padding-block: 44px 50px; }
  h2 { font-size: clamp(27px, 7vw, 36px); }
  .section-topline { gap: 16px; }
  .section-topline p:not(.eyebrow) { font-size: 13px; }
  .project-rail { width: calc(100% + var(--sp-page-gutter)); grid-auto-columns: minmax(240px, min(80vw, 330px)); margin-right: calc(-1 * var(--sp-page-gutter)); }
  .project-card { min-height: 420px; }
  .project-image { min-height: 180px; }
  .project-body h3 { font-size: 17px; }
  .project-link { min-height: 48px; }
  .process-section { padding-bottom: 50px; }
  .process-card { width: min(calc(100% - 24px), 1240px); padding: 28px clamp(17px,5vw,28px); }
  .process-steps { gap: 16px; }
  .process-step { grid-template-columns: 72px minmax(0,1fr); gap: 0 13px; }
  .step-icon { width: 47px; height: 47px; }
  .step-number { font-size: 11px; }
  .process-step p { font-size: 12px; }
  .alliance-photo { min-height: 275px; }
  .alliance-content { padding-block: 35px; }
  .alliance-copy > p:not(.eyebrow) { font-size: 14px; }
  .alliance-copy .button { width: 100%; max-width: 390px; }
  .alliance-features { gap: 12px; }
  .partner-rail { width: 100%; grid-auto-columns: minmax(135px, 42vw); margin-right: 0; }
  .stories-section { padding-block: 48px; }
  .testimonial-card { padding: 22px; }
  .broker-inner { gap: 16px; }
  .broker-inner h2 { font-size: 26px; }
  .broker-inner p { font-size: 13px; }
  .site-footer { padding-top: 42px; }
  .footer-grid { gap: 24px; }
  .footer-bottom { margin-top: 25px; text-align: center; }

  .contact-modal { align-items: end; padding: 0; }
  .contact-dialog {
    max-height: 94vh; max-height: 94dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 28px max(18px, env(safe-area-inset-right, 0px)) calc(22px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
    border-radius: 22px 22px 0 0;
  }
  .contact-step > h2 { font-size: clamp(25px, 7vw, 31px); }
  .contact-intro { margin-bottom: 17px; }
  .contact-channel-grid { gap: 9px; }
  .contact-channel-card { min-height: 81px; padding: 12px; }
  .contact-consent { font-size: 12px; }
  .contact-field input, .contact-field select { min-height: 48px; font-size: 16px; }
}

@media (max-width: 379px) {
  :root { --sp-page-gutter: 12px; }
  .header-inner { gap: 6px; }
  .brand img { width: 125px; }
  .mobile-header-contact { padding-inline: 9px; font-size: 11px; }
  .menu-toggle { width: 42px; flex-basis: 42px; }
  .hero-inner { padding-top: 32px; }
  .hero-copy h1 { font-size: clamp(32px, 10.3vw, 38px); }
  .hero-actions .button { padding-inline: 12px; }
  .hero-project { grid-template-columns: 38% minmax(0,1fr); }
  .hero-card-body p:nth-of-type(2) { display: none; }
  .search-panel { grid-template-columns: minmax(0,1fr); padding: 12px; }
  .search-button { grid-column: 1; }
  .filter-field { min-height: 54px; }
  .filter-copy select { font-size: 13px; }
  .project-rail { grid-auto-columns: minmax(238px, 87vw); }
  .contact-channel-icon { width: 40px; height: 40px; }
  .contact-channel-card { gap: 9px; }
}

@media (max-height: 560px) and (max-width: 1180px) {
  .primary-nav { padding-top: 8px; }
  .nav-link { min-height: 40px; padding-block: 9px; }
  .contact-dialog { max-height: 96dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .project-rail, .partner-rail { scroll-behavior: auto; }
}
