/* Keep package controls centered between the pack size and price. */
html body #main {
  --mol-package-action-width: 112px;
}
html:lang(ka) body #main {
  --mol-package-action-width: 148px;
}
/* Use the same action column when the product page also supplies inline styles. */
@layer molisan-package-columns {
  #main :is(.cms-package-prices, .card-prices, .mol-pdp-options):has(> .mol-card-package-row) {
    grid-template-columns: minmax(0, 1fr) var(--mol-package-action-width) fit-content(84px) !important;
  }
}
html body #main :is(.cms-package-prices,.card-prices,.mol-pdp-options):has(>.mol-card-package-row){display:grid!important;grid-auto-rows:auto;gap:8px 6px!important;width:100%!important;min-width:0;max-width:100%!important}
html body #main .mol-card-package-row{display:grid!important;grid-column:1/-1!important;grid-template-columns:minmax(0,1fr) var(--mol-package-action-width) fit-content(84px)!important;align-items:center!important;gap:6px!important;min-width:0;min-height:56px;box-sizing:border-box;width:100%!important;margin:0!important;padding:0!important}
@supports(grid-template-columns:subgrid){html body #main .mol-card-package-row{grid-template-columns:subgrid!important}}
html body #main .mol-card-package-row>.cms-package-label,html body #main .card-prices>.mol-card-package-row>:first-child{min-width:0;font:400 14px/1.35 system-ui,sans-serif!important;overflow-wrap:normal;word-break:normal;hyphens:none}
html body #main .mol-card-controls{display:flex!important;align-items:center;width:var(--mol-package-action-width);min-width:0}
html body #main .mol-card-controls>a:is(.preorder-whatsapp,.mol-card-cart-add){display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;height:52px!important;min-height:52px!important;margin:0!important;padding:3px 4px!important;border:1px solid #a5b89b!important;border-radius:8px!important;background:#edf2e8!important;color:#153d31!important;font:650 13px/1.15 system-ui,sans-serif!important;text-align:center!important;text-decoration:none!important;white-space:nowrap!important;overflow-wrap:normal;cursor:pointer;touch-action:manipulation}
html body #main .mol-card-controls>a.mol-card-cart-add{background:#bb4c2a!important;border-color:#bb4c2a!important;color:#fff!important}
html body #main .mol-card-add-label {
  font:650 13px/1.15 system-ui,sans-serif!important;
  color:inherit!important;
  white-space:nowrap!important;
}
html body #main .mol-card-controls > a.mol-card-cart-add:has(.mol-card-count-compact) {
  flex-direction:row!important;
  gap:5px;
}
html body #main .mol-card-controls > a > .mol-card-count-compact {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:none;
  min-inline-size:1.4em;
  padding:2px 4px;
  margin:0!important;
  border-radius:999px;
  background:rgb(0 0 0 / 18%);
  white-space:nowrap!important;
}
html body #main :is(.mol-card-cart-count,.mol-card-preorder-count){font:500 11px/1.1 system-ui,sans-serif!important;color:inherit!important;margin:1px 0 0!important;white-space:nowrap!important}
html body #main :is(.mol-card-cart-count,.mol-card-preorder-count)[hidden]{display:none!important}
html body #main .mol-card-package-row>:is(b,.cms-package-value){display:flex!important;flex-direction:column!important;align-items:flex-end!important;justify-content:center;min-width:0;max-width:84px;font:700 14px/1.25 system-ui,sans-serif!important;white-space:normal!important;text-align:right}
html body #main .mol-card-package-row :is(.cms-price-current,.storefront-current-price,.storefront-product-status){max-width:84px;white-space:normal!important;overflow-wrap:anywhere}
html body #main .mol-card-package-row :is(del,.cms-price-old,.storefront-old-price){font-size:11px!important}
html body #main :is(.product-tile-link,.catalogue-card,.product-card,.purpose-related-card):has(.mol-card-package-row) :is(.card-details,.purpose-related-details,[data-mol-buy]){display:none!important}
html body #main .mol-card-controls>a:focus-visible{outline:3px solid #bb4c2a;outline-offset:3px}
html body #main .priority-range-card:has(.mol-card-package-row){grid-template-columns:minmax(0,1fr)!important}
html body #main .mol-card-announcement{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
html body #main .mol-card-add-error{grid-column:1/-1;font:500 12px/1.4 system-ui,sans-serif;color:#9a3f27;padding:2px 0 6px;overflow-wrap:anywhere}
/* The original PDP controls remain available to the stock/price scripts. */
html body #main .mol-package-order>:is(.variant-row,.order-total,#order-link){display:none!important}
html body #main .mol-pdp-options>.mol-pdp-row{background:#fcfbf6!important;border:1px solid #a5b89b!important;border-radius:8px!important;padding:8px 10px!important}
html body #main .mol-pdp-options>.mol-pdp-row[aria-current="true"]{background:#edf2e8!important}
html body #main .category-page-heading>a[href*="catalog.html?category="]{display:none!important}
html body #main .mol-inline-category-controls{display:flex;flex-wrap:wrap;align-items:flex-end;gap:14px 16px;margin:4px 0 24px;padding:16px;border:1px solid #c2cfb9;border-radius:10px;background:#f7f8f2}
html body #main .mol-inline-category-controls[hidden],html body #main .mol-inline-category-grid>[hidden],html body #main .mol-inline-category-field[hidden]{display:none!important}
html body #main .mol-inline-category-field{display:flex;flex:1 1 220px;flex-direction:column;gap:7px;min-width:0;margin:0;font:500 14px/1.4 system-ui,sans-serif}
html body #main .mol-inline-category-field>:is(input,select){box-sizing:border-box;width:100%;min-height:46px;margin:0;border:1px solid #a5b89b;border-radius:8px;padding:10px 14px;font:400 16px/1.4 system-ui,sans-serif;background:#fcfbf6;color:#153d31}
html body #main .mol-inline-category-status{flex-basis:100%;margin:0;font:400 14px/1.4 system-ui,sans-serif}
html body #main a.coalesia-support{border:1px solid #a5b89b!important;border-radius:12px!important}
html body #main a.mobile-contact{display:inline-flex;align-items:center;gap:8px;min-height:44px;box-sizing:border-box;border:1px solid #a5b89b;border-radius:8px;padding:10px 14px;background:#edf2e8;color:#153d31;font-weight:650;text-decoration:none}
html body #main a.mobile-contact>svg{flex:none;width:22px;height:22px}

/* Keep the catalogue title and count together, with Search filling the row. */
html body #main .mol-category-heading-row {
  display:flex;
  align-items:center;
  gap:clamp(6px,1.4vw,16px);
  width:100%;
  min-width:0;
}
html body #main .mol-category-heading-row > :is(h1,h2,.mol-category-count) {
  margin:0;
  min-width:0;
  max-width:none;
  word-break:normal;
  overflow-wrap:normal;
}
html body #main .mol-category-heading-row > :is(h1,h2) {
  font-size:clamp(22px,4.3vw,42px);
  line-height:1.14;
}
html body #main .mol-category-heading-row > .mol-category-count {
  flex:none;
  font:500 13px/1.25 system-ui,sans-serif;
  white-space:nowrap;
}
html body #main .mol-category-toggle {
  flex:1 1 auto;
  min-inline-size:max-content;
  min-height:44px;
  padding:7px clamp(8px,1.25vw,16px)!important;
  font-size:14px!important;
  white-space:nowrap;
}
html body #main .mol-catalogue-panel[hidden] {
  display:none!important;
}
html body #main .catalog-body > .mol-category-heading-row {
  margin-bottom:12px;
}
html body #main .mol-category-heading-row + :is(.hero-summary,.extracts-intro,.oil-lead) {
  margin-top:.55em;
}
@media (max-width:600px) {
  html body #main .mol-category-heading-row > :is(h1,h2) {
    font-size:clamp(18px,5.4vw,29px);
    line-height:1.16;
  }
  html body #main .mol-category-heading-row > .mol-category-count {
    font-size:clamp(11px,3.2vw,13px);
  }
  html body #main .mol-category-toggle {
    font-size:13px!important;
  }
}

@layer molisan-catalogue-columns {
  #main :is(.category-products,.catalog-grid,.catalogue-grid,.catalogue-workspace .product-collection):has(> :is(.product-card,.product-tile-link,.catalogue-card)) {
    --mol-grid-gap:clamp(12px,1.5vw,20px);
    grid-template-columns:repeat(auto-fill,minmax(min(100%,max(21.5rem,calc((100% - 2 * var(--mol-grid-gap)) / 3))),1fr))!important;
    gap:var(--mol-grid-gap)!important;
    align-items:stretch!important;
  }
}

/* Each package keeps its label, action and price in the same grid row. */
@layer molisan-package-columns {
  #main .catalogue-workspace :is(.catalogue-card, .product-tile-link) .cms-package-prices:has(> .mol-card-package-row) {
    grid-template-columns:minmax(0,1fr)!important;
  }

  #main .catalogue-workspace :is(.catalogue-card, .product-tile-link) .mol-card-package-row {
    grid-template-columns:minmax(0,1fr) min(42%,11rem) min(25%,5.25rem)!important;
    grid-template-rows:auto!important;
  }

  #main .catalogue-workspace :is(.catalogue-card, .product-tile-link) .mol-card-package-row > .cms-package-label {
    grid-area:1 / 1!important;
  }

  #main .catalogue-workspace :is(.catalogue-card, .product-tile-link) .mol-card-package-row > .mol-card-controls {
    grid-area:1 / 2!important;
    width:100%!important;
  }

  #main .catalogue-workspace :is(.catalogue-card, .product-tile-link) .mol-card-package-row > .cms-package-value {
    grid-area:1 / 3!important;
  }

  @media (max-width:365px) {
    #main .catalogue-workspace :is(.catalogue-card, .product-tile-link) .mol-card-package-row {
      grid-template-columns:minmax(0,1fr) min(36%,11rem) min(24%,5.25rem)!important;
    }
  }
}

#main .catalogue-workspace :is(.catalogue-card, .product-tile-link) .mol-card-controls > a > .mol-card-add-label {
  min-width:0;
  max-width:100%;
  white-space:normal!important;
  overflow-wrap:normal;
  word-break:normal;
}

#main .catalogue-workspace :is(.catalogue-card, .product-tile-link) .mol-card-cart-add:has(.mol-card-count-compact) {
  flex-wrap:wrap;
  align-content:center;
  gap:2px 5px;
}

/* Keep the photo and text in one card on product lists. */
#main .catalogue-workspace :is(.catalogue-grid > .catalogue-card, .product-collection > .product-tile-link) {
  --catalogue-card-inset:clamp(10px,1.05vw,16px);
  background-color:#f8f7f3;
  border:1px solid #deded6;
  border-radius:10px;
}

#main .catalogue-workspace :is(.catalogue-grid > .catalogue-card, .product-collection > .product-tile-link) > .product-visual {
  border-radius:9px 9px 0 0;
}

#main .catalogue-workspace .catalogue-grid > .catalogue-card {
  padding-block-end:var(--catalogue-card-inset);
}

#main .catalogue-workspace .catalogue-grid > .catalogue-card > :is(h2,.product-card-price,.catalogue-pack,.catalogue-use,.disease-search-reason) {
  margin-inline:var(--catalogue-card-inset);
}

#main .catalogue-workspace .product-collection > .product-tile-link > .product-info {
  padding:var(--catalogue-card-inset);
}

/* Keep descriptions smaller than product names. */
#main .catalogue-workspace :is(
  .catalogue-grid > .catalogue-card > .catalogue-use,
  .product-collection > .product-tile-link > .product-info > .product-purpose
) {
  font-size:.875rem!important;
}
