/* ============================================================
   ALP Product Page
   ============================================================
   Styles for the custom single-product template.
   Enqueued via functions.php — only on product pages.
   ============================================================ */

/* ─── Container ─────────────────────────────────────────── */
.alp-product {
  max-width: var(--container-max, 1360px);
  margin: 0 auto;
  padding: 0 var(--space-4, 20px) var(--space-8, 75px);
}

@media (min-width: 1400px) {
  .alp-product { padding-left: 0; padding-right: 0; }
}

/* ─── Breadcrumb ─────────────────────────────────────────── */
.alp-breadcrumb {
  font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: var(--t-small, 12px);
  color: var(--fg-muted, #7F8994);
  margin-bottom: 30px;
  padding-top: 30px;
}
.alp-breadcrumb a {
  color: var(--fg-muted, #7F8994);
  text-decoration: none;
  transition: color var(--dur-fast, 150ms) var(--ease-brand, ease);
}
.alp-breadcrumb a:hover { color: var(--fg-secondary, #125E8F); }
.alp-breadcrumb span { margin: 0 6px; opacity: 0.6; }

/* ─── Hero: two-column layout ───────────────────────────── */
.alp-product__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: start;
}

.alp-product__gallery {
  position: sticky;
  top: 100px;
  min-width: 0;
}

/* ─── Hero image card ────────────────────────────────────── */
.alp-product-hero {
  background: var(--bg-card-cream, #FFFAEB);
  border-radius: var(--r-card, 20px);
  padding: 40px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.alp-product-hero img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ─── Gallery swiper ────────────────────────────────────── */
.alp-gallery-swiper {
  overflow: hidden;
  border-radius: var(--r-card, 20px);
  position: relative;
  width: 100%;
}
.alp-gallery-slide {
  background: var(--bg-card-cream, #FFFAEB);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.alp-gallery-slide img {
  aspect-ratio: 1;
}
.alp-gallery-slide img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.alp-gallery-prev,
.alp-gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  z-index: 10;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: background 150ms ease;
}
.alp-gallery-prev:hover,
.alp-gallery-next:hover {
  background: #fff;
}
.alp-gallery-prev { left: 12px; }
.alp-gallery-next { right: 12px; }
.alp-gallery-prev::after { content: '\2039'; font-size: 22px; color: var(--fg-primary, #00375A); line-height: 1; }
.alp-gallery-next::after { content: '\203A'; font-size: 22px; color: var(--fg-primary, #00375A); line-height: 1; }
.alp-gallery-pagination {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 10;
}
.alp-gallery-pagination .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: var(--fg-primary, #00375A);
  opacity: 0.25;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity 150ms ease;
}
.alp-gallery-pagination .swiper-pagination-bullet-active {
  opacity: 1;
}

/* ─── Product title ─────────────────────────────────────── */
.alp-product__title {
  font-family: var(--font-display, Inter), sans-serif;
  font-size: clamp(1.75rem, 5vw, 2.5rem) !important;
  font-weight: 400 !important;
  letter-spacing: var(--t-h1-letter, -1.8px) !important;
  color: var(--fg-primary, #00375A) !important;
  line-height: 1 !important;
  margin: 8px 0 12px !important;
}

/* ─── Eyebrow ────────────────────────────────────────────── */
.alp-eyebrow {
  font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: var(--t-body-lg, 18px);
  font-weight: 400;
  color: var(--fg-secondary, #125E8F);
  display: block;
  margin-bottom: 8px;
}

/* ─── Short description ─────────────────────────────────── */
.alp-product__short {
  font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-primary, #00375A);
  margin-bottom: 16px;
}
.alp-product__short p:last-child { margin-bottom: 0; }

/* ─── Rating line ────────────────────────────────────────── */
.alp-product__rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: 14px;
}
.alp-product__rating .alp-review__stars {
  color: var(--alp-gold, #CD982C);
  letter-spacing: 2px;
  font-size: 16px;
}
.alp-product__rating-num {
  font-weight: 700;
  color: var(--fg-primary, #00375A);
}
.alp-product__rating a {
  color: var(--fg-secondary, #125E8F);
  text-decoration: underline;
}

/* ─── Chips row ──────────────────────────────────────────── */
.alp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 24px;
}

/* ─── Buy box ────────────────────────────────────────────── */
.alp-buybox {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--alp-mist, #E7ECF2);
}

/* Price inside buy box */
.alp-buybox .price {
  font-family: var(--font-display, Inter), sans-serif;
  font-size: 24px;
  letter-spacing: var(--t-display-letter, -0.030em);
  color: var(--fg-primary, #00375A);
  margin-bottom: 20px;
}

/* Cart form — quantity + button row */
.alp-buybox form.cart {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 4px;
}

.alp-buybox .quantity .qty {
  border: 1.5px solid var(--alp-mist, #E7ECF2);
  border-radius: 25px;
  padding: 12px 14px;
  font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: 15px;
  width: 70px;
  text-align: center;
}

/* Gold pill add-to-cart button */
.alp-buybox .single_add_to_cart_button {
  flex: 1;
  background: var(--alp-gold, #CD982C);
  border: 1px solid var(--alp-gold, #CD982C);
  border-radius: var(--r-pill, 40px);
  color: var(--alp-white, #fff);
  font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: 16px;
  padding: 14px 32px;
  cursor: pointer;
  transition: all var(--dur-base, 250ms) var(--ease-brand, ease);
}
.alp-buybox .single_add_to_cart_button:hover {
  background: var(--alp-white, #fff);
  color: var(--alp-gold, #CD982C);
}

/* WooCommerce Subscriptions — option cards */
.alp-buybox .wcsatt-options-wrapper {
  margin-bottom: 20px;
}
.alp-buybox .wcsatt-options-wrapper li {
  list-style: none;
  padding: 16px 20px;
  border: 1.5px solid var(--alp-mist, #E7ECF2);
  border-radius: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color var(--dur-fast, 150ms) var(--ease-brand, ease);
}
.alp-buybox .wcsatt-options-wrapper li:hover {
  border-color: var(--alp-blue-tint, #CCDFEC);
}
.alp-buybox .wcsatt-options-wrapper li.selected {
  border-color: var(--fg-primary, #00375A);
  background: var(--alp-cream-50, rgba(255,250,235,0.4));
}

/* ─── Amazon button ──────────────────────────────────────── */
.alp-amazon-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 18px;
  border: 1.5px solid var(--alp-mist, #E7ECF2);
  border-radius: 25px;
  color: var(--fg-primary, #00375A);
  font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: 14px;
  background: var(--alp-white, #fff);
  transition: border-color var(--dur-base, 250ms) var(--ease-brand, ease);
  text-decoration: none;
}
.alp-amazon-btn:hover { border-color: #FF9900; }
.alp-amazon-btn strong { font-weight: 700; }
.alp-amazon-btn .alp-amazon-btn__arrow {
  width: 14px;
  height: 14px;
  margin-left: auto;
}

/* ─── Assurances list ────────────────────────────────────── */
.alp-assurances {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: 13px;
  color: var(--fg-muted, #7F8994);
}
.alp-assurances li::before {
  content: "\2713\0020";
  color: var(--alp-green-text, #3F9833);
  font-weight: 700;
}

/* ─── Tabs ───────────────────────────────────────────────── */
.alp-product__tabs {
  margin-top: var(--space-8, 75px);
}

.alp-product__tabs .woocommerce-tabs ul.tabs {
  padding: 0;
  margin: 0 0 30px;
  border-bottom: 1px solid var(--alp-mist, #E7ECF2);
  list-style: none;
  display: flex;
}
.alp-product__tabs .woocommerce-tabs ul.tabs::before,
.alp-product__tabs .woocommerce-tabs ul.tabs::after {
  display: none;
}
.alp-product__tabs .woocommerce-tabs ul.tabs li {
  border: none;
  background: transparent;
  border-radius: 0;
  margin: 0;
  padding: 0;
}
.alp-product__tabs .woocommerce-tabs ul.tabs li a {
  font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: 15px;
  color: var(--fg-muted, #7F8994);
  padding: 12px 20px;
  display: inline-block;
  border-bottom: 2px solid transparent;
  transition: all var(--dur-fast, 150ms) var(--ease-brand, ease);
  text-decoration: none;
}
.alp-product__tabs .woocommerce-tabs ul.tabs li.active a {
  color: var(--fg-primary, #00375A);
  border-bottom-color: var(--alp-gold, #CD982C);
}

.alp-product__tabs .woocommerce-tabs .panel h2 {
  font-family: var(--font-display, Inter), sans-serif;
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  letter-spacing: var(--t-h3-letter, -0.75px);
  font-weight: 400;
  color: var(--fg-primary, #00375A);
}
/* Hide the redundant "Description" heading inside the tab panel */
.alp-product__tabs #tab-description > h2:first-child {
  display: none;
}

/* ─── Regimen section ────────────────────────────────────── */
.alp-product__regimen {
  background: var(--bg-card-cream, #FFFAEB);
  border-radius: 24px;
  padding: 60px 50px;
  margin-top: var(--space-8, 75px);
}
.alp-product__regimen h2 {
  margin-top: 8px;
}
.alp-product__regimen-lead {
  font-size: 15px;
  color: var(--fg-primary, #00375A);
  margin-bottom: 30px;
}

/* Regimen grid — "you're here" highlight */
.regimen-grid .rg-row.is-current {
  box-shadow: inset 0 0 0 2px var(--alp-gold, #CD982C);
  position: relative;
}
.regimen-grid .rg-row.is-current::after {
  content: "You're here";
  display: inline-block;
  font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--alp-gold-text, #C18100);
  background: var(--alp-gold-soft, rgba(205,152,44,0.15));
  padding: 3px 8px;
  border-radius: 20px;
  position: absolute;
  top: 14px;
  right: 14px;
}

/* ─── Details tab — list styling ─────────────────────────── */
.alp-product__tabs #tab-description ul {
  list-style: none;
  padding: 0;
  margin: 16px 0 24px;
}
.alp-product__tabs #tab-description ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-primary, #00375A);
}
.alp-product__tabs #tab-description ul li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--alp-green-text, #3F9833);
  font-weight: 700;
}

/* ─── Reviews tab — Swiper slider ────────────────────────── */
#tab-reviews h2:first-child { display: none; }

.alp-reviews-wrap {
  position: relative;
  padding: 0 44px;
}
.alp-reviews-swiper {
  overflow: hidden;
  position: relative;
}
.alp-reviews-swiper .swiper-slide {
  height: auto;
  list-style: none;
}
.alp-reviews-swiper .comment_container {
  display: flex;
  flex-direction: column;
  background: var(--alp-white, #fff);
  border: 1px solid var(--alp-mist, #E7ECF2);
  border-radius: 16px;
  padding: 24px;
  height: 100%;
}
.alp-reviews-swiper .comment_container > img {
  display: none;
}
.alp-reviews-swiper .star-rating {
  position: relative;
  overflow: hidden;
  font-size: 14px;
  line-height: 1;
  width: 5.4em;
  height: 1.1em;
  margin-bottom: 10px;
}
.alp-reviews-swiper .star-rating::before {
  content: "\2605\2605\2605\2605\2605";
  color: var(--alp-mist, #E7ECF2);
  letter-spacing: 2px;
  float: left;
}
.alp-reviews-swiper .star-rating > span {
  overflow: hidden;
  float: left;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  padding-top: 1.5em;
}
.alp-reviews-swiper .star-rating > span::before {
  content: "\2605\2605\2605\2605\2605";
  color: var(--alp-gold, #CD982C);
  letter-spacing: 2px;
  position: absolute;
  top: 0;
  left: 0;
}
.alp-reviews-swiper .meta {
  font-size: 12px;
  color: var(--fg-muted, #7F8994);
  margin-bottom: 12px;
}
.alp-reviews-swiper .meta .woocommerce-review__author {
  color: var(--fg-primary, #00375A);
}
.alp-reviews-swiper .description p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-primary, #00375A);
  margin: 0;
}
.alp-reviews-swiper .description.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.alp-reviews-swiper .description.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.alp-review-readmore {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-family: var(--font-body, 'DM Sans'), sans-serif;
  color: var(--fg-secondary, #125E8F);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}
.alp-review-readmore:hover {
  text-decoration: underline;
}
.alp-reviews-wrap .alp-reviews-prev,
.alp-reviews-wrap .alp-reviews-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-primary, #00375A);
  width: 36px;
  height: 36px;
  z-index: 10;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.alp-reviews-wrap .alp-reviews-prev::after,
.alp-reviews-wrap .alp-reviews-next::after {
  font-size: 20px;
  line-height: 1;
  color: var(--fg-primary, #00375A);
}
.alp-reviews-wrap .alp-reviews-prev::after { content: '\2039'; }
.alp-reviews-wrap .alp-reviews-next::after { content: '\203A'; }
.alp-reviews-wrap .alp-reviews-prev { left: 0; }
.alp-reviews-wrap .alp-reviews-next { right: 0; }

/* Hide the add-review form by default — keep page clean */
#tab-reviews #review_form_wrapper {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--alp-mist, #E7ECF2);
}
#tab-reviews #review_form_wrapper h3 {
  font-family: var(--font-display, Inter), sans-serif;
  font-size: 20px;
  letter-spacing: -0.5px;
  font-weight: 400;
  color: var(--fg-primary, #00375A);
  margin-bottom: 16px;
}
#tab-reviews .comment-form-rating label {
  font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: 14px;
  color: var(--fg-muted, #7F8994);
}
#tab-reviews .comment-form textarea {
  border: 1.5px solid var(--alp-mist, #E7ECF2);
  border-radius: 12px;
  padding: 14px;
  font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: 15px;
  width: 100%;
  resize: vertical;
}
#tab-reviews .comment-form .submit {
  background: var(--alp-gold, #CD982C);
  border: 1px solid var(--alp-gold, #CD982C);
  border-radius: var(--r-pill, 40px);
  color: var(--alp-white, #fff);
  font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: 15px;
  padding: 12px 28px;
  cursor: pointer;
  transition: all var(--dur-base, 250ms) var(--ease-brand, ease);
}
#tab-reviews .comment-form .submit:hover {
  background: var(--alp-white, #fff);
  color: var(--alp-gold, #CD982C);
}

/* Interactive star rating widget */
#tab-reviews .stars {
  display: inline-flex !important;
  gap: 2px;
  margin-bottom: 12px;
}
#tab-reviews .stars a {
  font-size: 0 !important;
  width: 28px;
  height: 28px;
  text-decoration: none !important;
}
#tab-reviews .stars a::before {
  content: "\2605";
  font-size: 24px;
  color: var(--alp-mist, #E7ECF2);
  transition: color 150ms ease;
}
#tab-reviews .stars:hover a::before { color: var(--alp-gold, #CD982C); }
#tab-reviews .stars a:hover ~ a::before { color: var(--alp-mist, #E7ECF2) !important; }
#tab-reviews .stars.selected a::before { color: var(--alp-gold, #CD982C); }
#tab-reviews .stars.selected a.active ~ a::before { color: var(--alp-mist, #E7ECF2); }

/* ─── Related products ──────────────────────────────────── */
.alp-product__related {
  margin-top: var(--space-8, 75px);
}
.alp-product__related h2 {
  margin-top: 8px;
  margin-bottom: 30px;
}
/* Related card styles moved to style.css (global) for [alp_products] shortcode reuse */
.alp-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* ─── Mobile ─────────────────────────────────────────────── */
@media (max-width: 991px) {
  .alp-product__top {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .alp-product__gallery {
    position: static;
  }
  .alp-product-hero {
    aspect-ratio: auto;
    padding: 30px;
  }
  .alp-product__regimen {
    padding: 40px 24px;
    border-radius: 16px;
  }
  .alp-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .alp-related-grid {
    grid-template-columns: 1fr;
  }
}
