/* 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 title and count together, with a compact search button. */
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:none;
  margin-inline-start: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 {
  --mol-catalogue-heading-gap:clamp(16px,1.6vw,24px);
  --mol-catalogue-photo-height:clamp(304px,28vw,408px);
}
html body #main > :is(.category-page-heading,.oyo-landing-heading) {
  padding-block-end:var(--mol-catalogue-heading-gap)!important;
}
html body #main > .oyo-landing-heading > .oyo-brand {
  margin-block-end:0;
}
html body #main > .oyo-landing-heading + .oyo-collection {
  padding-block-start:0;
}
html body #main .catalog-body > .mol-category-heading-row {
  margin-bottom:var(--mol-catalogue-heading-gap);
}
@media (max-width:700px) {
  html body #main {
    --mol-catalogue-photo-height:clamp(238px,64vw,256px);
  }
}
html body #main .mol-category-heading-row + :is(.hero-summary,.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);
    --mol-product-illustration-height:var(--mol-catalogue-photo-height);
    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;
  }
}

/* Align the header and catalogue on wide screens. */
@media (min-width:1050px) {
  html body .site-header > .header-row.wrap,
  html body #main > :is(.breadcrumbs,.category-page-heading,.catalog-body,.oyo-landing-heading,.oyo-collection).wrap,
  html body #main > .wrap:has(> .category-products),
  html body #main > .catalog-banner > .wrap {
    width:min(1740px,calc(100% - 48px))!important;
    max-width:none!important;
  }
}

html body #main :is(.category-products,.catalog-grid) > .product-card .card-info {
  justify-content:flex-start;
}
html body #main :is(.category-products,.catalog-grid) > .product-card .card-info h3 {
  min-height:0;
  margin-bottom:0;
  line-height:1.3;
}
@media (min-width:725px) {
  html body #main :is(.category-products,.catalog-grid) > .product-card .card-info h3 {
    min-height:2.6em;
  }
}
html body #main :is(.category-products,.catalog-grid) > .product-card .card-prices:has(> :is(.mol-card-package-row,.preorder-price-row:has(> a.preorder-whatsapp))) {
  display:grid!important;
  align-content:start;
  min-height:0;
  margin-top:8px!important;
  padding-top:6px;
}

@layer molisan-package-columns {
  #main :is(.category-products,.catalog-grid) > .product-card .card-prices:has(> :is(.mol-card-package-row,.preorder-price-row:has(> a.preorder-whatsapp))) {
    grid-template-columns:minmax(0,1fr)!important;
  }
  #main :is(.category-products,.catalog-grid) > .product-card .card-prices > :is(.mol-card-package-row,.preorder-price-row:has(> a.preorder-whatsapp)) {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) min(44%,12rem) 3.75rem!important;
    grid-template-rows:auto!important;
    column-gap:8px!important;
    align-items:center!important;
  }
  #main :is(.category-products,.catalog-grid) > .product-card .card-prices > :is(.mol-card-package-row,.preorder-price-row:has(> a.preorder-whatsapp)) > :first-child {
    grid-area:1 / 1!important;
  }
  #main :is(.category-products,.catalog-grid) > .product-card .card-prices > :is(.mol-card-package-row,.preorder-price-row:has(> a.preorder-whatsapp)) > :is(.mol-card-controls,a.preorder-whatsapp) {
    grid-area:1 / 2!important;
    width:100%!important;
  }
  #main :is(.category-products,.catalog-grid) > .product-card .card-prices > :is(.mol-card-package-row,.preorder-price-row:has(> a.preorder-whatsapp)) > b {
    grid-area:1 / 3!important;
    justify-self:end;
    max-width:100%!important;
  }
  @media (max-width:365px) {
    #main :is(.category-products,.catalog-grid) > .product-card .card-prices > :is(.mol-card-package-row,.preorder-price-row:has(> a.preorder-whatsapp)) {
      grid-template-columns:minmax(0,1fr) min(58%,12rem) 3.75rem!important;
      grid-template-rows:auto auto!important;
      row-gap:3px!important;
    }
    #main :is(.category-products,.catalog-grid) > .product-card .card-prices > :is(.mol-card-package-row,.preorder-price-row:has(> a.preorder-whatsapp)) > :first-child {
      grid-area:1 / 1 / 2 / -1!important;
    }
    #main :is(.category-products,.catalog-grid) > .product-card .card-prices > :is(.mol-card-package-row,.preorder-price-row:has(> a.preorder-whatsapp)) > :is(.mol-card-controls,a.preorder-whatsapp) {
      grid-area:2 / 2!important;
    }
    #main :is(.category-products,.catalog-grid) > .product-card .card-prices > :is(.mol-card-package-row,.preorder-price-row:has(> a.preorder-whatsapp)) > b {
      grid-area:2 / 3!important;
    }
  }
}

html body #main :is(.category-products,.catalog-grid) > .product-card .card-prices > .preorder-price-row > a.preorder-whatsapp {
  display:flex!important;
  align-items:center;
  justify-content:center;
  min-width:0!important;
  max-width:100%!important;
  min-height:44px;
  padding-inline:7px!important;
  text-align:center;
  white-space:normal!important;
  overflow-wrap:normal;
  word-break:normal;
}
html body #main :is(.category-products,.catalog-grid) > .product-card .mol-card-controls > a:is(.preorder-whatsapp,.mol-card-cart-add) {
  min-width:0!important;
  padding-inline:7px!important;
  white-space:normal!important;
}
html body #main :is(.category-products,.catalog-grid) > .product-card .mol-card-controls > a > .mol-card-add-label {
  min-width:0;
  max-width:100%;
  white-space:normal!important;
  overflow-wrap:normal;
  word-break:normal;
}
html body #main :is(.category-products,.catalog-grid) > .product-card .mol-card-cart-add:has(.mol-card-count-compact) {
  flex-wrap:wrap;
  align-content:center;
  gap:2px 5px;
}
