/* Correcciones responsive cargadas después de la hoja principal. */
html,
body {
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p,
a,
span {
  overflow-wrap: anywhere;
}

.expert-photo {
  height: 590px;
  margin: 0;
  overflow: hidden;
  background: #e7e4dd;
}

.expert-photo picture,
.expert-photo img {
  display: block;
  width: 100%;
  height: 100%;
}

.expert-photo img {
  object-fit: cover;
  object-position: center 24%;
}

@media (max-width: 900px) {
  .topbar {
    display: none;
  }

  .header {
    height: 72px;
  }

  .brand img {
    width: 190px;
  }

  .menu {
    display: flex;
    width: 48px;
    height: 48px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border: 0;
    background: none;
  }

  .menu span {
    width: 25px;
    height: 2px;
    background: var(--ink);
  }

  .menu b {
    position: absolute;
    left: -9999px;
  }

  .header nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    display: none;
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    padding: 25px 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    border-top: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  }

  .header nav.open {
    display: flex;
  }

  .hero,
  .hero-grid {
    min-height: 720px;
  }

  .hero-photo {
    inset: 0;
  }

  .hero-shade {
    background: linear-gradient(180deg, rgba(47, 13, 19, 0.65), var(--deep) 72%);
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 70px;
  }

  .hero-panel {
    display: none;
  }

  .section {
    padding: 75px 0;
  }

  .section-head,
  .sectors-grid,
  .expert-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 35px;
  }

  .section-head {
    margin-bottom: 38px;
  }

  .need-grid,
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-grid .featured {
    grid-column: span 2;
  }

  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .evidence-grid div {
    padding: 15px 0;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  .sector-visual {
    margin-left: 45px;
  }

  .method-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
  }

  .method-line li {
    padding: 0;
    border: 0;
  }

  .course-area {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid p {
    grid-row: 2;
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .wrap {
    width: min(calc(100% - 28px), var(--max));
  }

  .header {
    height: 68px;
  }

  .nav-wrap {
    gap: 12px;
  }

  .brand {
    min-width: 0;
  }

  .brand img {
    width: 168px;
  }

  .menu {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .header nav {
    top: 68px;
    max-height: calc(100dvh - 68px);
  }

  .hero,
  .hero-grid {
    min-height: 0;
  }

  .hero-grid {
    padding-top: 86px;
    padding-bottom: 54px;
  }

  .hero-photo {
    background-position: 62% center;
  }

  .hero-shade {
    background: linear-gradient(180deg, rgba(47, 13, 19, 0.66), var(--deep) 66%);
  }

  .hero h1 {
    font-size: clamp(2.15rem, 11vw, 2.75rem);
    line-height: 1.03;
    letter-spacing: -0.045em;
  }

  .hero-copy > p:not(.eyebrow) {
    font-size: 18px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions .btn {
    width: 100%;
  }

  .need-grid,
  .service-grid {
    grid-template-columns: 1fr;
  }

  .need-grid a {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .service-grid .featured {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .service-image {
    min-height: 240px;
  }

  .service-grid article {
    min-height: auto;
  }

  .evidence strong {
    font-size: 35px;
  }

  .sector-visual {
    margin-left: 0;
  }

  .sector-image {
    height: 430px;
  }

  .sector-card {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    margin: -54px 14px 0;
    padding: 24px;
  }

  .method-line {
    grid-template-columns: 1fr;
  }

  .method-line li {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .method-line strong {
    margin-top: 12px;
  }

  .course-main,
  .course-side {
    min-width: 0;
    padding: 32px 24px;
  }

  .course-main h3 {
    font-size: 30px;
  }

  .expert-photo {
    height: 510px;
  }

  .contact-grid {
    gap: 45px;
  }

  .contact-data a,
  .contact-data span {
    overflow-wrap: anywhere;
  }

  form {
    min-width: 0;
    padding: 22px 18px;
    grid-template-columns: minmax(0, 1fr);
  }

  form label:nth-child(4) {
    grid-column: auto;
  }

  input,
  select,
  textarea {
    min-width: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid p {
    grid-row: auto;
    grid-column: auto;
  }

  .footer-grid img {
    width: min(230px, 100%);
  }

  .footer-bottom {
    flex-direction: column;
    gap: 7px;
  }

  .whatsapp {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 380px) {
  .wrap {
    width: min(calc(100% - 22px), var(--max));
  }

  .brand img {
    width: 150px;
  }

  .hero-grid {
    padding-top: 72px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .section {
    padding: 62px 0;
  }

  .course-main,
  .course-side {
    padding: 26px 20px;
  }

  .sector-card {
    margin: -42px 8px 0;
  }

  .system-list span {
    padding: 9px 11px;
    font-size: 13px;
  }
}
