/* ============================================================
   AlpenPeptides – Product Detail Page (PDP)
   1:1 Shopify reference recreation
   ============================================================ */

/* ── Blocksy Reset ─────────────────────────────────────────── */
.single-product [class*="ct-container"],
.single-product .ct-container,
.single-product .ct-container-full,
.single-product .entry-content,
.single-product .product-entry-wrapper,
.single-product #content,
.single-product .ct-inner-content {
  max-width: none !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.single-product .ct-container-full,
.single-product [class*="ct-container"] {
  display: block !important;
  grid-template-columns: none !important;
}

.single-product article {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  float: none !important;
}

.single-product aside,
.single-product .ct-sidebar {
  display: none !important;
}

.single-product .is-width-constrained,
.single-product .product-entry-wrapper.is-width-constrained,
.single-product .is-layout-constrained,
.single-product .ct-product-gallery-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.single-product .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  width: 100% !important;
  max-width: 100% !important;
}

.woocommerce div.product div.images,
.woocommerce div.product .woocommerce-product-gallery {
  width: 100% !important;
  float: none !important;
}

.woocommerce div.product div.summary {
  width: 100% !important;
  float: none !important;
}

/* Hide Blocksy hero section on PDP */
.single-product .hero-section {
  display: none !important;
}

/* ── Page Container ────────────────────────────────────────── */

/* Remove Blocksy's vertical spacing on the product container */
.single-product .ct-container-full[data-vertical-spacing] {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.single-product .ap-pdp {
  display: block !important;
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 48px 60px !important;
  width: 100% !important;
  box-sizing: border-box;
}

/* ── Two-Column Grid (50/50) ───────────────────────────────── */
.ap-pdp__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

/* ── LEFT: Gallery ─────────────────────────────────────────── */
.ap-pdp__gallery {
  width: 100%;
  min-width: 0;
}

.ap-pdp__gallery .woocommerce-product-gallery {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

.ap-pdp__gallery .ct-product-gallery-container,
.ap-pdp__gallery .woocommerce-product-gallery__wrapper {
  width: 100% !important;
}

.ap-pdp__gallery .ct-media-container {
  border-radius: 0 !important;
  height: auto !important;
  display: block !important;
}

.ap-pdp__gallery .ct-media-container img {
  width: 100%;
  height: auto !important;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

/* Hide zoom trigger + disable zoom on hover */
.ap-pdp__gallery .woocommerce-product-gallery__trigger {
  display: none;
}

.ap-pdp__gallery .ct-media-container img {
  transform: none !important;
  transition: none !important;
}

.ap-pdp__gallery .ct-media-container {
  overflow: hidden;
  cursor: default !important;
}

.ap-pdp__gallery .zoomImg,
.ap-pdp__gallery .zoomWindow,
.ap-pdp__gallery .zoomLens {
  display: none !important;
}

/* Sale flash */
.ap-pdp__gallery .onsale,
.woocommerce .ap-pdp__gallery span.onsale {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  background: #14273F !important;
  color: #fff !important;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border-radius: 4px;
}

/* ── RIGHT: Summary ────────────────────────────────────────── */
.ap-pdp__summary {
  width: 100%;
  min-width: 0;
  padding: 0 0 24px;
}

.ap-pdp__title {
  color: #14273F;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 12px;
}

.ap-pdp__price {
  margin-bottom: 20px;
}

.ap-pdp__price .price {
  color: #14273F !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
}

.ap-pdp__price .price del {
  color: #9ca3af !important;
  font-size: 0.9rem !important;
  margin-right: 8px;
}

.ap-pdp__price .price ins {
  text-decoration: none;
}

.ap-pdp__price .price .screen-reader-text {
  display: none;
}

.ap-pdp__divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 0 0 24px;
}

/* ── Variations ────────────────────────────────────────────── */
.ap-pdp__summary .variations {
  margin-bottom: 16px !important;
  border: none !important;
}

.ap-pdp__summary .variations tr {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ap-pdp__summary .variations th,
.ap-pdp__summary .variations td {
  padding: 0 !important;
  border: none !important;
}

.ap-pdp__summary .variations label {
  color: #14273F;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Hide native select — replaced by pills */
.ap-variation-select-hidden {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Variation pills */
.ap-variation-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.ap-variation-pill {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #14273F;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.ap-variation-pill:hover {
  border-color: #14273F;
  background: #14273F !important;
  color: #ffffff !important;
}

.ap-variation-pill.is-active {
  border-color: #14273F;
  background: #14273F;
  color: #ffffff;
}

/* Out-of-stock variation pill */
.ap-variation-pill.is-out-of-stock {
  color: #9ca3af;
  border-color: #e5e7eb;
  background: #f9fafb;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  cursor: not-allowed;
  opacity: 0.75;
}

.ap-variation-pill.is-out-of-stock:hover {
  background: #f3f4f6 !important;
  color: #6b7280 !important;
  border-color: #d1d5db !important;
}

.ap-variation-pill.is-out-of-stock.is-active {
  background: #6b7280;
  border-color: #6b7280;
  color: #ffffff;
  opacity: 0.9;
}

/* Reset variations link — hidden */
.ap-pdp__summary .reset_variations {
  display: none !important;
}

/* ── Buy Buttons ───────────────────────────────────────────── */

/* Hide Blocksy's ct-cart-actions wrapper + dividers */
.ap-pdp__summary .ct-product-divider,
.ap-pdp__summary .ct-product-add-to-cart {
  display: contents !important;
}

.ap-pdp__summary form.cart {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 24px;
}

/* Quantity */
.ap-pdp__summary .quantity {
  width: auto !important;
  height: auto !important;
}

.ap-pdp__summary .ap-qty-wrap {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  overflow: hidden;
  height: 52px;
}

.ap-pdp__summary .ap-qty-wrap input.qty {
  border: 0 !important;
  width: 52px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  color: #14273F;
  padding: 0;
  background: transparent;
}

.ap-pdp__summary .ap-qty-btn {
  width: 44px;
  border: 0;
  background: transparent;
  color: #14273F;
  font-size: 1.2rem;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.ap-pdp__summary .ap-qty-btn:hover {
  background: #f3f4f6;
}

/* Hide Blocksy quantity steppers */
.ap-pdp__summary .quantity .ct-increase,
.ap-pdp__summary .quantity .ct-decrease {
  display: none !important;
}

/* Add to Cart button */
.ap-pdp__summary .single_add_to_cart_button {
  flex: 1;
  min-height: 52px;
  padding: 14px 32px !important;
  border-radius: 999px !important;
  border: none !important;
  background: #14273F !important;
  color: #ffffff !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.ap-pdp__summary .single_add_to_cart_button:hover {
  background: #1F3A5F !important;
}

.ap-pdp__summary .single_add_to_cart_button.disabled,
.ap-pdp__summary .single_add_to_cart_button:disabled {
  background: #9ca3af !important;
  color: #ffffff !important;
  cursor: not-allowed;
  opacity: 1 !important;
}

/* Variation price update */
.ap-pdp__summary .woocommerce-variation-price .price {
  font-size: 1rem !important;
  font-weight: 400 !important;
  color: #14273F !important;
  margin-bottom: 12px;
}

.ap-pdp__summary .woocommerce-variation-availability .stock {
  font-size: 0.82rem;
  font-weight: 600;
  color: #166534;
  margin-bottom: 8px;
}

/* Hide stock status text */
.ap-pdp__summary p.stock,
.ap-pdp__summary .stock:not(.woocommerce-variation-availability .stock) {
  display: none !important;
}

.ap-pdp__summary .single_variation {
  display: block !important;
}

/* ── Description ───────────────────────────────────────────── */
.ap-pdp__description {
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
  color: #374151;
  font-size: 1rem;
  line-height: 1.6;
}

.ap-pdp__description p:last-child {
  margin-bottom: 0;
}

/* ── Product Meta (SKU, Categories, Tags) ──────────────────── */
.ap-pdp__summary .product_meta {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  color: #9ca3af;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ap-pdp__summary .product_meta > span {
  display: block;
  margin-bottom: 4px;
}

.ap-pdp__summary .product_meta a {
  color: #6b7280;
  text-decoration: none;
}

.ap-pdp__summary .product_meta a:hover {
  color: #14273F;
}

/* ── Related Products ──────────────────────────────────────── */
.ap-pdp__related {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid #e5e7eb;
  width: 100%;
}

/* Override Blocksy ct-hidden classes on related products */
.ap-pdp__related .related.ct-hidden-sm,
.ap-pdp__related .related.ct-hidden-md {
  display: block !important;
}

/* Override Blocksy is-width-constrained */
.ap-pdp__related .related.is-width-constrained {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

.ap-pdp__related-title {
  color: #14273F;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 700;
  font-style: italic;
  margin: 0 0 24px;
}

/* Hide WooCommerce default heading */
.ap-pdp__related .related > h2,
.ap-pdp__related section.related > h2 {
  display: none !important;
}

.ap-pdp__related ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 24px;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

.ap-pdp__related ul.products::before,
.ap-pdp__related ul.products::after {
  display: none !important;
  content: none !important;
}

.ap-pdp__related ul.products li.product {
  width: 100% !important;
  margin: 0 !important;
  float: none !important;
  min-width: 0;
}

.ap-pdp__related .ap-card__inner,
.ap-pdp__related .ap-card__body {
  overflow: hidden;
  min-width: 0;
}

.ap-pdp__related .ap-card__title,
.ap-pdp__related .ap-card__title a {
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
}

/* ── Sticky Add-to-Cart Bar ────────────────────────────────── */
.ap-pdp-sticky-atc {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translate(-50%, 120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 9999;
  width: min(860px, calc(100% - 24px));
}

.ap-pdp-sticky-atc.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.ap-pdp-sticky-atc__inner {
  background: rgba(20, 39, 63, 0.97);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(46, 92, 138, 0.3);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ap-pdp-sticky-atc__meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.ap-pdp-sticky-atc__title {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-pdp-sticky-atc__price {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.ap-pdp-sticky-atc__btn {
  border: 0;
  background: #2E5C8A;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.ap-pdp-sticky-atc__btn:hover {
  background: #1F3A5F;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .ap-pdp__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .ap-pdp__summary {
    position: static;
    padding: 0;
  }

  .ap-pdp__related ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .single-product .ap-pdp {
    padding: 24px 16px 40px !important;
  }

  .ap-pdp__related ul.products {
    grid-template-columns: 1fr !important;
  }

  .ap-pdp-sticky-atc__inner {
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .ap-pdp-sticky-atc__meta {
    width: 100%;
  }

  .ap-pdp-sticky-atc__btn {
    width: 100%;
    text-align: center;
  }
}
