/* Shared 1440px content system; backgrounds remain full viewport width. */
:root{--mes-site-width:1440px;--mes-gutter:32px}
.mes-container{width:calc(100% - var(--mes-gutter)*2);max-width:var(--mes-site-width);margin-inline:auto}
.mes-container.mes-content{max-width:var(--mes-site-width)}
.alignwide{width:100%;max-width:var(--mes-site-width)}
.mes-main .mes-entry,.mes-header-inner,.mes-navigation,.mes-hero-grid>*,.mes-app-grid>*,.mes-footer-grid>*,.mes-directory-layout>*,.mes-vendor-banner>*{min-width:0}
.mes-header .mes-menu{flex-wrap:wrap;column-gap:clamp(12px,1.5vw,25px);row-gap:0}
.mes-header .mes-menu a,.mes-footer a,.mes-home h1,.mes-home h2,.mes-directory h1{overflow-wrap:anywhere}
.mes-main .rbx,.mes-main .rbmv{width:100%;max-width:100%;margin-inline:0}
.mes-main .rbx .rbmv{padding:0;margin:0;border-radius:0;background:transparent}
.mes-main .rbx-sidebar,.mes-main .rbmv-panel,.mes-main .rbmv-registration>*,.mes-main .rbx-content,.mes-main .rbx-grid>*,.mes-main .rbmv-grid>*{min-width:0}
.mes-main .rbx-title,.mes-main .rbmv-toolbar{flex-wrap:wrap}
.mes-main .rbx-sidebar>strong{overflow-wrap:anywhere}
.mes-main .rbx img,.mes-main .rbmv img{max-width:100%}
.mes-main input:not([type=checkbox]):not([type=radio]),.mes-main select,.mes-main textarea{max-width:100%;min-width:0}
.mes-main .woocommerce form .form-row input.input-text,.mes-main .woocommerce form .form-row textarea{width:100%;min-height:44px}
.mes-main .woocommerce .woocommerce-MyAccount-content{min-width:0}
.mes-main .rbx-panel figure{max-width:100%;margin-inline:0}
@media(max-width:1100px){
 :root{--mes-gutter:24px}
 /* .mes-menu switches to column at 1100px in comman.css */
 .mes-header .mes-navigation{max-width:100%}
 .mes-vendor-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .mes-main .rbx-layout{grid-template-columns:190px minmax(0,1fr);gap:18px}
 .mes-main .rbx-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:800px){
 .mes-main .rbx-layout{grid-template-columns:minmax(0,1fr)}
 .mes-main .rbx-sidebar nav{display:flex;max-width:100%;overflow-x:auto;gap:6px;padding-bottom:8px;overscroll-behavior-inline:contain}
 .mes-main .rbx-sidebar .rbx-nav{flex:0 0 auto;white-space:nowrap;min-height:44px}
 .mes-main .rbmv-registration{grid-template-columns:minmax(0,1fr)}
 .mes-main .rbx-grid,.mes-main .rbmv-grid{grid-template-columns:minmax(0,1fr)}
 .mes-main .woocommerce .col2-set .col-1,.mes-main .woocommerce .col2-set .col-2,.mes-main .woocommerce .woocommerce-MyAccount-navigation,.mes-main .woocommerce .woocommerce-MyAccount-content{float:none;width:100%;margin-bottom:24px}
 .mes-results-heading{flex-wrap:wrap}.mes-result-range{text-align:left}
}
@media(max-width:600px){
 :root{--mes-gutter:16px}
 .mes-main{padding-block:28px}
 .mes-hero-grid{gap:28px}.mes-hero-photo{height:auto;aspect-ratio:4/3}
 .mes-home-search{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding:10px}
 .mes-home-search>span{display:none}.mes-home-search input{width:100%;height:44px;padding-inline:8px}.mes-home-search button{width:100%}
 .mes-vendor-grid,.mes-directory-cards{grid-template-columns:minmax(0,1fr)}
 .mes-hero-float{left:10px;right:10px;padding:12px;gap:10px}
 .mes-hero-float>div{min-width:0}
 .mes-coming-soon{flex-wrap:wrap;gap:8px;max-width:100%}.mes-coming-soon span{border:0;padding-left:0}
 .mes-vendor-banner-copy{padding:26px 20px}
 .mes-main .rbx,.mes-main .rbmv{padding:16px;margin-block:16px;border-radius:10px}
 .mes-main .rbx-panel,.mes-main .rbmv-panel{padding:16px}
 .mes-main .rbx-cards,.mes-main .rbx-search{grid-template-columns:minmax(0,1fr)}
 .mes-main .rbx-field input,.mes-main .rbx-field select,.mes-main .rbx-field textarea,.mes-main .rbmv-field input,.mes-main .rbmv-field select,.mes-main .rbmv-field textarea,.mes-home-search input,.mes-filter-box input,.mes-filter-box select,.mes-main .woocommerce input,.mes-main .woocommerce select{font-size:16px}
 .mes-main .rbx-calendar{gap:2px}.mes-main .rbx-calendar>div{padding:6px 2px;min-height:60px}.mes-main .rbx-calendar small{font-size:9px;overflow-wrap:anywhere}
 .mes-main .rbx-button,.mes-main .rbmv-button{max-width:100%;white-space:normal;min-height:44px}
 .mes-main .rbmv-heading{flex-wrap:wrap;gap:12px}
}
@media(max-width:380px){
 .mes-header .mes-logo-image{max-width:150px}.mes-header .mes-wordmark{font-size:23px}.mes-header .mes-menu-toggle{padding:10px}
 .mes-category-image img{height:150px}.mes-city img{height:200px}
 .mes-app-visual{min-height:440px}.mes-phone{max-width:100%;transform:translateY(25px);padding-inline:12px}
 .mes-footer-grid{grid-template-columns:minmax(0,1fr)}.mes-footer-about,.mes-footer-contact{grid-column:auto}
 .mes-main .rbx,.mes-main .rbmv{padding:12px}.mes-main .rbx-panel,.mes-main .rbmv-panel{padding:12px}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.mes-header *,.mes-main *{scroll-behavior:auto}}

/* ==========================================================================
   Section & Page Responsive Fixes (Layout, Spacing & Overflow Only)
   ========================================================================== */

/* ── Desktop & Sub-Page Header Clearance ── */
/* Ensure floating pill header never overlaps standard pages, WooCommerce account, 404, or Vendor Directory */
.mes-main {
  padding-top: 130px;
}
.mes-directory-hero {
  padding-top: 130px;
}
/* Balance desktop Hero vertical padding on 1280x720 / 1366x768 laptops */
.mes-hero {
  padding: clamp(130px, 13vw, 185px) 0 clamp(72px, 8vw, 130px);
}

/* ── Desktop/Laptop Edge Arrow Containment (<= 1260px) ── */
@media (max-width: 1260px) {
  /* Keep carousel navigation arrows inside the viewport on medium screens */
  .mes-vendor-nav-btn.mes-vendor-prev,
  .mes-happy-nav-btn.mes-happy-prev {
    left: 4px;
  }
  .mes-vendor-nav-btn.mes-vendor-next,
  .mes-happy-nav-btn.mes-happy-next {
    right: 4px;
  }
}

/* ── Categories Carousel Track (<= 1240px) ── */
@media (max-width: 1240px) {
  /* Handled by Swiper flex track in categories-section.css */
  .mes-cat-swiper {
    padding: 30px 6px 32px !important;
  }
}

/* ── Tablet & Small Laptop (<= 1100px) ── */
@media (max-width: 1100px) {
  /* Remove double horizontal padding on Hero grid container */
  .mes-hero-grid {
    padding-inline: 0;
  }
  .mes-hero {
    padding: 130px 0 80px;
    min-height: auto;
  }
  /* Keep How It Works connecting arrows inside the 40px gap */
  .mes-how-flow {
    gap: 40px;
  }
  .mes-how-arrow {
    right: -42px;
    width: 44px;
  }
}

/* ── Hero Banner Readability & Tablet Layout (<= 860px) ── */
@media (max-width: 860px) {
  /* Use ID selector (#mes-hero) to beat inline ACF <style> specificity in hero-section.php */
  #mes-hero.has-bg-image {
    background-position: center top !important;
    background-size: cover !important;
  }
  #mes-hero.has-bg-image .mes-hero-overlay {
    inset: 0 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    filter: none !important;
    opacity: 1 !important;
    background: linear-gradient(
      180deg,
      rgba(253, 248, 241, 0.92) 0%,
      rgba(253, 248, 241, 0.84) 65%,
      rgba(253, 248, 241, 0.72) 100%
    ) !important;
  }
  /* Remove blurred white blob when no bg image is set so text contrast stays clean */
  #mes-hero:not(.has-bg-image) .mes-hero-overlay {
    display: none;
  }
  .mes-hero-description {
    color: #3d4856;
  }
}

/* ── Blog & Account Tablet Adjustments (<= 1000px) ── */
@media (max-width: 1000px) {
  /* Prevent narrow text column / image shrinking on tablet blog layout */
  .mb-feature {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }
  .mb-popular img {
    flex-shrink: 0;
  }
}

/* ── Categories & Account Tablet Adjustments (<= 900px) ── */
@media (max-width: 900px) {
  /* Keep Categories vertical padding proportional on tablet */
  .mes-categories-wrap {
    padding: 48px 0 54px;
  }
  .mes-cat-prev {
    left: 4px;
  }
  .mes-cat-next {
    right: 4px;
  }
  /* Reduce excessive story panel height on tablet login page */
  .mes-auth-story {
    min-height: 520px;
  }
}

/* ── App Download Tablet Grid (<= 850px) ── */
@media (max-width: 850px) {
  .mes-app-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 24px;
  }
}

/* ── Vendor Directory Tablet Filter Inputs (<= 800px) ── */
@media (max-width: 800px) {
  /* Prevent iOS Safari zoom on 601px-800px tablets when focusing filter controls */
  .mes-filter-box input,
  .mes-filter-box select {
    font-size: 16px;
  }
}

/* ── Happy Customers & Blog Mobile (<= 680px) ── */
@media (max-width: 680px) {
  /* Single full testimonial card on mobile with clean shadow & no corner overlap */
  .mes-happy-swiper {
    padding: 20px 14px 30px !important;
  }
  .mes-happy-swiper .mes-happy-card,
  .mes-happy-swiper .swiper-slide-active .mes-happy-card {
    transform: none;
    box-shadow: 0 6px 18px rgba(7, 21, 43, 0.08);
  }
  .mes-happy-swiper .mes-happy-card.is-highlighted::after,
  .mes-happy-swiper .swiper-slide-active .mes-happy-card::after {
    width: 22%;
    height: 22%;
  }
  .mes-happy-swiper .mes-card-author {
    padding-right: 44px;
  }
}

@media (max-width: 650px) {
  /* Align blog body width with shared .mes-container gutter */
  .mb-body {
    width: calc(100% - var(--mes-gutter) * 2);
  }
  /* Prevent iOS Safari input zoom in blog search & subscribe inputs */
  .mb-search input {
    font-size: 16px;
  }
  /* Prevent bookmark icon from overlapping card titles and enlarge tap area */
  .mb-card h3 {
    padding-right: 36px;
  }
  .mb-bookmark {
    min-width: 36px;
    min-height: 36px;
  }
}

/* ── About & Featured Vendors Mobile (<= 640px) ── */
@media (max-width: 640px) {
  /* Remove left indent when highlighted title wraps onto its own line */
  .mes-about-title-highlight {
    margin-left: 0;
  }
  /* Improve touch target size for vendor wishlist button */
  .mes-vcard-wishlist {
    width: 38px;
    height: 38px;
  }
}

/* ── Mobile Breakpoint (<= 600px) ── */
@media (max-width: 600px) {
  /* Ensure floating pill header never overlaps sub-pages, Vendor Directory, or Hero */
  .mes-main {
    padding-top: 106px;
  }
  .mes-directory-hero {
    padding-top: 106px;
  }
  .mes-hero {
    padding: 116px 0 44px;
    min-height: auto;
  }
  /* Balance Hero typography & search bar on mobile */
  .mes-hero .mes-eyebrow {
    font-size: 11px;
    letter-spacing: 2px;
    margin-bottom: 10px;
  }
  .mes-hero-heading {
    font-size: clamp(28px, 7.5vw, 38px);
    line-height: 1.18;
    letter-spacing: -0.8px;
  }
  .mes-hero-description {
    font-size: 14px;
    line-height: 1.65;
    margin: 14px 0 20px;
  }
  .mes-search-field:first-of-type {
    border-bottom: 1px solid #e0d5c0;
    padding-bottom: 4px;
  }
  .mes-search-btn {
    height: 46px;
  }
  .mes-hero-cursive {
    right: 8px;
  }
  /* Balance section headings & micro-copy on mobile */
  .mes-about-title {
    font-size: clamp(26px, 6.5vw, 34px);
  }
  .mes-about-eyebrow {
    font-size: 11px;
    letter-spacing: 2px;
  }
  .mes-cat-main-title {
    font-size: clamp(26px, 7vw, 34px);
  }
  .mes-cat-count {
    font-size: 12px;
    color: #6e5835;
  }
  .mes-featured-title {
    font-size: clamp(24px, 6.5vw, 30px);
  }
  .mes-vcard-count,
  .mes-vcard-pill {
    font-size: 11px;
  }
  .mes-vendor-cta-title {
    font-size: clamp(26px, 7vw, 34px) !important;
  }
  .mes-vendor-cta-subheading {
    font-size: 15px !important;
  }
  .mes-happy-title {
    font-size: clamp(24px, 6.5vw, 30px);
  }
  .mes-card-location {
    font-size: 12.5px;
    color: #475467;
  }
  /* Mobile categories center-mode Swiper */
  .mes-cat-swiper {
    padding: 26px 0 28px !important;
  }
  /* Balance App Download typography and prevent rotated phone overflow */
  .mes-app-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .mes-app-copy h2 {
    font-size: clamp(26px, 7vw, 36px);
  }
  .mes-app-copy .mes-app-note {
    font-size: 12px !important;
    color: #cbd5e1;
  }
  .mes-phone-concept {
    font-size: 10px;
  }
  .mes-phone {
    width: min(285px, calc(100% - 24px));
    transform: rotate(3deg) translateY(20px);
  }
  /* Improve readability of small card meta/badge text in Vendor Directory & Blog */
  .mes-directory-card-image > span {
    font-size: 10px;
    color: #0b1726;
  }
  .mes-directory-card-description {
    font-size: 13px;
    color: #475467;
  }
  .mes-directory-card-placeholder {
    font-size: 11px;
    color: #5b6573;
  }
  .mb-meta {
    font-size: 12.5px;
    color: #475467;
  }
  .mb-consent {
    font-size: 12px;
  }
}

/* ── Small Mobile Breakpoint (<= 500px) ── */
@media (max-width: 500px) {
  /* Stack Vendor Directory submit & reset controls cleanly */
  .mes-filter-box form {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  /* Switch Blog grid from cramped 2-col to 1-col on small phones */
  .mb-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}

/* ── Extra Small Screens (<= 380px) ── */
@media (max-width: 380px) {
  /* Keep logo and toggle button compact inside mobile pill header */
  .mes-header .mes-logo-image {
    max-width: 120px;
    max-height: 34px;
  }
  .mes-header .mes-menu-toggle {
    padding: 7px 12px;
  }
  .mes-hero-stats li {
    min-width: 0;
  }
  .mes-auth-panel h2 {
    font-size: 26px;
  }
  .mes-phone {
    transform: rotate(0deg) translateY(16px);
  }
}
