/* nordin-pdp-ux — variable PDP cards + buy-info (issue staging) */

/* FOUC: Kangas/Käelisus until JS; kombinatsioon is SSR */
body.nordin-pdp-ux:not(.nordin-pdp-ux-ready) form.variations_form table.variations tr:has(select[name="attribute_kangas"]),
body.nordin-pdp-ux:not(.nordin-pdp-ux-ready) form.variations_form table.variations tr:has(select[name="attribute_kaelisus-eestvaates"]) {
  display: none !important;
}

/* Short description SSR under gallery — never flash in summary */
body.nordin-pdp-ux .summary .woocommerce-product-details__short-description,
body.nordin-pdp-ux .entry-summary .woocommerce-product-details__short-description,
body.nordin-pdp-ux .product-summary .woocommerce-product-details__short-description {
  display: none !important;
}

body.nordin-pdp-ux .nordin-gallery-description .woocommerce-product-details__short-description {
  display: block !important;
}

/* SSR cards sit above table.variations inside the form */
body.nordin-pdp-ux form.variations_form > .nordin-variation-cards[data-ssr="1"] {
  margin: 4px 0 10px;
}

body.nordin-pdp-ux .nordin-buy-info {
  margin: 14px 0 16px;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

body.nordin-pdp-ux .nordin-buy-info .info-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

body.nordin-pdp-ux .nordin-buy-info .info-card:last-child {
  border-bottom: 0;
}

body.nordin-pdp-ux .nordin-buy-info strong {
  display: block;
  margin: 0;
  color: #222;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .04em;
}

body.nordin-pdp-ux .nordin-buy-info span {
  color: #606060;
  font-size: 13px;
  line-height: 1.45;
}

/* Basel variations td often has padding-bottom: 25px - collapses our block gaps */
body.nordin-pdp-ux tr.nordin-variation-cards-row > td,
body.nordin-pdp-ux tr.nordin-kaelisus-visual-row > td,
body.nordin-pdp-ux tr.nordin-kangas-swatches-row > td {
  padding: 0 !important;
  vertical-align: top;
}

body.nordin-pdp-ux .nordin-variation-cards {
  margin: 4px 0 6px;
}

body.nordin-pdp-ux .nordin-variation-cards-title {
  display: block;
  margin-bottom: 6px;
  color: #222;
  font-size: 13px;
  font-weight: 700;
}

body.nordin-pdp-ux .nordin-variation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  max-width: 560px;
}

body.nordin-pdp-ux .nordin-variation-more {
  margin-top: 6px;
  max-width: 560px;
}

body.nordin-pdp-ux .nordin-variation-more-toggle {
  display: inline-flex;
  align-items: center;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e77d59;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.nordin-pdp-ux .nordin-variation-more-toggle:hover {
  color: #c45f3d;
}

body.nordin-pdp-ux .nordin-variation-grid--more[hidden] {
  display: none !important;
}

body.nordin-pdp-ux .nordin-variation-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 0;
  margin: 0 !important;
  padding: 5px;
  border: 1px solid #dedbd5;
  background: #fff;
  color: #333;
  text-align: left;
  cursor: pointer;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  box-shadow: none;
}

body.nordin-pdp-ux .nordin-variation-card.is-active,
body.nordin-pdp-ux .nordin-variation-card:hover {
  border-color: #e77d59;
  box-shadow: inset 0 0 0 1px #e77d59;
}

body.nordin-pdp-ux .nordin-variation-card img {
  width: 72px !important;
  height: 72px !important;
  object-fit: cover;
  object-position: center;
  display: block;
}

body.nordin-pdp-ux .nordin-variation-card span {
  display: block;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0;
}

body.nordin-pdp-ux .variations tr.nordin-hidden-variation-row {
  display: none !important;
}

body.nordin-pdp-ux .woocommerce-variation-add-to-cart {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 8px !important;
}

/* Uniform gallery thumbs: variation swap can inject landscape gallery_thumbnail */
body.nordin-pdp-ux .product-images .thumbnails .owl-item {
  aspect-ratio: 1 / 1;
}

body.nordin-pdp-ux .product-images .thumbnails .owl-item img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  object-position: center;
  display: block;
}

body.nordin-pdp-ux .nordin-gallery-description {
  margin: 28px 0 0;
  padding-top: 22px;
  border-top: 1px solid #eee;
  max-width: 620px;
}

body.nordin-pdp-ux .nordin-gallery-description .woocommerce-product-details__short-description {
  margin: 0 !important;
}

body.nordin-pdp-ux .nordin-gallery-description p {
  color: #4f4f4f;
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 13px;
}

/* Kangas swatches - one family at a time */
body.nordin-pdp-ux .nordin-kangas-swatches {
  margin: 4px 0 6px;
  max-width: 560px;
}

body.nordin-pdp-ux .nordin-kangas-title {
  display: block;
  margin-bottom: 5px;
  color: #222;
  font-size: 13px;
  font-weight: 700;
}

body.nordin-pdp-ux .nordin-kangas-selected {
  min-height: 1.1em;
  margin: 0 0 6px;
  color: #606060;
  font-size: 11px;
}

body.nordin-pdp-ux .nordin-kangas-families {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 3px 4px;
  margin: 0 0 8px;
  max-height: none;
  overflow: visible;
  line-height: 1;
}

body.nordin-pdp-ux .nordin-kangas-family {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  margin: 0 !important; /* Basel/button default often adds 20px bottom */
  padding: 2px 7px;
  border: 1px solid #dedbd5;
  background: #fff;
  color: #444;
  font-size: 11px;
  line-height: 1.15;
  cursor: pointer;
  border-radius: 0;
  min-height: 0;
}

body.nordin-pdp-ux .nordin-kangas-family.is-active,
body.nordin-pdp-ux .nordin-kangas-family:hover {
  border-color: #e77d59;
  color: #222;
  box-shadow: inset 0 0 0 1px #e77d59;
}

body.nordin-pdp-ux .nordin-kangas-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

body.nordin-pdp-ux .nordin-kangas-swatch {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  margin: 0 !important;
  padding: 2px;
  border: 1px solid #dedbd5;
  background: #fff;
  cursor: pointer;
  border-radius: 0;
  aspect-ratio: 1 / 1;
  min-height: 0;
}

body.nordin-pdp-ux .nordin-kangas-swatch.is-active,
body.nordin-pdp-ux .nordin-kangas-swatch:hover {
  border-color: #e77d59;
  box-shadow: inset 0 0 0 1px #e77d59;
}

body.nordin-pdp-ux .nordin-kangas-swatch img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

body.nordin-pdp-ux .nordin-kangas-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #eceae6;
  color: #777;
  font-size: 11px;
}

/* Käelisus visual - L/R only when kombinatsioon needs it */
body.nordin-pdp-ux .nordin-kaelisus-visual {
  margin: 4px 0 6px;
  max-width: 560px;
}

body.nordin-pdp-ux .nordin-kaelisus-visual[hidden],
body.nordin-pdp-ux tr.nordin-kaelisus-visual-row[hidden] {
  display: none !important;
}

body.nordin-pdp-ux .nordin-kaelisus-title {
  display: block;
  margin-bottom: 5px;
  color: #222;
  font-size: 13px;
  font-weight: 700;
}

body.nordin-pdp-ux .nordin-kaelisus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 120px));
  gap: 4px;
}

body.nordin-pdp-ux .nordin-kaelisus-chip {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  padding: 3px 6px 3px 3px;
  border: 1px solid #dedbd5;
  background: #fff;
  color: #333;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  min-height: 0;
}

body.nordin-pdp-ux .nordin-kaelisus-chip.is-active,
body.nordin-pdp-ux .nordin-kaelisus-chip:hover {
  border-color: #e77d59;
  box-shadow: inset 0 0 0 1px #e77d59;
}

body.nordin-pdp-ux .nordin-kaelisus-label {
  font-size: 11px;
  line-height: 1.2;
}

body.nordin-pdp-ux .nordin-kaelisus-icon {
  display: block;
  width: 28px;
  height: 18px;
  position: relative;
  background: #f3f1ed;
  border: 1px solid #d5d1c9;
}

/* Simple chaise marker: thick end = chaise/arm side from viewer */
body.nordin-pdp-ux .nordin-kaelisus-icon--left::after,
body.nordin-pdp-ux .nordin-kaelisus-icon--right::after {
  content: '';
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 8px;
  background: #e77d59;
}

body.nordin-pdp-ux .nordin-kaelisus-icon--left::after {
  left: 2px;
}

body.nordin-pdp-ux .nordin-kaelisus-icon--right::after {
  right: 2px;
}

@media (max-width: 767px) {
  body.nordin-pdp-ux .nordin-variation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  /* Image-led cards; text stays small for density */
  body.nordin-pdp-ux .nordin-variation-card {
    grid-template-columns: 68px minmax(0, 1fr);
    padding: 5px;
    gap: 5px;
  }

  body.nordin-pdp-ux .nordin-variation-card img {
    width: 68px !important;
    height: 68px !important;
  }

  body.nordin-pdp-ux .nordin-variation-card span {
    font-size: 10px;
    line-height: 1.2;
  }

  body.nordin-pdp-ux .nordin-kangas-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
  }

  body.nordin-pdp-ux .nordin-kangas-swatch {
    padding: 2px;
  }

  body.nordin-pdp-ux .nordin-kaelisus-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 260px;
    gap: 4px;
  }

  body.nordin-pdp-ux .nordin-kaelisus-chip {
    padding: 5px 8px 5px 4px;
  }
}
