/* Demit Gold 2.20 — one mobile storefront layer, not a change to the simple Products navigation.
   Targets only catalog archive / mobile header and WooCommerce cards. */
.dg220-categories,.dg220-mobile-product-cta,.dg220-stock-label,.dg220-no-price{display:none}

@media (max-width:899px){
  /* Match the hamburger with the cream featured-category bar (no white tile/patch). */
  html body #site-header.dg313-header .dg313-featured,
  html body #site-header.dg313-header .dg313-featured-inner,
  html body #site-header.dg313-header .dg214-navslot{
    background-color:#fffaf4!important;
    background-image:none!important;
    box-shadow:none!important;
  }
  html body #site-header.dg313-header .dg214-navslot{
    min-height:100%!important;padding:0 3px!important;gap:4px!important;
    border:0!important;border-radius:0!important;
  }
  html body #site-header.dg313-header .dg214-hamburger{
    background:#fffaf4!important;background-image:none!important;
    border:1px solid #e5d9c8!important;border-radius:10px!important;
    box-shadow:none!important;color:#144939!important;
    -webkit-tap-highlight-color:transparent;
  }
  html body #site-header.dg313-header .dg214-hamburger:is(:hover,:focus-visible,[aria-expanded="true"]){
    background:#f3ecdf!important;border-color:#bd9655!important;
  }
  html body #site-header.dg313-header .dg214-navslot::before,
  html body #site-header.dg313-header .dg214-navslot::after{content:none!important;display:none!important}
}
/* The product subtree in the existing mobile drawer is deliberately unchanged. */
@media(max-width:760px){
  :root{--dg220-green:#103f32;--dg220-cream:#fffaf4;--dg220-gold:#ba8e50}
  html body .dg-catalog-shell,
  html body.woocommerce-page .dg-catalog-shell,
  html body.woocommerce-page .demit-shop-shell.dg-catalog-shell{
    width:calc(100% - 20px)!important;max-width:none!important;
    padding:12px 0 64px!important;margin-inline:10px!important;
    transform:none!important;filter:none!important;contain:none!important;isolation:auto!important;
  }
  html body .dg-catalog-shell .demit-archive-heading{
    background:linear-gradient(125deg,#faf5eb,#fffdf9)!important;
    padding:16px 16px 14px!important;margin:5px 0 14px!important;
    border:1px solid #efe5d7!important;border-radius:16px!important;
    text-align:right!important;
  }
  html body .dg-catalog-shell .demit-archive-heading h1{
    font-size:clamp(20px,5.5vw,25px)!important;line-height:1.55!important;
    margin:3px 0 2px!important;color:#113e32!important;
  }
  html body .dg-catalog-shell .demit-archive-intro p{
    font-size:12px!important;line-height:1.7!important;margin:0!important;
    color:#657b6e!important;
  }
  html body .dg-catalog-shell .demit-eyebrow{font-size:9px!important}
  html body .dg-catalog-shell .dg-catalog-layout{display:block!important;min-width:0!important}
  html body .dg-catalog-shell .dg-catalog-results{min-width:0!important;position:relative!important;z-index:auto!important}
  /* Swipeable categories are honest links to real WooCommerce terms, not dummy tiles. */
  .dg220-categories{display:flex;direction:rtl;align-items:center;gap:8px;
    padding:2px 2px 11px;margin:0 0 8px;overflow-x:auto;overscroll-behavior-inline:contain;
    -webkit-overflow-scrolling:touch;scrollbar-width:none;scroll-snap-type:x proximity}
  .dg220-categories::-webkit-scrollbar{display:none}
  .dg220-categories a{display:inline-flex;flex:0 0 auto;min-height:39px;align-items:center;justify-content:center;
    padding:8px 13px;scroll-snap-align:start;text-decoration:none!important;white-space:nowrap;
    font-size:12px;font-weight:650;color:#254d3e;background:#fffcf7;border:1px solid #e9ddcb;
    border-radius:999px;transition:background .16s,border-color .16s}
  .dg220-categories a[aria-current="page"]{background:#164a3a;color:#fff!important;border-color:#164a3a}
  /* Prominent filter / sort controls: the first actionable controls above the cards. */
  html body .dg-catalog-shell .dg220-catalog-toolbar,
  html body .dg-catalog-shell .dg218-catalog-toolbar{
    display:grid!important;grid-template-columns:1fr 1fr!important;gap:9px!important;
    align-items:stretch!important;margin:0 0 12px!important;padding:0 0 13px!important;
    border-bottom:1px solid #eadfce!important;background:transparent!important;
  }
  html body .dg-catalog-shell .dg220-catalog-toolbar .dg-catalog-toolbar-main,
  html body .dg-catalog-shell .dg218-catalog-toolbar .dg-catalog-toolbar-main{
    min-width:0!important;width:100%!important;display:block!important;flex:none!important;
  }
  html body .dg-catalog-shell .dg220-catalog-toolbar .dg-filter-open,
  html body .dg-catalog-shell .dg218-catalog-toolbar .dg-filter-open{
    display:flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;
    width:100%!important;min-width:0!important;min-height:46px!important;height:46px!important;
    border:1px solid #164c3a!important;background:#174a3b!important;color:#fff!important;
    padding:0 10px!important;border-radius:12px!important;font-size:13px!important;font-weight:700!important;
    box-shadow:0 3px 8px #174a3b19!important;white-space:nowrap;
  }
  .dg220-filter-count{display:inline-grid;place-items:center;width:20px;height:20px;
    border-radius:50%;background:#dec393;color:#113d30;font-size:11px;font-weight:750}
  html body .dg-catalog-shell .dg220-catalog-toolbar .dg-catalog-sort,
  html body .dg-catalog-shell .dg218-catalog-toolbar .dg-catalog-sort{
    display:flex!important;min-width:0!important;width:100%!important;height:46px!important;
    margin:0!important;gap:0!important;padding:0!important;position:relative!important;flex:none!important;
  }
  html body .dg-catalog-shell .dg-catalog-sort label{display:none!important}
  html body .dg-catalog-shell .dg-catalog-sort .dg-catalog-sort-select{
    appearance:none!important;-webkit-appearance:none!important;width:100%!important;
    max-width:none!important;min-width:0!important;height:46px!important;
    border:1px solid #ddcfbb!important;background:#fffdf8!important;
    padding:6px 30px 6px 10px!important;border-radius:12px!important;color:#214736!important;
    font-size:12px!important;font-weight:650!important;text-align:right!important;
  }
  html body .dg-catalog-shell .dg-catalog-sort::after{
    content:'⌄';position:absolute;right:11px;top:50%;transform:translateY(-55%);
    font-size:18px;color:#94703a;pointer-events:none;
  }
  /* Sorting submits on change (catalog-v14.js). Avoid a redundant third cramped button. */
  html body .dg-catalog-shell .dg-catalog-sort-submit{
    display:inline-flex!important;align-items:center;justify-content:center;
    flex:0 0 38px;min-width:38px!important;height:46px!important;
    padding:0 5px!important;font-size:10px!important;margin-right:5px!important;
    border-radius:11px!important;
  }
  html body.dg220-js-catalog .dg-catalog-shell .dg-catalog-sort-submit{display:none!important}
  html body .dg-catalog-shell .dg-catalog-count{display:none!important}
  /* 2-column sales cards; larger visual, consistent product names/prices, one clear tap target. */
  html body.woocommerce .dg-catalog-results ul.products,
  html body .dg-catalog-results ul.products{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    column-gap:9px!important;row-gap:12px!important;padding:0!important;margin:0!important;
  }
  html body.woocommerce .dg-catalog-results ul.products>li.product,
  html body .dg-catalog-results ul.products>li.product{
    box-sizing:border-box!important;display:flex!important;flex-direction:column!important;
    width:100%!important;min-width:0!important;float:none!important;margin:0!important;
    padding:0 0 10px!important;background:#fffefa!important;border:1px solid #e9dfd1!important;
    border-radius:15px!important;box-shadow:0 4px 13px #243e2c0b!important;
    overflow:hidden!important;transform:none!important;
  }
  html body.woocommerce .dg-catalog-results ul.products>li.product:hover,
  html body .dg-catalog-results ul.products>li.product:hover{transform:none!important}
  html body .dg-catalog-results ul.products>li.product .woocommerce-LoopProduct-link,
  html body .dg-catalog-results ul.products>li.product .woocommerce-loop-product__link{
    display:block!important;flex:1 1 auto!important;text-decoration:none!important;min-width:0!important;
  }
  html body .dg-catalog-results ul.products>li.product .woocommerce-loop-product__link>img,
  html body .dg-catalog-results ul.products>li.product .attachment-woocommerce_thumbnail{
    display:block!important;width:100%!important;height:auto!important;
    aspect-ratio:1/1.05!important;object-fit:contain!important;background:#faf7f1!important;
    margin:0 0 7px!important;border-radius:0!important;
  }
  html body .dg-catalog-results ul.products>li.product .woocommerce-loop-product__title{
    display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important;
    overflow:hidden!important;font-size:13px!important;line-height:1.65!important;
    font-weight:700!important;min-height:42px!important;max-height:44px!important;
    padding:0 10px!important;margin:3px 0 6px!important;color:#173e32!important;
  }
  html body .dg-catalog-results ul.products>li.product .price{
    display:block!important;color:#977139!important;font-size:clamp(11px,3vw,13px)!important;
    font-weight:700!important;line-height:1.7!important;text-align:right!important;
    padding:0 10px!important;margin:0 0 8px!important;
    overflow-wrap:anywhere!important;
  }
  html body .dg-catalog-results ul.products>li.product .dg220-no-price{
    display:block!important;color:#8e7c5e!important;font-size:11px!important;
    margin:0 10px 8px!important;line-height:1.7;
  }
  html body .dg-catalog-results ul.products>li.product .dg220-stock-label{
    display:inline-flex!important;position:absolute;left:8px;top:8px;z-index:7;background:#6b6356;color:#fff;
    border-radius:999px;font-size:10px;padding:4px 8px;
  }
  html body .dg-catalog-results ul.products>li.product .star-rating{margin:4px 10px!important}
  html body .dg-catalog-results ul.products>li.product .button:not(.dg220-mobile-product-cta){display:none!important}
  html body .dg-catalog-results ul.products>li.product .dg220-mobile-product-cta{
    display:flex!important;align-items:center!important;justify-content:center!important;
    width:calc(100% - 20px)!important;box-sizing:border-box!important;
    min-height:43px!important;margin:auto 10px 0!important;padding:10px 6px!important;
    background:#144a39!important;color:#fff!important;border:1px solid #144a39!important;
    text-decoration:none!important;border-radius:10px!important;font-weight:700!important;
    font-size:12px!important;line-height:1.4!important;text-align:center!important;
  }
  html body .dg-catalog-results ul.products>li.product .dg220-mobile-product-cta:focus-visible{
    outline:3px solid #c99d5e;outline-offset:2px;
  }
  /* WooCommerce native sale icon stays above the image but never clips content. */
  html body .dg-catalog-results ul.products>li.product .onsale{
    right:8px!important;left:auto!important;top:8px!important;font-size:10px!important;
    padding:4px 7px!important;z-index:8!important;
  }
  html body .dg-catalog-shell .dg-catalog-pagination{margin-top:23px!important}
  html body .dg-catalog-shell .dg-catalog-empty{padding:35px 17px!important}
}
/* Portal: the filter sheet becomes a direct body child on mobile, escaping transforms/sticky stacking contexts. */
@media(max-width:760px){
  body > #dg-filter-sidebar.dg-filter-sidebar{
    position:fixed!important;inset:0 auto 0 0!important;right:0!important;left:auto!important;
    width:min(91vw,390px)!important;max-width:390px!important;max-height:100dvh!important;
    height:100dvh!important;overflow-y:auto!important;overscroll-behavior:contain!important;
    display:block!important;z-index:120002!important;background:#fffefa!important;
    border-radius:0!important;box-shadow:-14px 0 60px #06281f48!important;
    transform:translateX(106%)!important;transition:transform .24s cubic-bezier(.2,.8,.2,1)!important;
    visibility:hidden!important;pointer-events:none!important;padding:18px 15px 25px!important;
  }
  body > #dg-filter-sidebar.dg-filter-sidebar.dg-filter-visible{
    transform:translateX(0)!important;visibility:visible!important;pointer-events:auto!important;
  }
  body > .dg-filter-backdrop:not([hidden]){
    position:fixed!important;inset:0!important;display:block!important;z-index:120001!important;
    background:rgba(5,28,21,.62)!important;backdrop-filter:blur(2px);
  }
  body > #dg-filter-sidebar .dg-filter-close{
    display:flex!important;align-items:center;justify-content:center;
    width:36px;height:36px;border:1px solid #e4d7c4;border-radius:50%;
    background:#fff6e7;color:#163f32;font-size:26px;cursor:pointer;
  }
  body > #dg-filter-sidebar .dg-filter-top{
    position:sticky!important;top:-18px!important;z-index:4;
    background:#fffefa!important;padding:13px 0!important;
  }
  body.dg-filter-locked{overflow:hidden!important;touch-action:auto}
}
@media(prefers-reduced-motion:reduce){
  body > #dg-filter-sidebar.dg-filter-sidebar,
  html body .dg220-categories a{transition:none!important}
}
