/* ===== EverDemand Mobile Optimization (iPhone 12 Pro first) ===== */
/* prevent horizontal scroll without breaking the sticky header (clip, not hidden) */
html{overflow-x:clip;}
body{overflow-x:clip;max-width:100%;}
img,svg,video,iframe,table{max-width:100%;}
img{height:auto;}
*{-webkit-tap-highlight-color:rgba(226,86,47,.18);}

/* the mobile drawer is an <aside>; override the theme's blanket "aside{display:none!important}" rule */
aside.ed-drawer{display:flex!important;}
@media(min-width:981px){aside.ed-drawer,.ed-overlay{display:none!important;}}

/* ===== bottom thumb-nav (sticky cart) ===== */
.edm-nav{display:none;}
@media(max-width:980px){
  .edm-nav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:9350;background:rgba(255,255,255,.97);backdrop-filter:saturate(160%) blur(12px);border-top:1px solid var(--ed-line);box-shadow:0 -6px 22px rgba(20,22,28,.08);padding-bottom:env(safe-area-inset-bottom);}
  .edm-nav__i{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:56px;padding:8px 2px;background:transparent;border:0;cursor:pointer;color:var(--ed-ink-2);text-decoration:none;font-family:var(--ed-font);position:relative;}
  .edm-nav__i svg{width:23px;height:23px;}
  .edm-nav__i span:not(.edm-badge){font-size:10.5px;font-weight:600;letter-spacing:.01em;}
  .edm-nav__i.is-active{color:var(--ed-accent);}
  .edm-nav__i.is-active::before{content:"";position:absolute;top:0;left:50%;transform:translateX(-50%);width:26px;height:3px;border-radius:0 0 3px 3px;background:var(--ed-accent);}
  .edm-badge{position:absolute;top:4px;right:calc(50% - 22px);min-width:17px;height:17px;padding:0 4px;border-radius:999px;background:var(--ed-accent);color:#fff;font-size:10px;font-weight:800;line-height:17px;text-align:center;box-shadow:0 0 0 2px #fff;transform:scale(0);transition:transform .2s;}
  .edm-badge.is-on{transform:scale(1);}
  .ed-wish-count.edm-badge{background:var(--ed-ink);}
  /* reserve space so content/footer isn't hidden behind the nav */
  body:not(.single-product){padding-bottom:calc(60px + env(safe-area-inset-bottom));}
  .single-product .edm-nav{display:none;}
}

/* ===== iPhone 12 Pro (<=430px) layout & tap targets ===== */
@media(max-width:600px){
  /* large tap targets (Apple HIG 44px min) */
  .ed-util,.ed-burger{min-width:44px;min-height:44px;}
  .ed-nav__link,.edh-btn,.edh-btn--hero,.edp-buynow,.edrev-chip,.edrev-write-btn,.edrev-ask-btn,.edpg-card,.edm-nav__i,.edx__form button,.edx__cta{min-height:44px;}
  .woocommerce .single_add_to_cart_button,.woocommerce a.button,.woocommerce button.button,.edrev-helpful,.edpg-acc>summary{min-height:46px;}
  a,button,summary,select,input,.edp-tier,.edp-sw{touch-action:manipulation;}

  /* tighter section rhythm */
  .edh-sec,.edp-sec,.edt--sec,.edrev.edp-sec{padding:42px 0;}
  .edh-wrap,.edp-wrap,.edt__wrap{padding-left:18px;padding-right:18px;}
  .edpg-body{padding:30px 18px 40px;}
  .edpg-hero__in{padding:40px 18px 36px;}

  /* headings scale down */
  .edh-title,.edp-h2,.edt__title,.edrev .edp-h2{font-size:24px;}

  /* perfect image scaling in product gallery */
  .single-product .woocommerce-product-gallery__image img{width:100%!important;height:auto!important;border-radius:14px!important;}
  .single-product .woocommerce-product-gallery{width:100%!important;}

  /* touch-friendly swatches */
  .edp-sw__dot{width:42px;height:42px;}
  .edp-sw--color.is-active .edp-sw__dot{box-shadow:inset 0 0 0 1px rgba(0,0,0,.14),0 0 0 2px #fff,0 0 0 4px var(--ed-accent);}
  .edp-sw--size{min-width:56px;height:54px;font-size:16px;}
  .edp-sw__imgwrap{width:78px;height:78px;}
  .edp-swatches{gap:12px;}

  /* bundle tiers comfy on small screens */
  .edp-tier{padding:14px 15px;gap:11px;}
  .edp-tier__now{font-size:19px;}

  /* homepage feature grids stack */
  .edh-cats__grid,.edh-why__grid,.edh-coll__grid{grid-template-columns:1fr!important;}
  .edh-pgrid{grid-template-columns:repeat(2,1fr)!important;gap:12px!important;}
  /* WooCommerce product grids: clean 2-col grid (overrides Astra float/columns) */
  .woocommerce ul.products,.woocommerce-page ul.products{display:grid!important;grid-template-columns:repeat(2,1fr)!important;gap:14px!important;margin:0 0 18px!important;}
  .woocommerce ul.products li.product,.woocommerce-page ul.products li.product{width:auto!important;max-width:100%!important;float:none!important;clear:none!important;margin:0!important;}
  .woocommerce ul.products li.product .woocommerce-loop-product__title{font-size:13px!important;padding:0 12px 2px!important;}
  .woocommerce ul.products li.product .price{padding:0 12px!important;font-size:15px!important;}
  .woocommerce ul.products li.product .star-rating{margin:6px 12px 0!important;}
  .woocommerce ul.products li.product .button,.woocommerce ul.products li.product .added_to_cart,.woocommerce ul.products li.product .add_to_cart_button{display:inline-block;max-width:calc(100% - 24px);white-space:normal;margin:10px 12px 0!important;font-size:12px!important;padding:10px 12px!important;}
  .woocommerce ul.products li.product a img{width:100%!important;height:auto!important;}

  /* product summary buttons full width & easy to hit */
  .single-product .summary .single_add_to_cart_button,.edp-buynow,.edp-express{width:100%!important;flex:1 1 100%!important;}
  .single-product .summary .quantity{width:100%;}

  /* search overlay input comfy */
  .ed-search__input{font-size:20px;}

  /* exit popup fits 390px */
  .edx__panel{width:calc(100vw - 24px);}
  .edx__title{font-size:24px;}

  /* testimonials & cross-sell rows snap nicely */
  .edt-card{flex-basis:276px;max-width:276px;}

  /* prevent any wide tables/iframes from overflowing */
  .edpg-body table,.edpg-body iframe{display:block;overflow-x:auto;}
}

/* keep product floating bar above the home-indicator safe area */
@media(max-width:880px){
  .edp-mobilebar{padding-bottom:calc(10px + env(safe-area-inset-bottom));}
  body.single-product{padding-bottom:calc(78px + env(safe-area-inset-bottom));}
}

/* footer: clean stacked layout, no right-side overflow */
@media(max-width:680px){
  .ed-foot__top{grid-template-columns:1fr 1fr!important;gap:26px 16px!important;padding:44px 20px 30px!important;max-width:100%!important;}
  .ed-foot__brand{grid-column:1 / -1!important;}
  .ed-foot__brand p{max-width:none;}
  .ed-foot__col h4{margin-bottom:12px;}
  .ed-foot__col ul{gap:9px;}
  .ed-foot__bottom-in{flex-direction:column;align-items:center;text-align:center;gap:14px;padding:20px;}
  .ed-foot__pay{justify-content:center;flex-wrap:wrap;}
}
@media(max-width:380px){
  .ed-foot__top{grid-template-columns:1fr!important;}
}

/* lighten heavy effects on phones for speed */
@media(max-width:600px){
  .edh-hero::before,.edh-hero::after,.edh-hero__media::before{filter:none!important;}
  .edp-mobilebar,.edm-nav{will-change:transform;}
}
