/*
 Theme Name:   Woodmart Child
 Description:  Woodmart Child Theme
 Author:       XTemos
 Author URI:   http://xtemos.com
 Template:     woodmart
 Version:      1.0.0
 Text Domain:  woodmart
*/

/* ═══════════════════════════════════════════════════════
   КАЛЬКУЛЯТОР СТОИМОСТИ — адаптация под дизайн-систему
   Шрифт: Jost | Акцент: #0078D4 | Фон: светло-бежевый
   ═══════════════════════════════════════════════════════ */

/* Заменяем Oswald/PT Sans на Jost */
.dgc-wrap,
.dgc-title,
.dgc-tag,
.dgc-label,
.dgc-tab,
.dgc-price-val,
.dgc-cta {
  font-family: 'Manrope', Arial, sans-serif !important;
}
.dgc-title { font-family: 'Oswald', Arial, sans-serif !important; }

/* Фон секции: светло-бежевый вместо тёмно-зелёного */
.dgc-wrap {
  background: #EEECEA !important;
  background-image: repeating-linear-gradient(
    -45deg, transparent, transparent 32px,
    rgba(0,0,0,.025) 32px, rgba(0,0,0,.025) 33px
  ) !important;
  padding: 72px 32px !important;
}

/* Бейдж "Конфигуратор" */
.dgc-tag {
  background: #0078D4 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  border-radius: 20px !important;
  padding: 4px 14px !important;
  text-transform: uppercase !important;
  margin-bottom: 12px !important;
}

/* Заголовок */
.dgc-title {
  font-size: clamp(28px, 3.5vw, 42px) !important;
  color: #1E1E1E !important;
  font-weight: 800 !important;
  text-transform: none !important;
  letter-spacing: -0.01em !important;
}
.dgc-title em { color: #0078D4 !important; font-style: normal !important; }
.dgc-sub { color: #767676 !important; font-size: 16px !important; }

/* Вкладки */
.dgc-tabs {
  gap: 0 !important;
  border: 1.5px solid #E8E8E8 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  justify-content: flex-start !important;
  max-width: fit-content !important;
  margin: 0 auto 28px !important;
  background: transparent !important;
}
.dgc-tab {
  background: #fff !important;
  border: none !important;
  border-right: 1.5px solid #E8E8E8 !important;
  color: #767676 !important;
  border-radius: 0 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 11px 20px !important;
  font-family: 'Manrope', sans-serif !important;
}
.dgc-tab:last-child { border-right: none !important; }
.dgc-tab.active {
  background: #0078D4 !important;
  border-color: transparent !important;
  color: #fff !important;
}
.dgc-tab:hover:not(.active) {
  background: #F7F6F2 !important;
  color: #1E1E1E !important;
}

/* Лейаут тела калькулятора */
.dgc-body {
  max-width: 1200px !important;
  grid-template-columns: 1fr 340px !important;
  gap: 28px !important;
}

/* Левая панель фильтров */
.dgc-filters {
  background: #fff !important;
  border: 1.5px solid #E8E8E8 !important;
  border-radius: 14px !important;
  padding: 28px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,.05) !important;
}

.dgc-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #767676 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  font-family: 'Manrope', sans-serif !important;
}

/* Чипы-кнопки выбора */
.dgc-pill {
  background: #F7F6F2 !important;
  border: 1.5px solid #E8E8E8 !important;
  color: #1E1E1E !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  font-family: 'Manrope', sans-serif !important;
  padding: 6px 14px !important;
  transition: border-color .15s, background .15s, color .15s !important;
}
.dgc-pill:hover {
  border-color: #0078D4 !important;
  color: #0078D4 !important;
  background: #E6F2FA !important;
}
.dgc-pill.active {
  background: #0078D4 !important;
  border-color: #0078D4 !important;
  color: #fff !important;
}

/* Цветовые свотчи */
.dgc-color-pill {
  background: #F7F6F2 !important;
  border: 1.5px solid #E8E8E8 !important;
  color: #1E1E1E !important;
  border-radius: 10px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  font-family: 'Manrope', sans-serif !important;
  transition: border-color .15s, background .15s !important;
}
.dgc-color-pill:hover {
  border-color: rgba(0, 120, 212,.6) !important;
  background: rgba(0, 120, 212,.06) !important;
}
.dgc-color-pill.active {
  border-color: #0078D4 !important;
  background: #E6F2FA !important;
  box-shadow: 0 0 0 1px #0078D4 !important;
}

/* Панель превью изображения — вертикальный формат */
.dgc-preview {
  background: #F7F6F2 !important;
  border: 1.5px solid #E8E8E8 !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,.05) !important;
  aspect-ratio: 3/4 !important;
  width: 100% !important;
  max-width: none !important;
}
.dgc-preview img {
  object-fit: cover !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* Слайдер длины */
.dgc-length-slider {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 8px 4px 4px !important;
}
.dgc-length-slider input[type="range"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 100% !important;
  height: 6px !important;
  border-radius: 6px !important;
  background: linear-gradient(to right, #0078D4 0%, #0078D4 0%, #E8E8E8 0%, #E8E8E8 100%);
  outline: none !important;
  cursor: pointer !important;
  margin: 0 !important;
  padding: 0 !important;
}
.dgc-length-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: #0078D4;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  cursor: pointer;
}
.dgc-length-slider input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: #0078D4;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  cursor: pointer;
}
.dgc-length-track-labels {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-size: 11px !important;
  font-family: 'Manrope', sans-serif !important;
  color: #767676 !important;
  font-weight: 600 !important;
}
.dgc-length-current {
  color: #0078D4 !important;
  font-weight: 800 !important;
  font-size: 14px !important;
}

/* Карточка цены */
.dgc-price-card {
  background: #fff !important;
  border: 1.5px solid #E8E8E8 !important;
  border-radius: 14px !important;
  padding: 20px 22px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,.05) !important;
  backdrop-filter: none !important;
}
.dgc-price-label {
  color: #767676 !important;
  font-family: 'Manrope', sans-serif !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}
.dgc-price-val {
  font-size: 36px !important;
  font-weight: 800 !important;
  color: #0078D4 !important;
  font-family: 'Manrope', sans-serif !important;
  line-height: 1 !important;
  margin-bottom: 4px !important;
}
.dgc-price-val span { font-size: 22px !important; }
.dgc-price-hint { color: #767676 !important; font-size: 12px !important; }

/* Теги выбранных параметров */
.dgc-param {
  background: #F7F6F2 !important;
  color: #767676 !important;
  border-radius: 20px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  font-family: 'Manrope', sans-serif !important;
  padding: 4px 10px !important;
}
.dgc-param strong { color: #1E1E1E !important; }

/* Кнопка "Перейти к товару" */
.dgc-cta {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  background: #0078D4 !important;
  color: #fff !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  font-family: 'Manrope', sans-serif !important;
  padding: 13px !important;
  border: none !important;
  cursor: pointer !important;
  transition: background .2s, transform .15s !important;
  text-decoration: none !important;
}
.dgc-cta:hover {
  background: #005A9E !important;
  transform: translateY(-1px) !important;
  color: #fff !important;
}

/* Плейсхолдер "нет фото" */
.dgc-preview-placeholder span { color: rgba(100,100,100,.5) !important; }
.dgc-preview-placeholder svg { opacity: .15 !important; fill: #333 !important; }

/* Адаптив */
@media (max-width: 900px) {
  .dgc-body { grid-template-columns: 1fr !important; }
  .dgc-wrap { padding: 48px 16px !important; }
}

/* ═══════════════════════════════════════════════════════
   БЕГУЩАЯ СТРОКА (TICKER)
   ═══════════════════════════════════════════════════════ */

.dg-ticker-wrap {
  background: rgba(49, 119, 15, 0.89);
  padding: 11px 0;
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.dg-ticker-track {
  display: inline-flex;
  animation: dgTicker 28s linear infinite;
}
.dg-ticker-track:hover { animation-play-state: paused; }
.dg-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.8);
  font: 600 13px 'Manrope', sans-serif;
  padding: 0 28px;
}
.dg-dot { color: #0078D4; font-size: 16px; }
@keyframes dgTicker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ═══════════════════════════════════════════════════════
   ЦВЕТНЫЕ СВОТЧИ (карточка товара — Цвет)
   ═══════════════════════════════════════════════════════ */

:root {
  --dg-accent:  #0078D4;
  --dg-dark:    #1E1E1E;
  --dg-border:  #E0E0E0;
  --dg-bg:      #F7F6F2;
  --dg-radius:  8px;
}

/* Обёртка ряда свотчей */
.dg-color-swatches {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  padding: 4px 0 !important;
}

/* Один свотч-квадрат */
.dg-color-swatches .dg-cs-item {
  position: relative;
  width: 44px !important;
  height: 44px !important;
  border-radius: var(--dg-radius) !important;
  border: 2px solid var(--dg-border) !important;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .18s, box-shadow .18s, transform .15s;
  flex-shrink: 0;
  outline: none;
}

/* Фоновый блок (заполняет квадрат цветом) */
.dg-color-swatches .dg-cs-item .wd-swatch-bg {
  display: block;
  position: absolute;
  inset: 0;
  border-radius: calc(var(--dg-radius) - 2px);
}

/* Текст (скрываем — только для a11y tooltip) */
.dg-color-swatches .dg-cs-item .wd-swatch-text {
  position: absolute;
  clip: rect(0 0 0 0);
  overflow: hidden;
  width: 1px; height: 1px;
  white-space: nowrap;
}

/* Галочка при выборе */
.dg-color-swatches .dg-cs-item .dg-cs-check {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  z-index: 1;
}

/* Hover */
.dg-color-swatches .dg-cs-item:hover {
  border-color: var(--dg-accent) !important;
  box-shadow: 0 0 0 2px rgba(0, 120, 212,.25);
  transform: translateY(-2px);
  z-index: 1;
}

/* Активный */
.dg-color-swatches .dg-cs-item.wd-active {
  border-color: var(--dg-accent) !important;
  box-shadow: 0 0 0 2px var(--dg-accent);
}
.dg-color-swatches .dg-cs-item.wd-active .dg-cs-check {
  display: flex;
}

/* Подпись цвета под свотчами (tooltip через title-attr встроен) */

/* Скрываем дубликаты родных свотчей Woodmart, если есть наши */
.variations .value.with-swatches > .dg-color-swatches ~ .wd-swatches-product {
  display: none !important;
}
/* ═══════════════════════════════════════════════════════
   СЛАЙДЕР ДЛИНЫ (карточка товара)
   ═══════════════════════════════════════════════════════ */

.dg-length-slider-wrap {
  padding: 6px 0 10px;
  width: 100%;
  max-width: 500px;
}

/* Шапка: текущее значение + диапазон */
.dg-ls-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.dg-ls-current {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 20px;
  color: var(--dg-accent);
  line-height: 1;
}
.dg-ls-current strong {
  font-weight: 800;
}
.dg-ls-range-hint {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 12px;
  color: #999;
  font-weight: 500;
}

/* Трек слайдера */
.dg-ls-track-wrap {
  padding: 6px 0;
}

.dg-ls-input {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 100% !important;
  height: 6px !important;
  border-radius: 6px !important;
  background: linear-gradient(to right, var(--dg-accent) 0%, var(--dg-accent) 0%, #E8E8E8 0%, #E8E8E8 100%);
  outline: none !important;
  cursor: pointer !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  transition: none;
}

/* Thumb — Webkit */
.dg-ls-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--dg-accent);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 120, 212,.35), 0 1px 4px rgba(0,0,0,.15);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.dg-ls-input::-webkit-slider-thumb:hover,
.dg-ls-input:focus::-webkit-slider-thumb {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(0, 120, 212,.5);
}

/* Thumb — Firefox */
.dg-ls-input::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--dg-accent);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 120, 212,.35);
  cursor: pointer;
}
.dg-ls-input::-moz-range-track {
  height: 6px;
  border-radius: 6px;
}

/* Подписи делений */
.dg-ls-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  gap: 0;
}
.dg-ls-tick {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 10px;
  color: #aaa;
  font-weight: 500;
  text-align: center;
  flex: 1;
  white-space: nowrap;
  transition: color .15s, font-weight .15s;
}
.dg-ls-tick--active {
  color: var(--dg-accent) !important;
  font-weight: 700 !important;
  font-size: 11px;
}

/* Скрываем стандартный select (WooCommerce требует его в DOM) */
.variations .value .dg-length-slider-wrap ~ select,
.variations .value .dg-color-swatches ~ select {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  padding: 0 !important;
  border: none !important;
  width: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

/* ═══════════════════════════════════════════════════════
   КНОПКИ АТРИБУТОВ (Высота Борта, Тип Покрытия, Ширина)
   ═══════════════════════════════════════════════════════ */

.dg-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
  align-items: center;
}

.dg-btn-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  background: #fff;
  border: 2px solid #E0E0E0;
  border-radius: 8px;
  padding: 7px 16px;
  cursor: pointer;
  transition: border-color .17s, background .17s, color .17s, box-shadow .17s, transform .12s;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  outline: none;
}

.dg-btn-opt:hover {
  border-color: var(--dg-accent, #0078D4);
  color: var(--dg-accent, #0078D4);
  background: #fff8f5;
  transform: translateY(-1px);
}

.dg-btn-opt:active {
  transform: translateY(0);
}

.dg-btn-opt--active {
  background: var(--dg-accent, #0078D4) !important;
  border-color: var(--dg-accent, #0078D4) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(0, 120, 212,.30);
}

.dg-btn-opt--active:hover {
  background: #005A9E !important;
  border-color: #005A9E !important;
  color: #fff !important;
}

/* Кнопки недоступных вариаций (disabled) */
.dg-btn-opt.wd-disabled {
  opacity: .38;
  cursor: not-allowed;
  pointer-events: none;
}

/* Скрываем также select под кнопками */
.variations .value .dg-btn-group ~ select {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  padding: 0 !important;
  border: none !important;
  width: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}
}

/* Стили для недоступных опций в кастомном интерфейсе */
.dg-cs-item.dg-disabled,
.dg-btn-opt.dg-disabled {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  position: relative;
}

/* Красный крестик поверх отключенных квадратных цветов */
.dg-cs-item.dg-disabled::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140%;
  height: 2px;
  background-color: #ff0000;
  transform: translate(-50%, -50%) rotate(45deg);
  z-index: 10;
  opacity: 0.6;
}

/* Уменьшаем ширину кнопки В КОРЗИНУ */
.woocommerce-variation-add-to-cart .single_add_to_cart_button {
  flex: 0 0 auto !important;
  min-width: 200px;
  max-width: 280px;
  width: 100%;
}


/* Цена на странице товара (только НЕ наш кастомный блок) */
.product-page .woocommerce-Price-amount.amount:not(.dg-price-from *),
.single-product .woocommerce-Price-amount.amount:not(.dg-price-from .woocommerce-Price-amount),
.summary .price:not(.dg-price-from) .woocommerce-Price-amount.amount {
    font-size: 100% !important;
    font-weight: 800 !important;
}

/* ═══════════════════════════════════════════════════════
   ЦЕНА «от X ₽» — вариативные товары
   Формат: «от [перечёркнутая обычная] [акционная]»
   ═══════════════════════════════════════════════════════ */

/* Обёртка цены (заменяет стандартный .price) */
.dg-price-from {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 6px;
    line-height: 1.2;
}

/* Префикс «от» */
.dg-price-from__label {
    font-family: 'Manrope', Arial, sans-serif;
    font-size: 0.6em;
    font-weight: 600;
    color: #888;
    text-transform: lowercase;
    letter-spacing: 0.01em;
    align-self: center;
}

/* Перечёркнутая обычная цена — линия через ::after строго по центру */
.dg-price-from del {
    color: #aaa !important;
    font-size: 18px !important;
    text-decoration: none !important;          /* убираем, рисуем сами */
    font-weight: 500 !important;
    opacity: 1 !important;
    align-self: center;
    vertical-align: middle;
    position: relative;
    display: inline-block;
}
.dg-price-from del::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1.5px;
    background-color: #aaa;
    transform: translateY(-50%);
    pointer-events: none;
}
.dg-price-from del .woocommerce-Price-amount,
.dg-price-from del .woocommerce-Price-amount.amount {
    color: #aaa !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    text-decoration: none !important;
}

/* Акционная (активная) цена */
.dg-price-from ins {
    text-decoration: none !important;
    background: none !important;
    font-weight: 800 !important;
    font-size: 26px !important;
    color: #0078D4 !important;
}
.dg-price-from ins .woocommerce-Price-amount,
.dg-price-from ins .woocommerce-Price-amount.amount {
    color: #0078D4 !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

/* В карточках каталога — компактнее */
.products .dg-price-from {
    flex-direction: row;
    align-items: baseline;
}
.products .dg-price-from ins {
    font-size: 16px !important;
}
.products .dg-price-from del {
    font-size: 13px !important;
}

/* Префикс «от» — одинаково везде */
.dg-price-from__label {
    font-size: 14px !important;
}


