/*
 * Xright single product page styling.
 * Visual layer only: WooCommerce retains product data, gallery behaviour,
 * variations, stock, cart actions, tabs, reviews and related-product queries.
 */
body.single-product .site-main,
body.single-product .content-area {
  min-width: 0;
}

body.single-product div.product {
  /* Keep the main product content in a predictable vertical flow.
     This prevents parent theme/plugin flex rules from placing the
     gallery and summary side-by-side. */
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch;
  gap: 28px;
  margin: 0 0 44px;
}

body.single-product div.product > div.images,
body.single-product div.product > div.summary {
  float: none !important;
  clear: both;
  width: 100% !important;
  max-width: 100%;
  flex: 0 0 auto;
}

body.single-product div.product div.images,
body.single-product div.product div.summary {
  float: none;
  width: auto;
  margin: 0;
  min-width: 0;
}

/* Gallery */
body.single-product div.product div.images {
  position: relative;
  padding: 18px;
  border: 1px solid var(--xr-border, #e3eae3);
  border-radius: 16px;
  background: var(--xr-white, #fff);
  box-shadow: var(--xr-shadow-sm, 0 2px 6px rgba(15,40,20,.05));
}

body.single-product .woocommerce-product-gallery {
  opacity: 1 !important;
}

body.single-product .woocommerce-product-gallery__wrapper {
  margin: 0;
}

body.single-product .woocommerce-product-gallery__image {
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
}

body.single-product .woocommerce-product-gallery__image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 620px;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
}

body.single-product .woocommerce-product-gallery .flex-control-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
}

body.single-product .woocommerce-product-gallery .flex-control-thumbs li {
  float: none;
  width: 76px;
  margin: 0;
  padding: 5px;
  overflow: hidden;
  border: 1px solid var(--xr-border, #e3eae3);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

body.single-product .woocommerce-product-gallery .flex-control-thumbs li img {
  width: 100%;
  height: 66px;
  object-fit: contain;
  opacity: .72;
  transition: opacity .18s ease, border-color .18s ease;
}

body.single-product .woocommerce-product-gallery .flex-control-thumbs li img.flex-active,
body.single-product .woocommerce-product-gallery .flex-control-thumbs li:hover img {
  opacity: 1;
}

/* Purchase information */
body.single-product div.product .product_title {
  margin: 0 0 14px;
  color: var(--xr-text, #17211a);
  font-size: clamp(25px, 2.5vw, 34px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.025em;
}

body.single-product div.product .summary {
  padding: 4px 0;
}

body.single-product div.product .woocommerce-product-rating {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 15px;
  font-size: 13px;
}

body.single-product div.product .woocommerce-product-rating .star-rating {
  float: none;
  margin: 0;
  color: #e89a16;
}

body.single-product div.product .woocommerce-product-rating a {
  color: var(--xr-text-secondary, #66736a);
  text-decoration: none;
}

body.single-product div.product p.price,
body.single-product div.product span.price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px 12px;
  margin: 0 0 18px;
  color: var(--xr-green, #09450a);
  font-size: clamp(25px, 2.5vw, 32px);
  font-weight: 750;
  line-height: 1.2;
}

body.single-product div.product p.price del,
body.single-product div.product span.price del {
  color: var(--xr-text-muted, #8a968d);
  font-size: 16px;
  font-weight: 400;
  opacity: 1;
}

body.single-product div.product p.price ins,
body.single-product div.product span.price ins {
  color: var(--xr-green, #09450a);
  text-decoration: none;
}

body.single-product div.product .stock {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 17px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--xr-green-soft, #f1f7f0);
  color: var(--xr-green, #09450a);
  font-size: 12px;
  font-weight: 650;
}

body.single-product div.product .stock.out-of-stock {
  background: #fff0ef;
  color: #b42318;
}

body.single-product div.product .woocommerce-product-details__short-description {
  margin: 0 0 20px;
  color: var(--xr-text-secondary, #66736a);
  font-size: 14px;
  line-height: 1.75;
}

body.single-product div.product form.cart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
}

body.single-product div.product form.cart .quantity {
  margin: 0;
}

body.single-product div.product form.cart .quantity .qty {
  width: 76px;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--xr-border-dark, #cdd7ce);
  border-radius: 8px;
  background: #fff;
  color: var(--xr-text, #17211a);
  font-size: 15px;
  text-align: center;
}

body.single-product div.product form.cart .single_add_to_cart_button {
  min-height: 48px;
  flex: 1 1 190px;
  padding: 12px 22px;
  border: 1px solid var(--xr-green, #09450a);
  border-radius: 8px;
  background: var(--xr-green, #09450a);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

body.single-product div.product form.cart .single_add_to_cart_button:hover {
  border-color: var(--xr-orange, #f28c00);
  background: var(--xr-orange, #f28c00);
  color: #17211a;
}

body.single-product div.product form.cart .single_add_to_cart_button:disabled,
body.single-product div.product form.cart .single_add_to_cart_button.disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Variable product selectors */
body.single-product div.product form.variations_form {
  display: block;
}

body.single-product div.product table.variations {
  width: 100%;
  margin: 0 0 16px;
  border: 0;
}

body.single-product div.product table.variations th,
body.single-product div.product table.variations td {
  display: block;
  padding: 5px 0;
  border: 0;
  text-align: left;
}

body.single-product div.product table.variations label {
  color: var(--xr-text, #17211a);
  font-size: 13px;
  font-weight: 650;
}

body.single-product div.product table.variations select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--xr-border-dark, #cdd7ce);
  border-radius: 8px;
  background: #fff;
  color: var(--xr-text, #17211a);
}

body.single-product div.product .reset_variations {
  margin-left: 8px;
  color: var(--xr-green, #09450a);
  font-size: 12px;
}

body.single-product div.product .woocommerce-variation-price {
  margin: 8px 0 12px;
}

body.single-product div.product .woocommerce-variation-availability {
  margin: 0 0 10px;
}

/* Product metadata and notices */
body.single-product div.product .product_meta {
  display: grid;
  gap: 7px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--xr-border, #e3eae3);
  color: var(--xr-text-secondary, #66736a);
  font-size: 12px;
  line-height: 1.5;
}

body.single-product div.product .product_meta a {
  color: var(--xr-green, #09450a);
  text-decoration: none;
}

body.single-product .woocommerce-message,
body.single-product .woocommerce-info,
body.single-product .woocommerce-error {
  border-top-color: var(--xr-green, #09450a);
  border-radius: 8px;
  box-shadow: var(--xr-shadow-sm);
}

/* Description, additional information and reviews */
body.single-product .woocommerce-tabs {
  clear: both;
  margin: 42px 0 48px;
  padding: 0;
}

body.single-product .woocommerce-tabs ul.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

body.single-product .woocommerce-tabs ul.tabs::before,
body.single-product .woocommerce-tabs ul.tabs::after {
  display: none;
}

body.single-product .woocommerce-tabs ul.tabs li {
  margin: 0;
  padding: 0;
  border: 1px solid var(--xr-border, #e3eae3);
  border-radius: 8px;
  background: #fff;
}

body.single-product .woocommerce-tabs ul.tabs li::before,
body.single-product .woocommerce-tabs ul.tabs li::after {
  display: none;
}

body.single-product .woocommerce-tabs ul.tabs li a {
  display: block;
  padding: 11px 16px;
  color: var(--xr-text-secondary, #66736a);
  font-size: 13px;
  font-weight: 650;
}

body.single-product .woocommerce-tabs ul.tabs li.active {
  border-color: var(--xr-green, #09450a);
  background: var(--xr-green-soft, #f1f7f0);
}

body.single-product .woocommerce-tabs ul.tabs li.active a {
  color: var(--xr-green, #09450a);
}

body.single-product .woocommerce-Tabs-panel {
  color: var(--xr-text-secondary, #66736a);
  font-size: 14px;
  line-height: 1.8;
}

body.single-product .woocommerce-Tabs-panel > h2,
body.single-product #reviews h2,
body.single-product #reviews #comments h2 {
  margin: 0 0 16px;
  color: var(--xr-text, #17211a);
  font-size: 21px;
  font-weight: 700;
}

body.single-product .woocommerce-Tabs-panel table.shop_attributes {
  border: 1px solid var(--xr-border, #e3eae3);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
}

body.single-product .woocommerce-Tabs-panel table.shop_attributes th,
body.single-product .woocommerce-Tabs-panel table.shop_attributes td {
  padding: 11px 14px;
  border-color: var(--xr-border, #e3eae3);
  background: #fff;
  font-size: 13px;
}

body.single-product #reviews #comments ol.commentlist {
  padding: 0;
}

body.single-product #reviews #comments ol.commentlist li .comment-text {
  margin-left: 58px;
  padding: 14px;
  border: 1px solid var(--xr-border, #e3eae3);
  border-radius: 9px;
}

body.single-product #review_form_wrapper {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--xr-border, #e3eae3);
  border-radius: 12px;
  background: #fff;
}

body.single-product #review_form_wrapper input[type="text"],
body.single-product #review_form_wrapper input[type="email"],
body.single-product #review_form_wrapper textarea {
  width: 100%;
  border: 1px solid var(--xr-border-dark, #cdd7ce);
  border-radius: 7px;
}

/* Related and upsell products reuse the existing Xright product card styling. */
body.single-product section.related,
body.single-product section.upsells {
  clear: both;
  margin: 44px 0 0;
}

body.single-product section.related > h2,
body.single-product section.upsells > h2 {
  margin: 0 0 20px;
  color: var(--xr-text, #17211a);
  font-size: clamp(21px, 2vw, 27px);
  font-weight: 700;
}

/* Sale bubble on the single-product gallery. */
body.single-product div.product .onsale {
  z-index: 5;
  top: 28px !important;
  left: 28px !important;
  right: auto !important;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--xr-orange, #f28c00);
  color: #17211a;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

@media (max-width: 768px) {
  body.single-product div.product {
    display: flex !important;
    flex-direction: column !important;
    gap: 22px;
    margin-bottom: 30px;
  }

  body.single-product div.product div.images,
  body.single-product div.product div.summary {
    width: 100%;
  }

  body.single-product div.product div.images {
    padding: 12px;
    border-radius: 12px;
  }

  body.single-product .woocommerce-product-gallery__image img {
    max-height: 440px;
  }

  body.single-product .woocommerce-product-gallery .flex-control-thumbs {
    gap: 7px;
    margin-top: 10px;
  }

  body.single-product .woocommerce-product-gallery .flex-control-thumbs li {
    width: 62px;
    padding: 4px;
  }

  body.single-product .woocommerce-product-gallery .flex-control-thumbs li img {
    height: 54px;
  }

  body.single-product div.product .product_title {
    margin-bottom: 10px;
    font-size: 25px;
  }

  body.single-product div.product p.price,
  body.single-product div.product span.price {
    font-size: 27px;
  }

  body.single-product div.product form.cart {
    gap: 9px;
    margin-top: 18px;
  }

  body.single-product div.product form.cart .quantity .qty {
    min-height: 46px;
    width: 68px;
  }

  body.single-product div.product form.cart .single_add_to_cart_button {
    min-height: 46px;
    padding-inline: 14px;
  }

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

  body.single-product .woocommerce-tabs ul.tabs {
    gap: 6px;
  }

  body.single-product .woocommerce-tabs ul.tabs li a {
    padding: 9px 11px;
    font-size: 12px;
  }

  body.single-product div.product .onsale {
    top: 20px !important;
    left: 20px !important;
  }

  body.single-product section.related,
  body.single-product section.upsells {
    margin-top: 32px;
  }
}

@media (max-width: 420px) {
  body.single-product div.product .product_title {
    font-size: 22px;
  }

  body.single-product div.product form.cart {
    align-items: stretch;
  }

  body.single-product div.product form.cart .quantity .qty {
    height: 46px;
  }

  body.single-product div.product form.cart .single_add_to_cart_button {
    flex-basis: 150px;
  }

  body.single-product #review_form_wrapper {
    padding: 14px;
  }
}
