/* La portada conserva los marcos fotográficos y los elementos que Webflow anima. */
@media (max-width: 991px) {
  html[lang] body:has(.hero-wrapper) {
    .section:has(.hero-wrapper) > .space-112px { min-height: 5.5rem; }
    .hero-wrapper {
      --titulo: clamp(3.25rem, 11vw, 5.75rem);
      --foto: clamp(20rem, min(112vw, 58svh), 38rem);
      /* Deja fondo negro a ambos lados de los iconos en los extremos de la curva. */
      --recorte: clamp(17rem, 38vw, 18rem);
      height: calc(var(--titulo) + var(--foto));
      min-height: 0;
      max-height: none;
    }
    .hero-wrapper :is(.center-title-wrapper, .center-title) {
      width: 100%;
      min-width: 100%;
      height: var(--titulo);
      min-height: var(--titulo);
      max-height: var(--titulo);
      padding: 0;
    }
    .hero-image {
      inset: var(--titulo) 0 auto;
      height: var(--foto);
      min-height: 0;
      max-height: none;
      object-position: 54% center;
    }
    .cutout-image {
      top: calc(var(--titulo) + (var(--foto) - var(--recorte)) / 2);
      height: var(--recorte);
      min-height: 0;
      max-height: none;
      width: 3rem;
      min-width: 3rem;
      max-width: 3rem;
    }
    .cutout-image > .image-absolute {
      width: 100%;
      height: 100%;
      object-fit: fill;
      pointer-events: none;
    }
    .hero-wrapper .socials-wrapper.hero { gap: 0; margin: 0; }
    .hero-wrapper .socials-wrapper a {
      display: grid;
      width: 44px;
      height: 44px;
      place-items: center;
      flex: none;
    }
    .hero-wrapper .bottom-right-corner {
      min-width: clamp(4.5rem, 21vw, 6rem);
      max-width: none;
      min-height: clamp(4.5rem, 21vw, 6rem);
      max-height: none;
    }
    .hero-wrapper .arrow-wrapper {
      inset: 0;
      margin: auto;
      min-width: 44px;
      max-width: 44px;
      min-height: 44px;
      max-height: 44px;
    }
    .brands-grid {
      width: 100%;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: .65rem 1rem;
      padding-block: .6rem;
    }
    .brands-grid .logos-with-name-wrapper {
      width: 100%;
      min-width: 0;
      max-width: 11.5rem;
      padding: 0;
    }
    .brands-grid img { width: 100%; height: auto; }
    .metrics-grid-quarter {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: clamp(.65rem, 1.8vw, 1rem);
      align-items: stretch;
    }
    .metrics-card {
      container-type: inline-size;
      min-width: 0;
      max-width: none;
      width: 100%;
      min-height: clamp(12.4rem, 34vw, 15rem);
      max-height: none;
      gap: 1rem;
      padding: clamp(.85rem, 2.6vw, 1.75rem);
      align-items: flex-start;
    }
    .metrics-card h5 {
      min-width: 0;
      max-width: 100%;
      overflow-wrap: anywhere;
      font-size: clamp(.8125rem, 2vw, .95rem);
      line-height: 1.35;
      letter-spacing: .055em;
    }
    .metrics-card :is(h4, .heading-2) {
      font-size: clamp(1.05rem, 12cqi, 2rem);
      line-height: 1.1;
      overflow-wrap: normal;
    }
    .metrics-card .heading-2 > .outline-white { font-size: inherit; line-height: inherit; }
    .metrics-card .metrics-flex { gap: clamp(.3rem, 3cqi, .8rem); }
    .metrics-card .metrics-flex:not(.space-between) { justify-content: flex-start; }
    .metrics-card .metrics-flex img { flex: none; width: clamp(1.1rem, 14cqi, 2.6rem); height: auto; }

    .section:has(.works-block) .space-112px { min-height: clamp(2rem, 6vw, 3.75rem); }
    .works-block { gap: clamp(.9rem, 2.5vw, 1.5rem); }
    .works-wrapper {
      width: 100%;
      min-width: 0;
      max-width: 100%;
      height: auto;
      min-height: 0;
      max-height: none;
      aspect-ratio: 1.55;
    }
    .works-wrapper .works-link-wrapper { min-height: 100%; }
    .works-wrapper .works-image { object-fit: cover; }
    .works-wrapper .badge.absolute-top-right { inset: .8rem .8rem auto auto; }

    .about-block {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      grid-template-areas: "title seal" "copy copy";
      align-items: center;
      gap: 1.3rem clamp(1rem, 4vw, 2rem);
      padding-block: clamp(2.75rem, 7vw, 4.75rem);
    }
    .about-block > .space-112px { display: none; }
    .about-text {
      grid-area: title;
      max-width: 100%;
      text-align: start;
      font-size: clamp(1.85rem, 5.5vw, 3.3rem);
      line-height: 1.07;
    }
    .about-description {
      display: block;
      grid-area: copy;
      justify-self: start;
      max-width: 60ch;
      text-align: start;
      font-size: 1rem;
      font-weight: 300;
      line-height: 1.55;
    }
    .about-image-absolute {
      grid-area: seal;
      position: relative;
      inset: auto;
      align-self: center;
      justify-self: center;
      width: clamp(7.5rem, 20vw, 11rem);
      min-width: 0;
      max-width: 100%;
      height: auto;
      min-height: 0;
      max-height: none;
    }
    .about-image-absolute.back { inset: auto; translate: -.65rem .65rem; }

    .section:has(.reviews-slider-wrapper) > .container { padding: 0 5%; }
    .reviews-slider-wrapper {
      display: grid;
      grid-template: "quote quote quote" auto "prev dots next" 44px / 44px minmax(0, 1fr) 44px;
      width: 100%;
      max-width: none;
      gap: .85rem .25rem;
      margin: 0;
      padding-top: clamp(2.5rem, 7vw, 4rem);
    }
    .reviews-slider-wrapper .mask { grid-area: quote; min-width: 0; width: 100%; max-width: none; }
    .reviews-slider-wrapper .slide > :is(.space-16px, .space-112px),
    .reviews-slide > .space-16px { display: none; }
    .reviews-slide { display: block; }
    .reviews-text {
      max-width: 32ch;
      text-align: start;
      text-wrap: pretty;
      font-size: clamp(1.55rem, 4.7vw, 2.55rem);
      line-height: 1.2;
    }
    .reviews-arrow.left, .reviews-arrow.right {
      display: grid;
      position: static;
      place-items: center;
      width: 44px;
      height: 44px;
      margin: 0;
      border: 1px solid var(--light-grey);
      border-radius: 50%;
    }
    .reviews-arrow.left { grid-area: prev; }
    .reviews-arrow.right { grid-area: next; }
    .reviews-arrow .w-icon-slider-left, .reviews-arrow .arrow-icon { display: none; }
    .reviews-arrow::after {
      content: "";
      width: .65rem;
      height: .65rem;
      border: solid currentColor;
      border-width: 0 2px 2px 0;
      rotate: -45deg;
    }
    .reviews-arrow.left::after { rotate: 135deg; }
    .reviews-slider-wrapper .slide-nav {
      grid-area: dots;
      display: flex;
      position: static;
      align-items: center;
      justify-content: center;
      height: 44px;
      padding: 0;
    }
    .reviews-slider-wrapper .w-slider-dot {
      display: grid;
      flex: none;
      width: 44px;
      height: 44px;
      margin: 0 !important;
      place-items: center;
      background: transparent;
    }
    .reviews-slider-wrapper .w-slider-dot::after {
      content: "";
      width: .55rem;
      height: .55rem;
      border: 1px solid currentColor;
      border-radius: 50%;
    }
    .reviews-slider-wrapper .w-active::after { background: currentColor; }
    .reviews-slider-wrapper :is(.reviews-arrow, .w-slider-dot):focus-visible {
      outline: 2px solid var(--white);
      outline-offset: -2px;
    }

    .section:has(.cta-block) > .space-112px { min-height: clamp(2.5rem, 7vw, 4.5rem); }
    .cta-text-block { gap: .8rem; }
    .cta-block { gap: 1.35rem; }
    .cta-flex { flex-flow: row nowrap; justify-content: center; gap: 0; }
    .cta-flex .cta-small { font-size: clamp(1.65rem, 6.4vw, 3rem); line-height: 1.1; }
    .cta-flex .cta-small:first-child { margin-inline-end: .25em; }
    .cta-medium { font-size: clamp(2rem, 8vw, 4rem); line-height: 1.05; }
  }
}

@media (max-width: 767px) {
  html[lang] body:has(.hero-wrapper) {
    .about-block {
      grid-template-columns: minmax(0, 1fr);
      grid-template-areas: "title" "copy" "seal";
    }
    .about-image-absolute { margin-top: .5rem; }
    .brands-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-flex {
      display: grid;
      grid-template: "main main" auto "photo secondary" auto / minmax(0,.85fr) minmax(0,1.15fr);
      align-items: stretch;
      gap: .65rem;
    }
    .card-flex > .card-block { align-items: stretch; min-width: 0; width: 100%; gap: .65rem; }
    .card-flex > .card-block:first-child { grid-area: main; }
    .card-flex > .card-block:last-child { grid-area: secondary; }
    .card-flex > .card-image { grid-area: photo; }
    .card-flex :is(img, .card-large-short, .card-small-short) {
      width: 100%;
      min-width: 0;
      max-width: 100%;
      min-height: 0;
      max-height: none;
    }
    .card-flex img { object-fit: cover; }
    .card-large { height: auto; aspect-ratio: 1.9; }
    .card-small { height: auto; aspect-ratio: .96; }
    .card-flex > .card-image { align-self: stretch; height: 100%; min-height: 0; }
    .card-flex :is(.card-large-short, .card-small-short) {
      height: auto;
      padding: clamp(.85rem, 3vw, 1.35rem) .65rem;
      gap: .45rem;
    }
    .card-flex :is(.text-block-4, .text-block-5) {
      font-size: clamp(1.7rem, 7.3vw, 2.45rem);
      line-height: 1.12;
    }
    .card-flex :is(.text-block-2, .text-block-3) {
      font-size: clamp(1.16rem, 4.5vw, 2rem);
      line-height: 1.12;
    }
    .card-flex :is(.card-large-short, .card-small-short) p {
      max-width: 100%;
      font-size: .95rem;
      line-height: 1.35;
    }
  }
}

@media (max-width: 379px) {
  html[lang] body:has(.hero-wrapper) {
    .metrics-grid-quarter { grid-template-columns: minmax(0, 1fr); }
    .metrics-card { min-height: 8.8rem; padding: 1rem 1.2rem; }
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  html[lang] body:has(.hero-wrapper) {
    .card-flex {
      display: grid;
      grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
      align-items: stretch;
      gap: .75rem;
      height: clamp(22rem, 51vw, 32rem);
    }
    .card-flex > .card-block {
      display: grid;
      min-width: 0;
      min-height: 0;
      align-items: stretch;
      gap: .75rem;
    }
    .card-block:first-child { grid-template-rows: minmax(0, 1fr) auto; }
    .card-block:last-child { grid-template-rows: auto minmax(0, 1fr); }
    .card-flex :is(img, .card-large-short, .card-small-short) {
      width: 100%;
      min-width: 0;
      max-width: 100%;
      min-height: 0;
      max-height: none;
    }
    .card-flex img { height: 100%; object-fit: cover; }
    .card-flex :is(.card-large-short, .card-small-short) {
      align-self: stretch;
      min-height: 7.5rem;
      gap: .45rem;
      padding: .75rem .5rem;
    }
    .card-flex :is(.text-block-4, .text-block-5) {
      font-size: clamp(1.9rem, 4.6vw, 2.75rem);
      line-height: 1.1;
    }
    .card-flex :is(.text-block-2, .text-block-3) {
      font-size: clamp(1.1rem, 2.5vw, 1.6rem);
      line-height: 1.1;
    }
    .card-flex :is(.card-large-short, .card-small-short) p {
      max-width: 100%;
      font-size: .95rem;
      line-height: 1.35;
    }
  }
}
