
/* ======================================================
   CD-DUPLICATION.COM
   GLOBAL WOOCOMMERCE SINGLE PRODUCT STYLES

   Styles product descriptions, tabs and related products.
   Leaves the Varinkio configurator, product gallery,
   prices and Add to Cart controls unchanged.

   Important: This stylesheet should be loaded only on
   WooCommerce single-product pages (is_product()).
====================================================== */

body.single-product {
  --cdx-product-max-width: 1150px;
  --cdx-product-purple: #2f029e;
  --cdx-product-violet: #a648ed;
  --cdx-product-gold: #fccf42;
  --cdx-product-text: #21143e;
  --cdx-product-muted: #706580;
  --cdx-product-border: #e8dff4;
}

/* ======================================================
   01 — CONTENT WIDTH
====================================================== */

body.single-product .woocommerce-tabs {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  clear: both;
}

body.single-product .related.products,
body.single-product .upsells.products {
  box-sizing: border-box;
  width: calc(100% - 40px) !important;
  max-width: var(--cdx-product-max-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  float: none !important;
  clear: both;
}

/* ======================================================
   02 — DESCRIPTION PANEL AND TABS
====================================================== */

body.single-product .woocommerce-tabs {
  margin-top: 45px;
  margin-bottom: 55px;
}

/* Standard WooCommerce tabs */

body.single-product .woocommerce-tabs ul.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  background: transparent;
}

body.single-product .woocommerce-tabs ul.tabs::before,
body.single-product .woocommerce-tabs ul.tabs::after {
  border: 0;
}

body.single-product .woocommerce-tabs ul.tabs li {
  margin: 0;
  padding: 0;
  border: 1px solid var(--cdx-product-border);
  border-radius: 10px;
  background: #f7f2ff;
}

body.single-product .woocommerce-tabs ul.tabs li a {
  display: block;
  padding: 12px 20px;
  color: var(--cdx-product-purple);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

body.single-product .woocommerce-tabs ul.tabs li.active {
  border-color: var(--cdx-product-purple);
  background: var(--cdx-product-purple);
}

body.single-product .woocommerce-tabs ul.tabs li.active a {
  color: #ffffff;
}

/* Hide navigation when Description is the only tab */

body.single-product
.woocommerce-tabs:has(> ul.tabs > li:only-child)
> ul.tabs {
  display: none !important;
}

/* Keep description visible */

body.single-product
.woocommerce-tabs:has(> ul.tabs > li:only-child)
#tab-description {
  display: block !important;
}

/* ======================================================
   DESCRIPTION CARD — CORRECTED WIDTH

   Matches the actual #tab-description element
   identified in Chrome DevTools.
====================================================== */

body.single-product
.woocommerce-tabs > div#tab-description.woocommerce-Tabs-panel {
  box-sizing: border-box !important;

  width: calc(100% - 40px) !important;
  max-width: var(--cdx-product-max-width) !important;

  margin: 0 auto !important;

  float: none !important;
  clear: both;

  padding: clamp(25px, 4vw, 48px);

  border: 1px solid var(--cdx-product-border);
  border-radius: 14px;

  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(166, 72, 237, .055),
      transparent 38%
    ),
    #ffffff;

  box-shadow: 0 12px 35px rgba(47, 2, 158, .035);
}

/* ======================================================
   03 — DESCRIPTION TYPOGRAPHY
====================================================== */

body.single-product #tab-description h2 {
  margin: 0 0 20px;
  color: var(--cdx-product-text);
  font-size: clamp(26px, 3vw, 35px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.035em;
}

body.single-product #tab-description h3 {
  margin: 35px 0 20px;
  color: var(--cdx-product-text);
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 800;
  line-height: 1.3;
}

body.single-product #tab-description h4 {
  margin: 23px 0 12px;
  color: var(--cdx-product-text);
  font-size: 18px;
  font-weight: 750;
}

body.single-product #tab-description p {
  margin: 0 0 19px;
  color: var(--cdx-product-muted);
  font-size: 14.5px;
  line-height: 1.85;
}

/* Introductory paragraph */

body.single-product
#tab-description > p:first-of-type {
  max-width: 900px;
  font-size: 16px;
  line-height: 1.85;
  color: #625674;
}

/* Strong text */

body.single-product #tab-description strong {
  color: var(--cdx-product-text);
  font-weight: 800;
}

/* Internal links */

body.single-product #tab-description a {
  color: var(--cdx-product-purple);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.single-product #tab-description a:hover {
  color: var(--cdx-product-violet);
}

/* ======================================================
   04 — PRODUCT DESCRIPTION LISTS
   PACKAGING STYLE CARDS
====================================================== */

body.single-product #tab-description ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;

  margin: 18px 0 28px;
  padding: 0;

  list-style: none;
}

body.single-product #tab-description ul > li {
  position: relative;
  min-width: 0;

  margin: 0;
  padding: 18px 19px 18px 45px;

  border: 1px solid var(--cdx-product-border);
  border-radius: 12px;

  background: #faf8ff;
  color: #655875;

  font-size: 13px;
  line-height: 1.75;
}

/* Check icon */

body.single-product #tab-description ul > li::before {
  content: "✓";

  position: absolute;
  top: 19px;
  left: 18px;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 19px;
  height: 19px;

  border-radius: 50%;
  background: #ede2ff;
  color: var(--cdx-product-purple);

  font-size: 12px;
  font-weight: 800;
}

/* ======================================================
   05 — RELATED PRODUCTS AND UPSELLS
====================================================== */

body.single-product .related.products,
body.single-product .upsells.products {
  margin-top: 50px !important;
  margin-bottom: 80px !important;
}

/* Section headings */

body.single-product .related.products > h2,
body.single-product .upsells.products > h2 {
  margin: 0 0 27px;
  color: var(--cdx-product-text);

  font-size: clamp(25px, 3vw, 33px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.03em;
}

/* Product grid */

body.single-product .related.products ul.products,
body.single-product .upsells.products ul.products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;

  margin: 0;
  padding: 0;
}

body.single-product .related.products ul.products::before,
body.single-product .related.products ul.products::after,
body.single-product .upsells.products ul.products::before,
body.single-product .upsells.products ul.products::after {
  display: none;
}

/* Product cards */

body.single-product .related.products ul.products li.product,
body.single-product .upsells.products ul.products li.product {
  box-sizing: border-box;
  float: none !important;

  width: auto !important;
  max-width: none;

  margin: 0 !important;
  padding: 15px;

  border: 1px solid var(--cdx-product-border);
  border-radius: 17px;

  background: #ffffff;
  overflow: hidden;

  transition:
    transform .3s ease,
    box-shadow .3s ease,
    border-color .3s ease;
}

/* Hover effects */

body.single-product .related.products ul.products li.product:hover,
body.single-product .upsells.products ul.products li.product:hover {
  transform: translateY(-5px);
  border-color: #d4baf1;
  box-shadow: 0 16px 35px rgba(47, 2, 158, .07);
}

/* Product images */

body.single-product .related.products ul.products li.product img,
body.single-product .upsells.products ul.products li.product img {
  display: block;

  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;

  margin: 0 0 17px;
  padding: 12px;

  border-radius: 11px;
  background: #f7f2ff;
}

/* Product titles */

body.single-product
.related.products .woocommerce-loop-product__title,
body.single-product
.upsells.products .woocommerce-loop-product__title {
  color: var(--cdx-product-text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
}

/* Product prices */

body.single-product .related.products .price,
body.single-product .upsells.products .price {
  color: var(--cdx-product-purple);
  font-size: 15px;
  font-weight: 800;
}

/* Product buttons */

body.single-product .related.products .button,
body.single-product .upsells.products .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 15px;
  padding: 14px 22px;
  border: none;
  border-radius: 9px;
  background: var(--cdx-product-purple);
  color: #ffffff;
  font-size: 14px;
  text-decoration: none;
}

body.single-product .related.products .button:hover,
body.single-product .upsells.products .button:hover {
  background: var(--cdx-product-violet);
  color: #ffffff;
}

/* Keyboard accessibility */

body.single-product .related.products a:focus-visible,
body.single-product .upsells.products a:focus-visible,
body.single-product .woocommerce-tabs a:focus-visible {
  outline: 3px solid var(--cdx-product-gold);
  outline-offset: 3px;
}

/* ======================================================
   06 — RESPONSIVE DESIGN
====================================================== */

/* Tablet */

@media (max-width: 900px) {

  body.single-product .related.products ul.products,
  body.single-product .upsells.products ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

/* Smaller tablets */

@media (max-width: 767px) {

  body.single-product .woocommerce-tabs {
    margin-top: 30px;
  }

  body.single-product
  #tab-description > p:first-of-type {
    font-size: 14px;
  }

}

/* Mobile */

@media (max-width: 650px) {

  body.single-product .woocommerce-tabs {
    margin-bottom: 35px;
  }

  body.single-product
  .woocommerce-tabs > div#tab-description.woocommerce-Tabs-panel,
  body.single-product .related.products,
  body.single-product .upsells.products {
    width: calc(100% - 30px) !important;
  }

  body.single-product
  .woocommerce-tabs > div#tab-description.woocommerce-Tabs-panel {
    padding: 23px 20px;
    border-radius: 15px;
  }

  body.single-product #tab-description ul,
  body.single-product .related.products ul.products,
  body.single-product .upsells.products ul.products {
    grid-template-columns: 1fr;
  }

  body.single-product .related.products,
  body.single-product .upsells.products {
    margin-bottom: 55px !important;
  }

}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {

  body.single-product .related.products li.product,
  body.single-product .upsells.products li.product {
    transition: none;
  }

}
