/* Sunderland Home Grown redesign: shop.
   Generated by scripts/build-duda.mjs from the files in duda/. Edit those, not this file. */
/* =====================================================================
   SUNDERLAND HOME GROWN REDESIGN: SHOP (Duda / Ecwid store)
   Where: Developer Mode > CSS > "ADD CUSTOM CSS TO THE PAGE - THIS AFFECTS ALL DEVICES"
   How:   paste at the very END of that panel, after file 3 (it uses file 3's colours).

   Styles the store on /store and its product pages to match the redesign:
   plain photos with rounded corners, forest-green titles and prices,
   gold buttons, a berry "Sold out" label and matching form fields.
   Also worth setting in the store's own Design settings (no code): font
   "Atkinson Hyperlegible" if listed, and button colour #E9B82B.
   ===================================================================== */

/* ---------- Type and colour ---------- */
html body #dm .ec-store,
html body #dm .ec-store .ec-size {
  font-family: var(--shg-font) !important;
  color: var(--shg-ink) !important;
}
html body #dm .ec-store :is(h1, h2, h3, .ec-header-h1, .ec-header-h2, .ec-header-h3, .product-details__product-title) {
  font-family: var(--shg-font) !important;
  color: var(--shg-forest) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}
html body #dm .ec-store .ec-link {
  color: var(--shg-forest) !important;
  text-decoration: underline !important;
  text-decoration-color: var(--shg-leaf) !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 4px;
}
html body #dm .ec-store .ec-link--muted,
html body #dm .ec-store .ec-text-muted { color: var(--shg-soft) !important; }

/* ---------- Product and category cards ---------- */
/* Plain photos with softly rounded corners (no leaf shape in the shop) */
html body #dm .ec-store :is(.grid-product__image, .grid-category__image) {
  overflow: hidden !important;
  border-radius: 8px !important;
}
html body #dm .ec-store :is(.grid-product__bg, .grid-product__picture, .grid-category__bg, .grid-category__picture-img) {
  border-radius: inherit !important;
}
/* No grey frames or drop shadows behind cards */
html body #dm .ec-store :is(.grid-category__card, .grid-category__wrap-inner, .grid-category__shadow, .grid-category__image-wrap, .grid-product__wrap-inner) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}
html body #dm .ec-store :is(.grid-product--has-shadow, .grid-category--has-shadow) :is(.grid-product__image, .grid-category__image) {
  box-shadow: none !important;
}

/* Category titles keep the store's own colour (they often sit on top of the photo) */
html body #dm .ec-store :is(.grid-category__title, .grid-category__title-inner) {
  font-family: var(--shg-font) !important;
  font-weight: 700 !important;
}
html body #dm .ec-store .grid-product__title,
html body #dm .ec-store .grid-product__title-inner {
  font-family: var(--shg-font) !important;
  color: var(--shg-forest) !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
}
html body #dm .ec-store :is(.grid-product__price, .grid-product__price-value, .details-product-price__value, .ec-price-item) {
  font-family: var(--shg-font) !important;
  color: var(--shg-forest) !important;
  font-weight: 700 !important;
}

/* "Sold out" and other labels */
html body #dm .ec-store .ec-label {
  background-color: var(--shg-berry) !important;
  border-radius: 0.75rem 0.25rem !important;
  padding: 4px 10px !important;
}
html body #dm .ec-store .ec-label .label__text {
  color: #fff !important;
  font-family: var(--shg-font) !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

/* ---------- Buttons ---------- */
html body #dm .ec-store .form-control__button {
  min-height: 48px !important;
  border-radius: var(--shg-leaf-corner) !important;
  border: 0 !important;
  background-color: var(--shg-stone) !important;
  color: var(--shg-forest) !important;
  font-family: var(--shg-font) !important;
  font-weight: 700 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
  transition: transform .18s ease, background-color .18s ease !important;
}
html body #dm .ec-store .form-control__button-text { color: inherit !important; font-family: var(--shg-font) !important; }
html body #dm .ec-store .form-control--primary .form-control__button {
  background-color: var(--shg-gold) !important;
  color: var(--shg-forest) !important;
}
html body #dm .ec-store .form-control__button:hover { transform: translateY(-2px); }
html body #dm .ec-store .form-control--primary .form-control__button:hover { background-color: var(--shg-gold-hover) !important; }
html body #dm .ec-store .form-control__button:focus-visible {
  outline: 3px solid var(--shg-forest) !important;
  outline-offset: 3px !important;
}

/* ---------- Form fields (search, options, checkout) ---------- */
html body #dm .ec-store :is(.form-control__text, .form-control__textarea, .form-control__select) {
  min-height: 48px !important;
  border: 2px solid #8a948c !important;
  border-radius: var(--shg-leaf-corner) !important;
  background-color: #fff !important;
  color: var(--shg-ink) !important;
  font-family: var(--shg-font) !important;
  font-size: 17px !important;
  box-shadow: none !important;
}
html body #dm .ec-store :is(.form-control__text, .form-control__textarea, .form-control__select):focus {
  border-color: var(--shg-forest) !important;
  outline: 3px solid var(--shg-gold) !important;
  outline-offset: 1px !important;
}
html body #dm .ec-store .form-control--select-inline .form-control__select-text { color: var(--shg-forest) !important; font-weight: 700 !important; }

/* ---------- Product page ---------- */
/* Plain photos with softly rounded corners, like the product list */
html body #dm .ec-store :is(.details-gallery__picture, .details-gallery__image, .details-gallery__thumb-img, .product-details__gallery img) {
  border-radius: 8px !important;
}
html body #dm .ec-store .product-details__description,
html body #dm .ec-store .product-details__description :is(p, li, span, div) {
  font-family: var(--shg-font) !important;
  color: var(--shg-ink) !important;
  font-size: 18px !important;
  line-height: 1.6 !important;
}

/* ---------- Full width ----------
   Duda gives the store widget a fixed width; let it fill the page, with a comfortable gutter. */
html body #dm .dmRespRow:has(> .dmRespColsWrapper .dmStore),
html body #dm .dmRespRow:has(> .dmRespColsWrapper .dmStoreCart) {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding-left: clamp(16px, 4vw, 56px) !important;
  padding-right: clamp(16px, 4vw, 56px) !important;
}
html body #dm .dmBody .dmRespRow:has(> .dmRespColsWrapper .dmStore) :is(.dmRespColsWrapper, .dmRespCol),
html body #dm .dmBody div.dmStore.dmStore,
html body #dm .dmBody div.dmStore.dmStore > .ecwid,
html body #dm .ec-store .ec-store__content-wrapper {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Product and category grids: as many columns as fit across the page (2 on phones).
   A short list (2 or 3 items) sits in the middle instead of leaving a gap on the right. */
html body #dm .ec-store :is(.grid__products, .grid__categories) {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 320px)) !important;
  justify-content: center !important;
  gap: 40px 24px !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}
html body #dm .ec-store :is(.grid__products, .grid__categories) > :is(.grid-product, .grid-category) {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body #dm .ec-store :is(.grid-product__wrap, .grid-category__wrap, .grid-product__wrap-inner, .grid-product__image, .grid-product__image-wrap, .grid-category__card, .grid-category__image) {
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
  max-width: none !important;
}
@media (max-width: 600px) {
  html body #dm .ec-store :is(.grid__products, .grid__categories) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    justify-content: stretch !important;
    gap: 28px 12px !important;
  }
  html body #dm .ec-store .grid-product__title,
  html body #dm .ec-store .grid-product__title-inner { font-size: 16px !important; }
}

/* ---------- Shop bar: search, cart and account (Duda's own store widgets) ---------- */
html body #dm .dmRespRow:has(> .dmRespColsWrapper .dmStoreCart) { padding-top: 24px !important; padding-bottom: 8px !important; }
html body #dm .dmRespRow:has(> .dmRespColsWrapper .dmStoreCart) > .dmRespColsWrapper {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: 100% !important;
  max-width: none !important;
}
html body #dm .dmRespRow:has(> .dmRespColsWrapper .dmStoreCart) .dmRespCol {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: auto !important;
  max-width: none !important;
  min-height: 0 !important;
  float: none !important;
  padding: 0 !important;
}
html body #dm .dmRespRow:has(> .dmRespColsWrapper .dmStoreCart) .dmRespCol:has(.dmStoreSearch) { flex: 1 1 auto; }

/* Search: a pill with the leaf corner */
html body #dm .dmStoreSearch.dmStoreSearch {
  width: min(100%, 360px) !important;
  max-width: none !important;
  height: auto !important;
  margin: 0 !important;
}
html body #dm .dmStoreSearch .dmStoreSearchWrapper {
  position: relative;
  display: flex !important;
  align-items: center;
  height: 48px !important;
  border: 2px solid #8a948c !important;
  border-radius: var(--shg-leaf-corner) !important;
  background: #fff !important;
}
html body #dm .dmStoreSearch .dmStoreSearchWrapper:focus-within { border-color: var(--shg-forest) !important; outline: 3px solid var(--shg-gold); outline-offset: 1px; }
html body #dm .dmStoreSearch.dmStoreSearch .dmStoreSearchInput.dmStoreSearchInput {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  padding: 0 16px 0 44px !important;
  background: transparent !important;
  font-family: var(--shg-font) !important;
  font-size: 17px !important;
  color: var(--shg-ink) !important;
  outline: 0 !important;
}
html body #dm .dmStoreSearch .dmStoreSearchInput::placeholder { color: var(--shg-soft); }
html body #dm .dmStoreSearch .dmStoreSearchIcon {
  position: absolute !important;
  left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--shg-forest) !important;
  font-size: 18px !important;
  pointer-events: none;
}

/* Cart: forest leaf button with a gold count badge */
html body #dm .dmStoreCart.dmStoreCart {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  margin: 0 !important;
}
html body #dm .dmStoreCart .cartIcon {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 48px;
  border-radius: var(--shg-leaf-corner);
  background: var(--shg-forest);
  color: #fff !important;
  font-size: 20px !important;
  cursor: pointer;
  transition: transform .18s ease, background-color .18s ease;
}
html body #dm .dmStoreCart .cartIcon::before { color: #fff !important; }
html body #dm .dmStoreCart .cartIcon:hover { transform: translateY(-2px); }
html body #dm .dmStoreCart .cartItems {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px !important;
  border-radius: 12px;
  background: var(--shg-gold);
  color: var(--shg-forest) !important;
  font-family: var(--shg-font) !important;
  font-size: 13px !important;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
}
/* site.js marks an empty cart, so the badge only shows when there's something in it */
html body #dm .dmStoreCart.shg-cart--empty .cartItems { display: none !important; }

/* Account link, added next to the cart by site.js */
html body #dm .shg-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--shg-leaf-corner);
  background: var(--shg-stone);
  color: var(--shg-forest) !important;
  font-family: var(--shg-font);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
  transition: transform .18s ease, background-color .18s ease;
}
html body #dm .shg-account:hover { background: var(--shg-leaf-pale); transform: translateY(-2px); }
html body #dm .shg-account svg { width: 20px; height: 20px; flex: none; }
html body #dm :is(.shg-account, .dmStoreCart .cartIcon):focus-visible { outline: 3px solid var(--shg-forest); outline-offset: 3px; }
@media (max-width: 600px) {
  html body #dm .dmRespRow:has(> .dmRespColsWrapper .dmStoreCart) { padding-top: 12px !important; }
  html body #dm .shg-account { padding: 0 14px; }
  html body #dm .shg-account span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* =====================================================================
   PHONES: app-style bottom bar (built by site.js on the shop pages)
   ===================================================================== */
.shg-bnav, .shg-search { display: none; }
html.shg-bnav-on .shg-bnav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 99990;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 6px;
  border-radius: 1.75rem 0.5rem;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: 0 10px 30px -8px rgba(20, 35, 26, 0.35), 0 0 0 1px rgba(23, 58, 34, 0.08);
  font-family: var(--shg-font);
  animation: shg-bnav-in .5s cubic-bezier(.22, 1, .36, 1) both;
}
/* Room at the bottom of the page so the bar never covers the last of the content.
   Duda's phone layout scrolls inside #iscrollBody, so the space goes there when it exists. */
html.shg-bnav-on body:not(:has(#iscrollBody)) { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; }
html.shg-bnav-on #iscrollBody::after {
  content: "";
  display: block;
  clear: both;
  height: calc(96px + env(safe-area-inset-bottom, 0px));
  background: var(--shg-forest); /* carries the footer's green down behind the bar */
}
/* Duda's "back to top" button sits just above the bar */
html.shg-bnav-on #dmBackToTop.dmBackToTop { bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important; }
/* Duda's own search / account / cart row is replaced by the bar on phones */
html.shg-bnav-on body #dm .dmRespRow:has(> .dmRespColsWrapper .dmStoreCart) { display: none !important; }

html.shg-bnav-on .shg-bnav__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  padding: 6px 4px;
  border: 0;
  border-radius: 1.25rem 0.375rem;
  background: transparent;
  color: var(--shg-forest) !important;
  font: inherit;
  text-decoration: none !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s ease, transform .15s ease;
}
html.shg-bnav-on .shg-bnav__item svg { width: 24px; height: 24px; display: block; }
html.shg-bnav-on .shg-bnav__icon { position: relative; display: block; line-height: 0; }
html.shg-bnav-on .shg-bnav__label { font-size: 12px; font-weight: 700; line-height: 1.1; letter-spacing: 0.01em; }
html.shg-bnav-on .shg-bnav__item:active { transform: scale(0.92); }
html.shg-bnav-on .shg-bnav__item[aria-current="page"] { background: var(--shg-leaf-pale); }
html.shg-bnav-on .shg-bnav__item:focus-visible { outline: 3px solid var(--shg-forest); outline-offset: -3px; }

/* Signed in: a small leaf-green dot on the person icon */
html.shg-bnav-on .shg-bnav__item[data-signed-in="yes"]::after {
  content: "";
  position: absolute;
  top: 10px;
  left: calc(50% + 7px);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--shg-leaf);
  box-shadow: 0 0 0 2px #fff;
}

/* Basket count */
html.shg-bnav-on .shg-bnav__badge {
  position: absolute;
  top: -7px;
  left: 14px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--shg-gold);
  color: var(--shg-forest);
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  transform: scale(0);
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
html.shg-bnav-on .shg-bnav__item.has-items .shg-bnav__badge { transform: scale(1); }
html.shg-bnav-on .shg-bnav__item.is-bump .shg-bnav__icon { animation: shg-bump .45s cubic-bezier(.34, 1.56, .64, 1); }

/* Search: slides down from the top over a blurred page */
html.shg-bnav-on .shg-search:not([hidden]) {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 100005;
}
html.shg-bnav-on .shg-search__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 35, 26, 0.32);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity .3s ease;
}
html.shg-bnav-on .shg-search__panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 16px;
  border-radius: 0 0 2rem 0.5rem;
  background: var(--shg-ground);
  box-shadow: 0 16px 40px -12px rgba(20, 35, 26, 0.4);
  transform: translateY(-105%);
  transition: transform .38s cubic-bezier(.22, 1, .36, 1);
}
html.shg-search-open .shg-search__backdrop { opacity: 1; }
html.shg-search-open .shg-search__panel { transform: translateY(0); }
html.shg-bnav-on .shg-search__field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 16px;
  border: 2px solid var(--shg-forest);
  border-radius: var(--shg-leaf-corner);
  background: #fff;
  color: var(--shg-forest);
}
html.shg-bnav-on .shg-search__field:focus-within { outline: 3px solid var(--shg-gold); outline-offset: 1px; }
html.shg-bnav-on .shg-search__field svg { width: 20px; height: 20px; flex: none; }
html.shg-bnav-on .shg-search__field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: var(--shg-ink);
  font-family: var(--shg-font);
  font-size: 17px; /* 16px or more stops iPhones zooming in */
  -webkit-appearance: none;
  appearance: none;
}
html.shg-bnav-on .shg-search__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--shg-stone);
  color: var(--shg-forest);
  cursor: pointer;
}
html.shg-bnav-on .shg-search__close svg { width: 20px; height: 20px; }
html.shg-bnav-on .shg-search__close:focus-visible { outline: 3px solid var(--shg-forest); outline-offset: 2px; }
html.shg-search-open .shg-bnav { opacity: 0; pointer-events: none; }

@keyframes shg-bnav-in { from { transform: translateY(120%); } to { transform: none; } }
@keyframes shg-bump { 0% { transform: scale(1); } 40% { transform: scale(1.25) rotate(-8deg); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  html.shg-bnav-on .shg-bnav, html.shg-bnav-on .shg-bnav__item.is-bump .shg-bnav__icon { animation: none; }
  html.shg-bnav-on :is(.shg-search__panel, .shg-search__backdrop, .shg-bnav__badge) { transition: none; }
}
