/* Hallmark · macrostructure: existing production / responsive-preservation · tone: utilitarian · anchor hue: existing Mafesa orange/blue */
/* Hallmark · pre-emit critique: P5 H4 E5 S5 R5 V4 · contrast: inherited/unchanged · honest: pass · chrome: pass · tokens: pass · responsive: pass */
/* Layout safety is causal: no global overflow clipping; every tested document must remain within its viewport. */

:root {
  --mafesa-pilot-space-2xs: 0.5rem;
  --mafesa-pilot-space-xs: 0.75rem;
  --mafesa-pilot-space-sm: 1rem;
  --mafesa-pilot-chat-size: 2.75rem;
  --mafesa-pilot-duration-short: 120ms;
}

/* The production footer uses an intrinsic-width email that exceeds its tablet column. */
@media (40rem <= width < 56rem) {
  .elementor-element-6597d865,
  .elementor-element-28c84f11,
  .elementor-element-28c84f11 .elementor-widget-container,
  .elementor-element-28c84f11 .elementor-icon-list-items,
  .elementor-element-28c84f11 .elementor-icon-list-item,
  .elementor-element-28c84f11 .elementor-icon-list-item > a {
    min-inline-size: 0;
    max-inline-size: 100%;
  }

  .elementor-element-28c84f11 .elementor-icon-list-text {
    inline-size: 100%;
    min-inline-size: 0;
    max-inline-size: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
  }
}

@media (48rem <= width < 56rem) {
  .elementor-location-footer .elementor-element-62163ee6 > .e-con-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.65fr) minmax(0, 1.3fr);
    align-items: start;
  }

  .elementor-location-footer :is(
      .elementor-element-4ba51118,
      .elementor-element-51f60083,
      .elementor-element-6597d865
    ) {
    inline-size: 100%;
    min-inline-size: 0;
    max-inline-size: none;
  }

  .elementor-element-28c84f11 .elementor-icon-list-text {
    overflow-wrap: normal;
    white-space: nowrap;
  }

  body.blog .elementor-element-3cea51a .elementor-heading-title {
    font-size: clamp(1.75rem, 3.65vw, 2rem);
    line-height: 1.12;
    min-inline-size: 0;
    overflow-wrap: anywhere;
  }

  body.blog .mafesa-blog .elementor-menu-toggle {
    gap: var(--mafesa-pilot-space-2xs);
    min-block-size: 2.75rem;
    padding-inline: var(--mafesa-pilot-space-xs);
    white-space: nowrap;
  }

  body.blog .mafesa-blog .elementor-menu-toggle::after {
    content: "Categorías";
    font: inherit;
  }
}

@media (width < 56rem) {
  body.blog :is(
      .elementor-element-5cb1e787,
      .elementor-element-209e9291
    ) .elementor-heading-title {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    white-space: nowrap;
  }

  body.blog .elementor-element-5cb1e787 .elementor-heading-title {
    line-height: 1.5;
  }

  body.blog .elementor-element-63a6f0dc .elementor-heading-title {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    overflow-wrap: anywhere;
    white-space: normal;
  }

  body.blog.elementor-page-4103
    .elementor-element.elementor-element-2f0f48e {
    --margin-top: 0px;
    margin-block-start: 0;
  }
}

/* Preserve the desktop Blog composition; stack the existing feature only where it breaks. */
@media (width < 48rem) {
  body.blog.elementor-page-4103
    .elementor-element.elementor-element-28e1cb2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: max-content max-content;
    grid-auto-rows: max-content;
    align-content: start;
    gap: var(--mafesa-pilot-space-sm);
    block-size: auto;
    min-block-size: 0;
    inline-size: calc(100vw - 2rem);
    inline-size: calc(100dvw - 2rem);
    max-inline-size: 30rem;
    margin-inline: 0;
    position: relative;
    inset-inline-start: calc((100vw - 100%) / -2 + 1rem);
    inset-inline-start: calc((100dvw - 100%) / -2 + 1rem);
  }

  body.blog .elementor-element-28e1cb2 > .e-con,
  body.blog .elementor-element-9065048,
  body.blog .elementor-element-a9837a1,
  body.blog .elementor-element-3cea51a,
  body.blog .elementor-element-3cea51a > .elementor-widget-container,
  body.blog .elementor-element-5371fb1,
  body.blog .elementor-element-5371fb1 > .elementor-widget-container,
  body.blog .elementor-element-bd20f07,
  body.blog .elementor-element-56116de,
  body.blog .elementor-element-56116de > .elementor-widget-container {
    inline-size: 100%;
    min-inline-size: 0;
    max-inline-size: none;
  }

  body.blog .elementor-element-3cea51a .elementor-heading-title {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
    line-height: 1.12;
    min-inline-size: 0;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  body.blog .elementor-element-a9837a1 {
    padding-inline: 0;
  }

  body.blog.elementor-page-4103
    :is(
      .elementor-element.elementor-element-9065048,
      .elementor-element.elementor-element-bd20f07
    ) {
    block-size: max-content;
    min-block-size: 0;
    align-self: start;
  }

  body.blog .elementor-element-5371fb1 .elementor-button {
    inline-size: auto;
    white-space: nowrap;
  }

  body.blog .elementor-element-bd20f07 img {
    display: block;
    inline-size: min(100%, 28rem);
    block-size: auto;
    margin-inline: auto;
  }

  body.blog .mafesa-blog .elementor-menu-toggle {
    gap: var(--mafesa-pilot-space-2xs);
    min-block-size: 2.75rem;
    padding-inline: var(--mafesa-pilot-space-xs);
    white-space: nowrap;
  }

  body.blog .mafesa-blog .elementor-menu-toggle::after {
    content: "Categorías";
    font: inherit;
  }
}

/* Keep WhatsApp available while reducing obstruction on the three form routes. */
@media (width < 30.0625rem) {
  body:is(.page-id-4200, .page-id-3875, .page-id-16) .joinchat {
    --s: var(--mafesa-pilot-chat-size);
    --sep: max(var(--mafesa-pilot-space-2xs), env(safe-area-inset-right));
    --bottom: max(var(--mafesa-pilot-space-2xs), env(safe-area-inset-bottom));
    transition: opacity var(--mafesa-pilot-duration-short) linear;
  }

  body:is(.page-id-4200, .page-id-3875, .page-id-16) .joinchat__tooltip {
    display: none;
  }

  body:is(.page-id-4200, .page-id-3875, .page-id-16):has(form:focus-within)
    .joinchat:not(.joinchat--chatbox) {
    opacity: 0;
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:is(.page-id-4200, .page-id-3875, .page-id-16) .joinchat {
    transition-duration: 1ms;
  }
}
