/**
 * Single Product Page (PDP) Styles
 * Khaas Tech N Games
 */

.single-product-layout {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 4.8rem;
  margin-top: 1.6rem;
  margin-bottom: 6.4rem;
  align-items: flex-start;
}

@media (max-width: 1024px) {
  .single-product-layout {
    grid-template-columns: 1fr;
    gap: 3.2rem;
  }
}

/* Left Column: Product Gallery */
.product-gallery-sticky {
  position: sticky;
  top: calc(var(--header-height) + 24px);
}

.gallery-main-view {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  background-color: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.6rem;
}

.gallery-main-img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.gallery-main-view:hover .gallery-main-img {
  transform: scale(1.05);
}

/* Gallery Thumbnails Slider */
.gallery-thumbs-track {
  display: flex;
  gap: 1.2rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
}

.gallery-thumb-item {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background-color: #ffffff;
  padding: 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.gallery-thumb-item:hover, .gallery-thumb-item.is-active {
  border-color: var(--heading-color);
  box-shadow: 0 0 0 1px var(--heading-color);
}

.gallery-thumb-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Right Column: Product Purchasing Stack */
.product-summary-stack {
  display: flex;
  flex-direction: column;
}

.pdp-brand-link {
  font-size: 1.3rem;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #737373;
  margin-bottom: 0.8rem;
  display: inline-block;
}

.pdp-brand-link:hover {
  color: var(--heading-color);
  text-decoration: underline;
}

.pdp-product-title {
  font-size: clamp(2.4rem, 2.8vw, 3.6rem);
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  line-height: 1.25;
  margin-bottom: 1.2rem;
}

/* Meta Row (SKU, Reviews Rating) */
.pdp-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.8rem;
  margin-bottom: 1.6rem;
  font-size: 1.35rem;
  color: var(--text-color);
}

.pdp-rating-stars {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--star-rating);
}

.pdp-rating-count {
  color: var(--text-color);
  text-decoration: underline;
  margin-left: 0.4rem;
}

.pdp-sku-badge {
  font-size: 1.25rem;
  color: #8c8c8c;
}

/* Stock Status */
.pdp-stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.45rem;
  font-weight: var(--font-weight-bold);
  color: var(--in-stock);
  margin-bottom: 1.8rem;
}

.pdp-stock-badge svg {
  width: 20px;
  height: 20px;
}

/* Price Block */
.pdp-price-container {
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--divider-color);
  border-bottom: 1px solid var(--divider-color);
  margin-bottom: 2.4rem;
}

.pdp-price-main {
  font-size: 3.2rem;
  font-weight: var(--font-weight-black);
  color: var(--heading-color);
}

.pdp-price-was {
  font-size: 1.8rem;
  color: #999999;
  text-decoration: line-through;
}

.pdp-tax-note {
  font-size: 1.25rem;
  color: var(--text-color);
  margin-left: auto;
}

/* Quantity & Add to Cart Action Row */
.pdp-buy-actions {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin-bottom: 2.0rem;
}

/* Quantity Pill */
.quantity-pill-selector {
  display: inline-flex;
  align-items: center;
  background-color: #f7f7f7;
  border: 1px solid var(--input-border);
  border-radius: var(--btn-radius);
  height: 52px;
  padding: 0 0.6rem;
}

.qty-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  border-radius: 50%;
  transition: background-color var(--transition-fast);
}

.qty-btn:hover {
  background-color: #eaeaea;
}

.qty-input {
  width: 44px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Add to Cart Button */
.pdp-add-to-cart-btn {
  flex: 1;
  height: 52px;
  font-size: 1.5rem;
  letter-spacing: 0.05em;
}

/* 4 Accordion Disclosures */
.pdp-accordions-group {
  margin-top: 2.4rem;
  border-top: 1px solid var(--divider-color);
}

.pdp-accordion-item {
  border-bottom: 1px solid var(--divider-color);
}

.pdp-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.8rem 0;
  cursor: pointer;
  user-select: none;
}

.pdp-accordion-title {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 0;
}

.pdp-accordion-title svg {
  width: 20px;
  height: 20px;
  color: var(--heading-color);
}

.pdp-accordion-icon {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-normal);
}

.pdp-accordion-item[open] .pdp-accordion-icon {
  transform: rotate(180deg);
}

.pdp-accordion-content {
  padding-bottom: 2.4rem;
  color: var(--text-color);
  font-size: 1.45rem;
  line-height: 1.65;
}

/* Specifications Table */
.specifications-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.4rem;
}

.specifications-table tr {
  border-bottom: 1px solid #f0f0f0;
}

.specifications-table td {
  padding: 1.0rem 0.6rem;
}

.specifications-table td:first-child {
  width: 35%;
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  background-color: #fafafa;
}

/* Sticky Mobile Buy Bar */
.sticky-mobile-buy-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-color);
  border-top: 1px solid var(--card-border);
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.08);
  padding: 1.2rem var(--gutter-sm);
  z-index: 850;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  transform: translateY(100%);
  transition: transform var(--transition-normal);
}

.sticky-mobile-buy-bar.is-visible {
  display: flex;
  transform: translateY(0);
}

@media (min-width: 769px) {
  .sticky-mobile-buy-bar {
    display: none !important;
  }
}

.sticky-bar-info {
  flex: 1;
  min-width: 0;
}

.sticky-bar-title {
  font-size: 1.3rem;
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticky-bar-price {
  font-size: 1.5rem;
  font-weight: var(--font-weight-black);
  color: var(--heading-color);
}

/* ── WooCommerce Price Color Override ─────────────────────────────────────── */
/* WooCommerce sets an ugly olive color; override with brand heading color     */
.woocommerce div.product .pdp-price-main .price,
.woocommerce div.product .pdp-price-main span.price,
.woocommerce div.product .pdp-price-main .woocommerce-Price-amount,
.woocommerce:where(body:not(.woocommerce-uses-block-theme)) div.product .pdp-price-main p.price,
.woocommerce:where(body:not(.woocommerce-uses-block-theme)) div.product .pdp-price-main span.price {
  color: var(--heading-color) !important;
}

/* ── Product Accordions (details/summary) ─────────────────────────────────── */
.product-summary-stack details {
  border-bottom: 1px solid var(--divider-color);
}

.product-summary-stack details:first-of-type {
  border-top: 1px solid var(--divider-color);
}

.product-summary-stack details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 0;
  font-size: 1.5rem;
  font-weight: var(--font-weight-semibold);
  color: var(--heading-color);
  cursor: pointer;
  list-style: none;
  user-select: none;
  letter-spacing: 0.01em;
}

.product-summary-stack details summary::-webkit-details-marker {
  display: none;
}

.product-summary-stack details summary::after {
  content: '+';
  font-size: 2rem;
  font-weight: 300;
  color: var(--text-color);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.product-summary-stack details[open] summary::after {
  content: '−';
}

.product-summary-stack details .accordion-body,
.product-summary-stack details > div,
.product-summary-stack details > table,
.product-summary-stack details > p {
  padding-bottom: 1.6rem;
  font-size: 1.4rem;
  color: var(--text-color);
  line-height: 1.7;
}
