/* =====================================================================
   THE MINERS — карточки товаров (каталог и «You may also like»). Скрипт — cards.js
   ===================================================================== */

/* ---------- описание кофе под названием: обжарка и процесс | ноты ---------- */
body.cd-on .cd-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 14px 20px 0;
  font-size: 13px;
  line-height: 1.3;
  color: #141414;
}
body.cd-on .cd-meta__l b { display: block; font-weight: 700 !important; }
body.cd-on .cd-meta__r { font-weight: 450; }
body.cd-on .p.cd-has-meta .ls-meta { display: none !important; }   /* тип из флагов — уже не нужен */

/* ---------- полоса внизу карточки ---------- */
/* старый низ Shoptet (цена + «Detail») прячем — его заменяет .cd-bar */
body.cd-on #products .p-bottom.cd-on > div:not(.cd-bar),
body.cd-on #productsAlternative .p-bottom.cd-on > div:not(.cd-bar) { display: none !important; }

body.cd-on #products .p-bottom > .cd-bar,
body.cd-on #productsAlternative .p-bottom > .cd-bar {
  position: relative;
  z-index: 2;                                   /* над прозрачной ссылкой-карточкой темы */
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 0 0 0 !important;
  background: var(--cd-bg, #141414) !important;
  border-radius: 12px;
  color: var(--cd-fg, #fff) !important;
  transition: background-color .2s ease, color .2s ease;
}
body.cd-on .cd-bar button { font: inherit; color: inherit; cursor: pointer; }
body.cd-on .cd-bar .cd-go {
  flex: 1 1 auto;
  height: 100%;
  margin: 0;
  padding: 0 0 0 24px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 17px !important;
  font-weight: 450 !important;
  white-space: nowrap;
}
body.cd-on .cd-bar .cd-l2 { display: none; }
body.cd-on .cd-bar .cd-seg,
body.cd-on .cd-bar .cd-qty { display: none; }
body.cd-on .cd-bar .cd-price {
  flex: none;
  padding-right: 22px;
  font-size: 17px;
  font-weight: 700 !important;
  white-space: nowrap;
  pointer-events: none;
}

/* наведение (на телефоне — нажатие): лаймовая полоса — Add · вариант · количество · цена */
@media (hover: hover) {
  body.cd-on .p:hover .cd-bar:not(.all-off) { --cd-bg: #DCFF50; --cd-fg: #141414; }
  body.cd-on .p:hover .cd-bar:not(.all-off) .cd-l1 { display: none; }
  body.cd-on .p:hover .cd-bar:not(.all-off) .cd-l2 { display: inline; }
  body.cd-on .p:hover .cd-bar:not(.all-off) .cd-go { flex: 0 0 auto; padding-right: 4px; }
  body.cd-on .p:hover .cd-bar.has-variants:not(.all-off) .cd-seg,
  body.cd-on .p:hover .cd-bar:not(.all-off) .cd-qty { display: inline-flex; }
  body.cd-on .p:hover .cd-bar:not(.all-off) .cd-price { margin-left: auto; }
}
body.cd-on .cd-bar.is-active:not(.all-off) { --cd-bg: #DCFF50; --cd-fg: #141414; }
body.cd-on .cd-bar.is-active:not(.all-off) .cd-l1 { display: none; }
body.cd-on .cd-bar.is-active:not(.all-off) .cd-l2 { display: inline; }
body.cd-on .cd-bar.is-active:not(.all-off) .cd-go { flex: 0 0 auto; padding-right: 4px; }
body.cd-on .cd-bar.is-active.has-variants:not(.all-off) .cd-seg,
body.cd-on .cd-bar.is-active:not(.all-off) .cd-qty { display: inline-flex; }
body.cd-on .cd-bar.is-active:not(.all-off) .cd-price { margin-left: auto; }

/* вариант: белая «таблетка», выбранный — чёрный */
body.cd-on .cd-bar .cd-seg {
  flex: none;
  height: 28px;
  padding: 2px;
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
body.cd-on .cd-bar .cd-v {
  height: 100%;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 13px !important;
  white-space: nowrap;
}
body.cd-on .cd-bar .cd-v.is-on { background: #141414; color: #fff; }

/* много/длинные варианты — свой выпадающий список: белая «таблетка», список открывается вверх */
body.cd-on .cd-bar.has-select .cd-seg { flex: 0 1 auto; min-width: 0; padding: 0; overflow: visible; background: none; }
body.cd-on .cd-bar .cd-dd { position: relative; display: block; height: 100%; min-width: 0; }
body.cd-on .cd-bar .cd-dd__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 12px 0 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #141414;
  font-size: 13px !important;
  white-space: nowrap;
}
body.cd-on .cd-bar .cd-dd__val { overflow: hidden; text-overflow: ellipsis; }
body.cd-on .cd-bar .cd-dd__btn::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s ease, margin .2s ease;
}
body.cd-on .cd-bar .cd-dd.is-open .cd-dd__btn::after { margin-top: 3px; transform: rotate(-135deg); }

body.cd-on .cd-bar .cd-dd__list {
  position: absolute;
  left: -6px;
  bottom: calc(100% + 12px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: calc(100% + 12px);
  padding: 6px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 20, 20, .14), 0 0 0 1px rgba(20, 20, 20, .06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
body.cd-on .cd-bar .cd-dd.is-open .cd-dd__list {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .18s ease, transform .18s ease;
}
body.cd-on .cd-bar .cd-dd__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: #141414 !important;
  text-align: left;
  font-size: 13px !important;
  white-space: nowrap;
}
body.cd-on .cd-bar .cd-dd__opt small { font-size: 12px; opacity: .55; }
body.cd-on .cd-bar .cd-dd__opt:hover { background: #f2f2f2; }
body.cd-on .cd-bar .cd-dd__opt.is-on { background: #141414; color: #fff !important; }
body.cd-on .cd-bar .cd-dd__opt.is-on small { opacity: .7; }
body.cd-on .cd-bar .cd-dd__opt.is-dis { opacity: .4; cursor: not-allowed; }
body.cd-on .cd-bar .cd-dd__opt.is-dis span { text-decoration: line-through; }
body.cd-on .cd-bar .cd-dd__btn:focus:not(:focus-visible),
body.cd-on .cd-bar .cd-dd__opt:focus:not(:focus-visible) { outline: none; }
/* карточка с открытым списком — поверх соседних */
body.cd-on .product:has(.cd-bar.dd-open),
body.cd-on .p:has(.cd-bar.dd-open) { position: relative; z-index: 30; overflow: visible !important; }
body.cd-on .p-bottom:has(.cd-bar.dd-open) { overflow: visible !important; }
/* лаймовая полоса держится, пока список открыт (даже если курсор ушёл в список) */
body.cd-on .cd-bar.dd-open:not(.all-off) { --cd-bg: #DCFF50; --cd-fg: #141414; }
body.cd-on .cd-bar.dd-open:not(.all-off) .cd-l1 { display: none; }
body.cd-on .cd-bar.dd-open:not(.all-off) .cd-l2 { display: inline; }
body.cd-on .cd-bar.dd-open:not(.all-off) .cd-go { flex: 0 0 auto; padding-right: 4px; }
body.cd-on .cd-bar.dd-open:not(.all-off) .cd-seg,
body.cd-on .cd-bar.dd-open:not(.all-off) .cd-qty { display: inline-flex; }
body.cd-on .cd-bar.dd-open:not(.all-off) .cd-price { margin-left: auto; }

body.cd-on .cd-bar .cd-v.is-dis { opacity: .4; text-decoration: line-through; }

/* количество: серая «таблетка» − 2 + */
body.cd-on .cd-bar .cd-qty {
  flex: none;
  align-items: stretch;
  height: 28px;
  border-radius: 999px;
  background: #d9d9d9;
  overflow: hidden;
}
body.cd-on .cd-bar .cd-qty button {
  width: 24px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px !important;
}
body.cd-on .cd-bar .cd-n {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  background: #f2f2f2;
  font-size: 13px;
}

/* нет в наличии */
body.cd-on .cd-bar.all-off { --cd-bg: #bdbdbd; }
body.cd-on .cd-bar.is-off .cd-go { opacity: .4; cursor: not-allowed; }
body.cd-on .cd-bar.is-busy .cd-go { opacity: .5; }

@media (max-width: 767px) {
  body.cd-on .cd-meta { padding: 12px 12px 0; }
  body.cd-on #products .p-bottom > .cd-bar,
  body.cd-on #productsAlternative .p-bottom > .cd-bar { height: 44px; gap: 8px; }
  body.cd-on .cd-bar .cd-go { padding-left: 18px; font-size: 16px !important; }
  body.cd-on .cd-bar .cd-price { padding-right: 16px; font-size: 16px; }
  body.cd-on .cd-bar .cd-v { padding: 0 8px; font-size: 12px !important; }
}

/* старая цена при скидке */
body.cd-on .cd-bar .cd-old {
  margin-right: 6px;
  font-weight: 450 !important;
  opacity: .55;
  text-decoration: line-through;
}

/* длинный процесс («Anoxic Washed with Mosto (120 & 180 hours)») — плотные строки */
body.cd-on .cd-meta,
body.cd-on .cd-meta b,
body.cd-on .cd-meta div { font-size: 13px !important; line-height: 1.3 !important; }
body.cd-on .cd-meta__l b + b { margin-top: 4px; }
