/* ============================================================
   XP Single Product — woo-single-product.css
   Bootstrap 5 custom WooCommerce theme
   Import in: functions.php  wp_enqueue_style( 'xp-single', ... )
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --xp-primary:       #0a5aff;
  --xp-primary-dark:  #0048d4;
  --xp-primary-rgb:   10, 90, 255;
  --xp-dark:          #0d1117;
  --xp-text:          #1a1a2e;
  --xp-muted:         #64748b;
  --xp-light:         #f4f7ff;
  --xp-border:        #e2e8f4;
  --xp-white:         #ffffff;
  --xp-green:         #16a34a;
  --xp-red:           #dc2626;
  --xp-star:          #f59e0b;
  --xp-radius:        0.75rem;
  --xp-radius-sm:     0.5rem;
  --xp-shadow:        0 4px 24px rgba(10, 90, 255, 0.08);
  --xp-shadow-hover:  0 8px 32px rgba(10, 90, 255, 0.16);
  --xp-transition:    0.22s ease;
}

/* ── Page wrapper ── */
.xp-single {
  background: #f0f4fc;
  padding: 1.75rem 0 4rem;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.xp-breadcrumb {
  margin-bottom: 1.25rem;
}
.xp-breadcrumb .woocommerce-breadcrumb {
  font-size: 0.82rem;
  color: var(--xp-muted);
  background: none;
  padding: 0;
  margin: 0;
}
.xp-breadcrumb .woocommerce-breadcrumb a {
  color: var(--xp-muted);
  text-decoration: none;
  transition: color var(--xp-transition);
}
.xp-breadcrumb .woocommerce-breadcrumb a:hover {
  color: var(--xp-primary);
}

/* ============================================================
   GALLERY
   ============================================================ */
.xp-gallery {
  position: sticky;
  top: 90px;
}

.xp-gallery__main {
  position: relative;
  background: var(--xp-light);
  border: 1.5px solid var(--xp-border);
  border-radius: var(--xp-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  padding: 2rem;
  overflow: hidden;
  margin-bottom: 0.875rem;
}

.xp-gallery__img {
  max-height: 280px;
  max-width: 100%;
  object-fit: contain;
  transition: opacity 0.18s ease, transform 0.3s ease;
}
.xp-gallery__img.is-loading {
  opacity: 0;
  transform: scale(0.97);
}

/* Badges */
.xp-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  line-height: 1;
  z-index: 2;
}
.xp-badge--sale {
  background: var(--xp-primary);
  color: #fff;
}
.xp-badge--oos {
  background: var(--xp-red);
  color: #fff;
}

/* Wishlist button */
.xp-wishlist-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--xp-white);
  border: 1.5px solid var(--xp-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #9ca3af;
  transition: all var(--xp-transition);
  z-index: 2;
  padding: 0;
}
.xp-wishlist-btn:hover,
.xp-wishlist-btn.is-active {
  color: var(--xp-red);
  border-color: var(--xp-red);
  background: #fff1f2;
}

/* Thumbnails */
.xp-gallery__thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.xp-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--xp-radius-sm);
  border: 2px solid var(--xp-border);
  background: var(--xp-light);
  padding: 0.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--xp-transition), box-shadow var(--xp-transition);
  overflow: hidden;
}
.xp-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.xp-thumb:hover,
.xp-thumb.is-active {
  border-color: var(--xp-primary);
  box-shadow: 0 0 0 3px rgba(var(--xp-primary-rgb), 0.12);
}

/* ============================================================
   PRODUCT INFO (Col 2)
   ============================================================ */
.xp-info {
  background: var(--xp-white);
  border: 1.5px solid var(--xp-border);
  border-radius: var(--xp-radius);
  padding: 1.75rem;
  box-shadow: var(--xp-shadow);
}

.xp-brand {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--xp-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.xp-brand a {
  color: inherit;
  text-decoration: none;
}
.xp-brand a:hover {
  text-decoration: underline;
}

.xp-sku-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.xp-sku {
  font-size: 0.78rem;
  color: var(--xp-muted);
}
.xp-stock {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
}
.xp-stock--in  { color: var(--xp-green); }
.xp-stock--out { color: var(--xp-red); }
.xp-stock__dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
}
.xp-stock--in  .xp-stock__dot { background: var(--xp-green); }
.xp-stock--out .xp-stock__dot { background: var(--xp-red); }

.xp-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--xp-text);
  margin: 0.5rem 0 0.75rem;
}

/* WooCommerce star rating */
.xp-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.xp-rating .star-rating {
  color: var(--xp-star);
  font-size: 0.88rem;
  float: none;
}
.xp-rating__count {
  font-size: 0.82rem;
  color: var(--xp-muted);
  text-decoration: none;
}
.xp-rating__count:hover {
  color: var(--xp-primary);
  text-decoration: underline;
}

.xp-short-desc {
  font-size: 0.9rem;
  color: var(--xp-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--xp-border);
}
.xp-short-desc p { margin-bottom: 0.4rem; }
.xp-short-desc ul {
  padding-left: 1.1rem;
  margin-bottom: 0;
}
.xp-short-desc li { margin-bottom: 0.25rem; }

/* WooCommerce meta (tags / cats) */
.xp-meta {
  font-size: 0.82rem;
  color: var(--xp-muted);
  margin-top: 0.75rem;
}
.xp-meta .posted_in a,
.xp-meta .tagged_as a {
  color: var(--xp-primary);
  text-decoration: none;
}
.xp-meta .posted_in a:hover,
.xp-meta .tagged_as a:hover {
  text-decoration: underline;
}

/* ============================================================
   BUY BOX (Col 3)
   ============================================================ */
.xp-buy-box {
  background: var(--xp-white);
  border: 1.5px solid var(--xp-border);
  border-radius: var(--xp-radius);
  padding: 1.5rem;
  box-shadow: var(--xp-shadow);
  transition: box-shadow var(--xp-transition);
}
.xp-buy-box.is-sticky {
  box-shadow: var(--xp-shadow-hover);
}

/* Price */
.xp-buy-box__price {
  margin-bottom: 0.75rem;
}
.xp-buy-box__price .price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--xp-primary);
  line-height: 1.2;
}
.xp-buy-box__price .price del {
  font-size: 1rem;
  color: var(--xp-muted);
  font-weight: 400;
  margin-right: 0.35rem;
}
.xp-buy-box__price .price ins {
  text-decoration: none;
}

/* Stock in buy box */
.xp-buy-box__stock {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--xp-green);
  margin-bottom: 1rem;
}
.xp-buy-box__stock .xp-stock__dot { background: var(--xp-green); }
.xp-buy-box__stock--out { color: var(--xp-red); }
.xp-buy-box__stock--out .xp-stock__dot { background: var(--xp-red); }

/* ── WooCommerce ATC form ── */
.xp-buy-box__atc .quantity {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--xp-border);
  border-radius: var(--xp-radius-sm);
  overflow: hidden;
  width: fit-content;
  margin-bottom: 0.75rem;
}
.xp-buy-box__atc .qty {
  width: 52px;
  text-align: center;
  border: none;
  outline: none;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.5rem 0;
  color: var(--xp-text);
  -moz-appearance: textfield;
}
.xp-buy-box__atc .qty::-webkit-outer-spin-button,
.xp-buy-box__atc .qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

/* Custom qty +/- if theme adds them */
.xp-buy-box__atc .qty-btn {
  background: var(--xp-light);
  border: none;
  padding: 0.5rem 0.85rem;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--xp-text);
  transition: background var(--xp-transition);
}
.xp-buy-box__atc .qty-btn:hover {
  background: var(--xp-border);
}

/* Add to cart button */
.xp-buy-box__atc .single_add_to_cart_button,
.xp-buy-box__atc .button {
  display: block;
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--xp-primary);
  color: #fff !important;
  border: none;
  border-radius: var(--xp-radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: background var(--xp-transition), transform var(--xp-transition), box-shadow var(--xp-transition);
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}
.xp-buy-box__atc .single_add_to_cart_button:hover,
.xp-buy-box__atc .button:hover {
  background: var(--xp-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(var(--xp-primary-rgb), 0.3);
}
.xp-buy-box__atc .single_add_to_cart_button:disabled,
.xp-buy-box__atc .button:disabled {
  background: var(--xp-muted);
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

/* Variation selects */
.xp-buy-box__atc .variations select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--xp-border);
  border-radius: var(--xp-radius-sm);
  font-size: 0.88rem;
  color: var(--xp-text);
  margin-bottom: 0.5rem;
  outline: none;
}
.xp-buy-box__atc .variations select:focus {
  border-color: var(--xp-primary);
}
.xp-buy-box__atc .variations td,
.xp-buy-box__atc .variations th {
  padding: 0.35rem 0;
  font-size: 0.82rem;
  color: var(--xp-muted);
}
.xp-buy-box__atc .reset_variations {
  font-size: 0.78rem;
  color: var(--xp-muted);
}
.xp-buy-box__atc .woocommerce-variation-price .price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--xp-primary);
}

/* Trust perks */
.xp-perks {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0.75rem;
  border-top: 1px solid var(--xp-border);
  padding-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.xp-perks__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  color: var(--xp-muted);
}
.xp-perks__item svg {
  color: var(--xp-primary);
  flex-shrink: 0;
}

/* Payment icons */
.xp-payment-icons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid var(--xp-border);
}
.xp-pay-badge {
  background: var(--xp-light);
  border: 1px solid var(--xp-border);
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  color: var(--xp-muted);
  letter-spacing: 0.04em;
}

/* ============================================================
   PRODUCT TABS
   ============================================================ */
.xp-tabs-wrap {
  background: var(--xp-white);
  border: 1.5px solid var(--xp-border);
  border-radius: var(--xp-radius);
  overflow: hidden;
  box-shadow: var(--xp-shadow);
  margin-bottom: 2.5rem;
}

/* WooCommerce default tabs — override */
.xp-tabs-wrap .woocommerce-tabs ul.tabs {
  background: var(--xp-light);
  border-bottom: 2px solid var(--xp-border);
  padding: 0 1.5rem;
  margin: 0;
  list-style: none;
  display: flex;
  gap: 0;
}
.xp-tabs-wrap .woocommerce-tabs ul.tabs::before,
.xp-tabs-wrap .woocommerce-tabs ul.tabs li::before,
.xp-tabs-wrap .woocommerce-tabs ul.tabs li::after {
  display: none !important;
  border: none !important;
  background: none !important;
}
.xp-tabs-wrap .woocommerce-tabs ul.tabs li {
  border: none;
  border-radius: 0;
  background: transparent;
  margin: 0;
  padding: 0;
}
.xp-tabs-wrap .woocommerce-tabs ul.tabs li a {
  display: block;
  padding: 0.9rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--xp-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--xp-transition), border-color var(--xp-transition);
}
.xp-tabs-wrap .woocommerce-tabs ul.tabs li.active a,
.xp-tabs-wrap .woocommerce-tabs ul.tabs li a:hover {
  color: var(--xp-primary);
  border-bottom-color: var(--xp-primary);
}

.xp-tabs-wrap .woocommerce-tabs .panel {
  padding: 1.75rem;
  border: none;
  margin: 0;
}

/* Description tab */
.xp-tabs-wrap #tab-description h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.xp-tabs-wrap #tab-description p {
  font-size: 0.9rem;
  color: var(--xp-muted);
  line-height: 1.7;
}

/* Reviews tab */
.xp-tabs-wrap #reviews .comment_container {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--xp-border);
}
.xp-tabs-wrap #reviews .star-rating {
  color: var(--xp-star);
}
.xp-tabs-wrap #reviews #review_form_wrapper {
  margin-top: 1.5rem;
}
.xp-tabs-wrap #reviews #review_form input,
.xp-tabs-wrap #reviews #review_form textarea {
  width: 100%;
  border: 1.5px solid var(--xp-border);
  border-radius: var(--xp-radius-sm);
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
  margin-bottom: 0.6rem;
  outline: none;
  transition: border-color var(--xp-transition);
}
.xp-tabs-wrap #reviews #review_form input:focus,
.xp-tabs-wrap #reviews #review_form textarea:focus {
  border-color: var(--xp-primary);
}
.xp-tabs-wrap #reviews #review_form .form-submit input[type="submit"] {
  background: var(--xp-primary);
  color: #fff;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: var(--xp-radius-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--xp-transition);
}
.xp-tabs-wrap #reviews #review_form .form-submit input[type="submit"]:hover {
  background: var(--xp-primary-dark);
}

/* ============================================================
   RELATED PRODUCTS
   ============================================================ */
.related.products > h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--xp-text);
  margin-bottom: 1.25rem;
}
.related.products ul.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.related.products ul.products li.product {
  background: var(--xp-white);
  border: 1.5px solid var(--xp-border);
  border-radius: var(--xp-radius);
  overflow: hidden;
  transition: box-shadow var(--xp-transition), transform var(--xp-transition);
}
.related.products ul.products li.product:hover {
  box-shadow: var(--xp-shadow-hover);
  transform: translateY(-3px);
}
.related.products ul.products li.product .woocommerce-loop-product__link {
  text-decoration: none;
}
.related.products ul.products li.product img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: var(--xp-light);
  padding: 1rem;
}
.related.products ul.products li.product .woocommerce-loop-product__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--xp-text);
  padding: 0.75rem 1rem 0;
  line-height: 1.35;
}
.related.products ul.products li.product .price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--xp-primary);
  padding: 0.3rem 1rem 0.75rem;
  display: block;
}
.related.products ul.products li.product .button {
  margin: 0 1rem 1rem;
  display: block;
  text-align: center;
  padding: 0.5rem;
  background: var(--xp-light);
  color: var(--xp-primary) !important;
  border: 1.5px solid var(--xp-primary);
  border-radius: var(--xp-radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--xp-transition);
}
.related.products ul.products li.product .button:hover {
  background: var(--xp-primary);
  color: #fff !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
  .xp-gallery { position: static; }
  .xp-buy-box.is-sticky { box-shadow: var(--xp-shadow); }
  .related.products ul.products { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
  .xp-info { padding: 1.25rem; }
  .xp-buy-box { padding: 1.25rem; }
  .xp-title { font-size: 1.2rem; }
  .xp-buy-box__price .price { font-size: 1.5rem; }
  .related.products ul.products { grid-template-columns: repeat(2, 1fr); }
  .xp-tabs-wrap .woocommerce-tabs ul.tabs {
    padding: 0 0.75rem;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .xp-tabs-wrap .woocommerce-tabs ul.tabs li a {
    font-size: 0.8rem;
    padding: 0.75rem 0.9rem;
    white-space: nowrap;
  }
}
