/* Lekamarket product card v2 - overlays Woodmart single product */
body.lekamarket-pcv2 {
  --lm-accent: #ff5a00;
  --lm-accent-hover: #e65000;
  --lm-text: #1a1a1a;
  --lm-muted: #777;
  --lm-line: #e6e6e6;
  --lm-beige: #f3efe8;
  --lm-beige-active: #ebe4d8;
}

/* Sticky gallery + thumbs on the left */
body.lekamarket-pcv2 .product-images {
  position: sticky;
  top: 100px;
  align-self: start;
}

body.lekamarket-pcv2 .woocommerce-product-gallery.thumbs-position-left,
body.lekamarket-pcv2 .woocommerce-product-gallery.thumbs-position-left .wd-gallery-thumb {
  /* Woodmart left thumbs already supported when option is left */
}

/* Hide default print notice - content lives in tab */
body.lekamarket-pcv2 .te-print-product-notice {
  display: none !important;
}

/* Hide default WC/Woodmart description tabs - replaced by lm-product-nav */
body.lekamarket-pcv2 .woocommerce-tabs,
body.lekamarket-pcv2 .wd-accordion.tabs-layout-tabs,
body.lekamarket-pcv2 .wd-single-tabs,
body.lekamarket-pcv2 .product-tabs-wrapper {
  display: none !important;
}

/* Keep reviews in DOM but hide original location until moved */
body.lekamarket-pcv2 .woocommerce-Tabs-panel--reviews,
body.lekamarket-pcv2 #tab-reviews,
body.lekamarket-pcv2 .wd-accordion-item[id*="reviews"] {
  /* JS may move content; if not moved keep accessible via our mount */
}

/* Cart button orange */
body.lekamarket-pcv2 .single_add_to_cart_button,
body.lekamarket-pcv2 button.single_add_to_cart_button.button.alt {
  background: var(--lm-accent) !important;
  border-color: var(--lm-accent) !important;
  color: #fff !important;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 10px !important;
  min-height: 48px;
}

body.lekamarket-pcv2 .single_add_to_cart_button:hover {
  background: var(--lm-accent-hover) !important;
  border-color: var(--lm-accent-hover) !important;
}

/* Title + rating: one full-width row (title left, rating right) */
body.lekamarket-pcv2 .lekamarket-product-title-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  width: 100%;
  margin: 0 0 10px;
  flex-wrap: nowrap;
}

body.lekamarket-pcv2 .lekamarket-product-title-row .product_title {
  margin: 0 !important;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.25;
}

body.lekamarket-pcv2 .lekamarket-product-title-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  flex: 0 0 auto;
  margin: 0 !important;
  margin-left: auto !important;
  text-align: right;
}

body.lekamarket-pcv2 .lekamarket-product-title-rating,
body.lekamarket-pcv2 .lekamarket-product-title-rating .star-rating {
  margin: 0 !important;
  float: none !important;
}

body.lekamarket-pcv2 .lekamarket-product-review-count {
  font-size: 13px;
  color: #999;
  line-height: 1.2;
}

/* Price left + "Определить размер" right */
body.lekamarket-pcv2 .lm-price-size-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body.lekamarket-pcv2 .lm-price-size-row > .price,
body.lekamarket-pcv2 .lm-price-size-row > p.price {
  margin: 0 !important;
  flex: 0 1 auto;
  font-size: 22px !important;
  font-weight: 700;
  line-height: 1.2;
  color: var(--lm-text);
}

body.lekamarket-pcv2 .lm-price-size-row .te-size-link-wrap {
  margin: 0 !important;
  flex: 0 0 auto;
  margin-left: auto !important;
}

/* Size guide link style */
body.lekamarket-pcv2 .te-size-link-wrap .te-size-link {
  background: transparent !important;
  color: #777 !important;
  border: 0 !important;
  text-decoration: underline;
  text-underline-offset: 2px;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: 11px !important;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.2;
}

/* Рост = строка 1, Размер = строка 2, каждая на всю ширину */
body.lekamarket-pcv2 table.variations {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 30px;
  border-collapse: separate;
  border-spacing: 0;
}

body.lekamarket-pcv2 table.variations tbody {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 12px;
}

body.lekamarket-pcv2 table.variations tr {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body.lekamarket-pcv2 table.variations th.label,
body.lekamarket-pcv2 table.variations .label {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start;
  width: 92px;
  min-width: 92px;
  max-width: 92px;
  padding: 0 12px 0 0 !important;
  margin: 0 !important;
  vertical-align: middle !important;
  white-space: normal;
  float: none !important;
  line-height: 1.2;
}

body.lekamarket-pcv2 table.variations td.value,
body.lekamarket-pcv2 table.variations .value {
  display: flex !important;
  align-items: center !important;
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  vertical-align: middle !important;
  float: none !important;
}

body.lekamarket-pcv2 table.variations .label label {
  display: block;
  margin: 0 !important;
  padding: 0 !important;
  font-weight: 700;
  line-height: 1.2;
  position: static !important;
  top: auto !important;
  transform: none !important;
  white-space: pre-line;
}

body.lekamarket-pcv2 table.variations .tawcvs-swatches,
body.lekamarket-pcv2 table.variations .wd-swatches-product {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  width: 100%;
}

/* Price + size guide sit right under height/size rows */
body.lekamarket-pcv2 form.variations_form > .lm-price-size-row {
  margin: 14px 0 12px;
}

.lm-sample-pdf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 6px;
  padding-bottom: 14px;
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  color: #333;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lm-sample-pdf:hover {
  color: var(--lm-accent);
}

.lm-sample-pdf__icon {
  color: var(--lm-accent);
  display: inline-flex;
  flex: 0 0 auto;
}

/* Difficulty + sew time in one row with background */
body.lekamarket-pcv2 .lm-meta-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  margin: 10px 0 14px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  background: var(--lm-beige, #f3efe8);
  border: 1px solid #e8e2d8;
}

body.lekamarket-pcv2 .lm-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

body.lekamarket-pcv2 .lm-meta-line__label {
  font-weight: 700;
  text-transform: lowercase;
}

body.lekamarket-pcv2 .lm-meta-line__value {
  font-weight: 600;
}

body.lekamarket-pcv2 .lm-difficulty {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

body.lekamarket-pcv2 .lm-difficulty__btn {
  display: inline-flex;
  color: #c8c8c8;
  line-height: 0;
}

body.lekamarket-pcv2 .lm-difficulty__btn.is-on {
  color: #2b2b2b;
}

body.lekamarket-pcv2 .lm-difficulty__btn.is-on svg circle[fill="none"] {
  fill: #2b2b2b;
  stroke: #2b2b2b;
}

body.lekamarket-pcv2 .lm-difficulty__btn.is-on svg circle[fill="currentColor"] {
  fill: #fff;
}

body.lekamarket-pcv2 .lm-product-note {
  margin: 10px 0 4px;
  font-size: 13px;
  color: #666;
  line-height: 1.45;
}

body.lekamarket-pcv2 .lm-product-note a {
  color: var(--lm-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Custom tabs block
 * Визуал как раньше: верх — белый ряд из 2, низ — бежевый ряд из 3.
 * Порядок: О выкройке | Как купить  /  Как распечатать | Отзывы | Печать.
 */
.lm-product-nav {
  margin: 18px 0 8px;
  clear: both;
}

.lm-tabs-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-areas:
    "about about about buy buy buy"
    "howto howto reviews reviews print print";
  border: 1px solid #e8e2d8;
  overflow: hidden;
  background: #fff;
}

.lm-tabs-bar__about { grid-area: about; }
.lm-tabs-bar__buy { grid-area: buy; }
.lm-tabs-bar__howto { grid-area: howto; }
.lm-tabs-bar__reviews { grid-area: reviews; }
.lm-tabs-bar__print { grid-area: print; }

.lm-tabs-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 58px;
  padding: 10px 8px;
  border: 0;
  border-right: 1px solid #e0d9ce;
  border-bottom: 1px solid #e0d9ce;
  background: var(--lm-beige);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #888;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

/* Верхний ряд — белый фон (как «как купить / распечатать» раньше) */
.lm-tabs-bar__about,
.lm-tabs-bar__buy {
  background: #fff;
  color: var(--lm-text);
  min-height: 48px;
  border-bottom: 1px solid var(--lm-line, #e8e2d8);
}

.lm-tabs-bar__about.is-active {
  background: #fff;
  color: var(--lm-text);
}

.lm-tabs-bar__buy {
  border-right: 0;
}

/* Нижний ряд — беж */
.lm-tabs-bar__howto,
.lm-tabs-bar__reviews,
.lm-tabs-bar__print {
  border-bottom: 0;
  background: var(--lm-beige);
}

.lm-tabs-bar__howto {
  color: var(--lm-text);
}

.lm-tabs-bar__print {
  border-right: 0;
}

a.lm-tabs-bar__link:hover {
  color: var(--lm-accent);
}

.lm-tabs-bar__item.is-active:not(.lm-tabs-bar__about) {
  color: var(--lm-text);
  background: var(--lm-beige-active);
}

.lm-tabs-bar__reviews.is-active {
  background: var(--lm-beige-active);
  color: var(--lm-text);
}

.lm-tabs-bar__print.is-active {
  background: var(--lm-beige-active);
  color: var(--lm-text);
}

.lm-tabs-bar__bonus {
  font-size: 9px;
  font-weight: 700;
  color: var(--lm-accent);
  line-height: 1.2;
}

.lm-tab-panel {
  display: none;
  padding-top: 6px;
  border-bottom: 1px solid #eee;
  margin-bottom: 8px;
}

.lm-tab-panel.is-active {
  display: block;
}

.lm-accordion__item {
  border-bottom: 1px solid #eee;
}

.lm-accordion__item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--lm-text);
}

.lm-accordion__item summary::-webkit-details-marker {
  display: none;
}

.lm-accordion__item summary::before {
  content: ">";
  color: #999;
  transition: transform 0.15s ease;
}

.lm-accordion__item[open] summary::before {
  transform: rotate(90deg);
}

.lm-accordion__body {
  padding: 0 0 14px 18px;
  font-size: 14px;
  color: #444;
  line-height: 1.55;
}

.lm-accordion__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 8px 0;
}

.lm-accordion__body th,
.lm-accordion__body td {
  border: 1px solid var(--lm-line);
  padding: 8px 10px;
}

.lm-reviews-promo {
  display: block;
  width: 100%;
  margin: 14px 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 4px;
  background: #e8e6f2;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.4;
  color: var(--lm-text);
  cursor: pointer;
}

.lm-reviews-promo:hover {
  background: #ddd9ef;
}

.lm-reviews-mount .review__name,
.lm-reviews-mount .comment-author,
.lm-reviews-mount .woocommerce-review__author,
body.lekamarket-pcv2 .lm-reviews-mount .meta strong {
  color: var(--lm-text) !important;
}

.lm-print-tab {
  padding: 14px 0 18px;
}

.lm-print-tab h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
}

.lm-print-tab p,
.lm-print-tab li {
  font-size: 14px;
  color: #444;
  line-height: 1.55;
}

.lm-print-tab ul {
  margin: 0 0 14px;
  padding-left: 18px;
}

.lm-print-tab li {
  margin-bottom: 8px;
}

.lm-print-tab__more a {
  color: var(--lm-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lm-btn-print {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--lm-accent);
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none !important;
}

.lm-btn-print:hover {
  background: var(--lm-accent-hover);
  color: #fff !important;
}

@media (max-width: 768px) {
  body.lekamarket-pcv2 .product-images {
    position: static;
  }

  .lm-tabs-bar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "about"
      "buy"
      "howto"
      "reviews"
      "print";
  }

  .lm-tabs-bar__item {
    border-right: 0;
    border-bottom: 1px solid #e0d9ce;
    min-height: 48px;
  }

  .lm-tabs-bar__about,
  .lm-tabs-bar__buy {
    background: #fff;
    color: var(--lm-text);
  }

  .lm-tabs-bar__howto,
  .lm-tabs-bar__reviews,
  .lm-tabs-bar__print {
    background: var(--lm-beige);
  }

  .lm-tabs-bar__print {
    border-bottom: 0;
  }
}
