/* Sense Roastery 8.4 — mobile-first correction layer.
   Existing Elementor post meta is never overwritten on upgrade. These rules
   therefore also target container geometry, not only new JSON templates.
   Breakpoints: desktop > 1100; tablet 768–1100; mobile <= 767. */
:root { --sr-v84-space:clamp(16px,4vw,48px); --sr-v84-grid-gap:clamp(16px,2.5vw,28px); }
html { -webkit-text-size-adjust:100%; }
html body { min-width:0; }
body :is(.sense-main-content,.site-footer,.site-header) {
  max-inline-size:100%; min-inline-size:0;
}
body :is(.sense-main-content,.site-footer,.site-header) :is(
  .elementor,.elementor-section,.elementor-container,.elementor-column,
  .elementor-widget-wrap,.e-con,.elementor-element,.elementor-widget,
  .elementor-widget-container
) { min-inline-size:0; box-sizing:border-box; }
body :is(.sense-main-content,.site-footer) :is(h1,h2,h3,h4,h5,h6,p,a,li,blockquote) {
  overflow-wrap:break-word;
}
body :is(.sense-main-content,.site-header,.site-footer) :is(img,svg,video) {max-inline-size:100%;}
body .sense-main-content :is(input,select,textarea,button) {min-inline-size:0;max-inline-size:100%;}

/* Footer: normal flow is essential; an Elementor image can inherit height,
   transform or absolute positioning from an old saved widget preset. */
html body .site-footer .sr-footer-main.e-con {
  display:grid!important;
  grid-template-columns:minmax(0,1.15fr) minmax(0,.75fr) minmax(0,.9fr)!important;
  align-items:start!important;
  gap:clamp(24px,3vw,52px)!important;
}
html body .site-footer .sr-footer-main.e-con > .e-con {
  width:100%!important; min-width:0!important; max-width:100%!important;
  min-height:0!important; height:auto!important; align-self:start!important;
  flex:none!important; grid-column:auto; transform:none!important;
}
html body .site-footer .sr-footer-main .sr-footer-brand.e-con {
  display:flex!important; flex-flow:column nowrap!important;
  align-items:flex-start!important;justify-content:flex-start!important;
  gap:0!important; position:static!important;
}
/* Also handles the unmodified widget output and image hyperlinks.
   An intentional smaller max-width of 148px on mobile prevents the wordmark
   being as tall as the following paragraph. */
html body .site-footer .sr-footer-main :is(
  .sr-footer-logo.elementor-widget,
  .sr-footer-brand > .elementor-widget-image:first-child
) {
  display:block!important;flex:0 0 auto!important;
  position:static!important; inset:auto!important;
  width:180px!important;max-width:100%!important;
  height:auto!important;min-height:0!important;max-height:none!important;
  margin:0 0 18px!important;padding:0!important;
  transform:none!important;float:none!important;clear:both!important;
  overflow:visible!important;align-self:flex-start!important;
}
html body .site-footer .sr-footer-main :is(
  .sr-footer-logo.elementor-widget,
  .sr-footer-brand > .elementor-widget-image:first-child
) :is(.elementor-widget-container,.elementor-image,figure,a,picture) {
  position:static!important; display:block!important; width:100%!important;
  max-width:100%!important;height:auto!important; min-height:0!important;
  padding:0!important;margin:0!important;transform:none!important;
}
html body .site-footer .sr-footer-main :is(
  .sr-footer-logo.elementor-widget,
  .sr-footer-brand > .elementor-widget-image:first-child
) img,
html body .site-footer img[src*="sense-wordmark"] {
  position:static!important;display:block!important;
  width:100%!important;max-width:180px!important;
  height:auto!important;min-height:0!important;max-height:110px!important;
  object-fit:contain!important;object-position:right center!important;
  float:none!important;margin:0!important;padding:0!important;
  transform:none!important;
}
html body .site-footer .sr-footer-main .sr-footer-description {
  position:static!important; display:block!important;
  width:100%!important;max-width:360px!important;
  flex:none!important; clear:both!important;
  margin:0!important;padding:0!important;
  height:auto!important;min-height:0!important;
  transform:none!important;
}
html body .site-footer .sr-footer-main .sr-footer-description :is(.elementor-widget-container,p){
  position:static!important; margin:0!important; height:auto!important;
  line-height:2!important;
}
/* No width/height inherited from Elementor-generated CSS for the fallback logo. */
html body .site-footer:not(.sr-elementor-site-footer) .footer-brand img {
  display:block!important;position:static!important;
  width:180px!important;max-width:100%!important;
  height:auto!important;max-height:110px!important;object-fit:contain!important;
  margin:0 0 18px!important;
}
/* Buttons should wrap within their own box instead of overlapping siblings. */
html body .sense-main-content .elementor .elementor-button,
html body .site-footer .elementor .elementor-button {
  box-sizing:border-box;max-width:100%;height:auto!important;
  white-space:normal!important;overflow-wrap:break-word;
}
html body .sense-main-content .elementor .elementor-button-content-wrapper {
  min-width:0;max-width:100%;align-items:center;justify-content:center;
}
html body .sense-main-content .elementor .elementor-button-text {min-width:0;max-width:100%;}

/* Tablets: use at most two cards per row, never four narrow cards.
   Structural :has() is a safety net for older saved Elementor containers that
   may not carry all the version-specific sr-* classes. */
@media (min-width:768px) and (max-width:1100px) {
  html body .sense-main-content .elementor :is(
    .sr-statement-section,.sr-process-cards,.sr-service-cards,.sr-values-cards
  ).e-con,
  html body .sense-main-content .elementor .e-con.e-flex:has(> .e-con:nth-child(3)) {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:var(--sr-v84-grid-gap)!important;
    align-items:stretch!important;
  }
  html body .sense-main-content .elementor :is(
    .sr-statement-section,.sr-process-cards,.sr-service-cards,.sr-values-cards
  ).e-con > .e-con,
  html body .sense-main-content .elementor .e-con.e-flex:has(> .e-con:nth-child(3)) > .e-con {
    width:100%!important;max-width:100%!important;
    min-width:0!important;flex-basis:auto!important;
    height:auto!important;
  }
  html body .site-footer .sr-footer-main.e-con {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:30px!important;
  }
  html body .site-footer .sr-footer-main .sr-footer-brand.e-con {grid-column:1/-1!important;}
}

/* All phone-sized devices: stack sections and cards, including saved Elementor
   25%/33%/50% columns.  The :has() fallback covers older four-column layouts.
   Header and footer are excluded from the generic stacking rule. */
@media (max-width:767px) {
  :root { --sr-v84-space:clamp(16px,5vw,24px); }
  html body .sense-main-content .elementor,
  html body .sense-main-content .elementor > .elementor-element,
  html body .sense-main-content .e-con {min-width:0!important;max-width:100%!important;}
  html body .sense-main-content .elementor :is(
    .sr-statement-section,.sr-process-cards,.sr-service-cards,.sr-values-cards,
    .sr-section-header,.sr-hero-section,.sr-manifesto-section,.sr-about-show-section,
    .sr-packaging-section,.sr-about-hero-section,.sr-contact-section,.sr-cta-section,
    .sr-hero-actions
  ).e-con,
  html body .sense-main-content .elementor .e-con.e-flex:has(> .e-con:nth-child(2)) {
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    grid-auto-flow:row!important;
    flex-direction:column!important;flex-wrap:nowrap!important;
    align-items:stretch!important;justify-items:stretch!important;
  }
  html body .sense-main-content .elementor :is(
    .sr-statement-section,.sr-process-cards,.sr-service-cards,.sr-values-cards,
    .sr-section-header,.sr-hero-section,.sr-manifesto-section,.sr-about-show-section,
    .sr-packaging-section,.sr-about-hero-section,.sr-contact-section,.sr-cta-section,
    .sr-hero-actions
  ).e-con > .e-con,
  html body .sense-main-content .elementor .e-con.e-flex:has(> .e-con:nth-child(2)) > .e-con {
    width:100%!important;min-width:0!important;max-width:100%!important;
    flex:0 1 auto!important;flex-basis:auto!important;
    grid-column:auto!important; grid-row:auto!important;
  }
  /* For classic Elementor sections created with columns, not Flexbox. */
  html body .sense-main-content .elementor .elementor-section .elementor-container {
    display:flex!important;flex-wrap:wrap!important;
  }
  html body .sense-main-content .elementor .elementor-section .elementor-container > .elementor-column {
    flex:0 0 100%!important;width:100%!important;max-width:100%!important;
  }
  html body .sense-main-content .elementor .elementor-grid,
  html body .sense-main-content .elementor .e-loop-container,
  html body .sense-main-content .elementor .products-grid {
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
  }
  html body .sense-main-content .elementor :is(
    .sr-process-cards,.sr-service-cards,.sr-values-cards,.sr-statement-section
  ).e-con {gap:14px!important;}
  html body .sense-main-content .elementor .sr-statement-section.e-con {
    padding:20px var(--sr-v84-space)!important;
  }
  html body .sense-main-content .elementor .sr-statement-section > .sr-strip-col.e-con {
    width:100%!important;min-height:0!important;padding:8px 0!important;
    border:0!important;
  }
  html body .sense-main-content .elementor .sr-statement-section .sr-strip-label .elementor-heading-title {
    font-size:11px!important;line-height:1.85!important;white-space:normal!important;
  }
  html body .sense-main-content .elementor .sr-process-card.e-con,
  html body .sense-main-content .elementor .sr-service-card.e-con,
  html body .sense-main-content .elementor .sr-value-card.e-con {
    height:auto!important;min-height:0!important;
    width:100%!important;max-width:100%!important;
  }
  html body .sense-main-content .elementor .sr-section-header.e-con {gap:16px!important;}
  html body .sense-main-content .elementor :is(.sr-container,.sr-hero-copy,.sr-cta-copy).e-con {
    min-width:0!important;max-width:100%!important;
  }
  /* Hero and CTA actions stay one per row with 44px touch targets. */
  html body .sense-main-content .elementor .sr-hero-actions.e-con {
    gap:12px!important;width:100%!important;
    grid-template-columns:minmax(0,1fr)!important;
  }
  html body .sense-main-content .elementor .sr-hero-actions :is(
    .sr-btn-inline,.sr-btn,.elementor-button-wrapper,.elementor-button
  ) {width:100%!important;max-width:100%!important;min-width:0!important;}
  html body .sense-main-content .elementor :is(
    .sr-hero-actions,.sr-cta-side,.sr-packaging-copy
  ) .elementor-button {
    min-height:48px!important;display:flex!important;
    justify-content:center!important;align-items:center!important;
    padding:12px 16px!important;line-height:1.7!important;
  }
  html body .sense-main-content .elementor .sr-cta-side.e-con,
  html body .sense-main-content .elementor .sr-cta-side :is(.sr-cta-btn,.elementor-button-wrapper,.elementor-button) {
    width:100%!important;max-width:100%!important;min-width:0!important;
  }
  /* Keep long headings inside their containers. */
  html body .sense-main-content .elementor .elementor-heading-title {
    max-width:100%;overflow-wrap:break-word;
  }
  html body .sense-main-content .elementor :is(
    .sr-hero-first,.sr-hero-second,.sr-page-title,.sr-cta-title
  ) .elementor-heading-title {font-size:clamp(28px,8vw,43px)!important;line-height:1.5!important;}
  /* Forms: single column with full-width controls and no sideways growth. */
  html body .sense-main-content :is(.field-grid,.form-grid) {
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
  }
  html body .sense-main-content :is(.field,.form-card,.sense-contact-widget,.sr-contact-form) {
    min-width:0!important;max-width:100%!important;
  }
  html body .sense-main-content :is(input,select,textarea) {width:100%;max-width:100%;min-width:0;}
  /* Footer structure and logo are always in the normal flow. */
  html body .site-footer .sr-footer-main.e-con {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:30px!important;
    width:calc(100% - 2 * var(--sr-v84-space))!important;
    padding:36px 0 30px!important;
    margin-inline:auto!important;
  }
  html body .site-footer .sr-footer-main.e-con > .e-con {
    width:100%!important;max-width:100%!important;min-width:0!important;
    grid-column:1!important;grid-row:auto!important;
    height:auto!important;min-height:0!important;
    padding:0!important; margin:0!important;
  }
  html body .site-footer .sr-footer-main .sr-footer-brand.e-con {
    display:flex!important;flex-direction:column!important;
    justify-content:flex-start!important;align-items:flex-start!important;
    gap:0!important;
  }
  html body .site-footer .sr-footer-main :is(
    .sr-footer-logo.elementor-widget,
    .sr-footer-brand > .elementor-widget-image:first-child
  ) {
    width:148px!important;max-width:148px!important;
    height:auto!important;min-height:0!important;max-height:none!important;
    margin:0 0 16px!important;
    padding:0!important;position:static!important;
  }
  html body .site-footer .sr-footer-main :is(
    .sr-footer-logo.elementor-widget,
    .sr-footer-brand > .elementor-widget-image:first-child
  ) img,
  html body .site-footer img[src*="sense-wordmark"] {
    display:block!important;width:100%!important;
    max-width:148px!important;max-height:90px!important;height:auto!important;
    object-fit:contain!important;position:static!important;
    float:none!important;transform:none!important;
  }
  html body .site-footer .sr-footer-main .sr-footer-description {
    margin:0!important;padding:0!important;
    position:static!important;clear:both!important;
    width:100%!important;max-width:100%!important;
  }
  html body .site-footer .sr-footer-main .sr-footer-description p {
    margin:0!important;line-height:2.1!important;
  }
  html body .site-footer .sr-footer-bottom-section.e-con {
    display:flex!important;flex-direction:column!important;
    align-items:stretch!important;gap:10px!important;
    width:calc(100% - 2 * var(--sr-v84-space))!important;
    padding:20px 0!important;margin-inline:auto!important;
  }
  html body .site-footer .sr-footer-bottom-section.e-con > .e-con {
    width:100%!important;min-width:0!important;max-width:100%!important;
    align-items:flex-start!important;
  }
  html body .site-footer .sr-footer-main .sr-footer-links .sr-footer-link,
  html body .site-footer .sr-footer-main .sr-footer-right .sr-footer-link {
    width:100%!important;min-height:0!important;margin:0 0 4px!important;
  }
  html body .site-footer .sr-footer-main .sr-footer-link .elementor-button {
    min-height:40px!important;padding-block:9px!important;
    align-items:center!important;max-width:100%!important;
  }
  html body .site-footer:not(.sr-elementor-site-footer) .footer-top {
    display:flex!important;flex-direction:column!important;gap:28px!important;
  }
  html body .site-footer:not(.sr-elementor-site-footer) .footer-brand img {
    width:148px!important;max-width:148px!important;max-height:90px!important;
    margin:0 0 16px!important;
  }
  html body .site-footer .sr-consult-footer-inner {
    display:flex!important;flex-direction:column!important;
    align-items:stretch!important;gap:12px!important;
  }
  html body .site-footer .sr-consult-button--footer {width:100%!important;}
}
@media (max-width:360px) {
  :root { --sr-v84-space:15px; }
  html body .sense-main-content .elementor :is(
    .sr-hero-first,.sr-hero-second,.sr-page-title,.sr-cta-title
  ) .elementor-heading-title {font-size:clamp(26px,8vw,32px)!important;}
  html body .site-footer .sr-footer-main.e-con {gap:24px!important;}
}
@media (prefers-reduced-motion: reduce) {
  html body .sense-main-content .elementor .elementor-button {transition:none!important;}
}

/* Progressive enhancement fallback: older iOS Safari versions may not support
   :has(). Keep the named Sense Elementor containers responsive regardless. */
@media (min-width:768px) and (max-width:1100px) {
  html body .sense-main-content .elementor :is(
    .sr-statement-section,.sr-process-cards,.sr-service-cards,.sr-values-cards
  ).e-con {
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:var(--sr-v84-grid-gap)!important;
  }
  html body .sense-main-content .elementor :is(
    .sr-statement-section,.sr-process-cards,.sr-service-cards,.sr-values-cards
  ).e-con > .e-con {
    width:100%!important;max-width:100%!important;min-width:0!important;
    flex-basis:auto!important;
  }
}
@media (max-width:767px) {
  html body .sense-main-content .elementor :is(
    .sr-statement-section,.sr-process-cards,.sr-service-cards,.sr-values-cards,
    .sr-section-header,.sr-hero-section,.sr-manifesto-section,.sr-about-show-section,
    .sr-packaging-section,.sr-about-hero-section,.sr-contact-section,.sr-cta-section,
    .sr-hero-actions
  ).e-con {
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    grid-auto-flow:row!important;align-items:stretch!important;
  }
  html body .sense-main-content .elementor :is(
    .sr-statement-section,.sr-process-cards,.sr-service-cards,.sr-values-cards,
    .sr-section-header,.sr-hero-section,.sr-manifesto-section,.sr-about-show-section,
    .sr-packaging-section,.sr-about-hero-section,.sr-contact-section,.sr-cta-section,
    .sr-hero-actions
  ).e-con > .e-con {
    width:100%!important;max-width:100%!important;min-width:0!important;
    flex:0 1 auto!important;grid-column:auto!important;grid-row:auto!important;
  }
}
/* Elementor Grid Containers (distinct from the Flexbox .e-flex containers). */
@media (min-width:768px) and (max-width:1100px) {
  html body .sense-main-content .elementor .e-con.e-grid {
    --grid-columns:2!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}
@media (max-width:767px) {
  html body .sense-main-content .elementor .e-con.e-grid {
    --grid-columns:1!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-auto-flow:row!important;
  }
  html body .sense-main-content .elementor .e-con.e-grid > .e-con {
    width:100%!important;max-width:100%!important;min-width:0!important;
    grid-column:auto!important;grid-row:auto!important;
  }
}
