/**
 * Audioengine – Single Product Page Styles
 * Place at: yourtheme/assets/css/single-product.css
 *
 * Naming convention: BEM  (ae-block__element--modifier)
 * Breakpoints:
 *   --bp-md : 768px  (tablet)
 *   --bp-lg : 1024px (desktop)
 */

/* ── CSS Custom Properties ──────────────────────────────────────────────── */
:root {
  --ae-font-primary  : 'Nunito Sans', sans-serif;
  --ae-color-text    : #2c2c2c;
  --ae-color-accent  : #e7721b;   /* orange – used for stars, borders  */
  --ae-color-bg      : #ffffff;
  --ae-color-bg-alt  : #f5f5f5;
  --ae-color-border  : #e0e0e0;
  --ae-color-green   : #28a745;
  --ae-radius        : 4px;
  --ae-transition    : 0.25s ease;
  --ae-max-width     : 1280px;
  --ae-gallery-width : 620px;     /* matches source: 620 px slider width */
}

/* ── Reset / Base ───────────────────────────────────────────────────────── */
.ae-single-product-page .woocommerce-notices-wrapper {
  max-width: var(--ae-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ─────────────────────────────────────────────────────────────────────────
   HERO SECTION
───────────────────────────────────────────────────────────────────────── */
.ae-prod-hero {
  background: var(--ae-color-bg);
  padding: 2rem 1rem 3rem;
}

.ae-prod-hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: var(--ae-max-width);
  margin: 0 auto;
  align-items: start;
}

@media (min-width: 1024px) {
  .ae-prod-hero__inner {
    grid-template-columns: var(--ae-gallery-width) 1fr;
    gap: 3rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   PRODUCT GALLERY
───────────────────────────────────────────────────────────────────────── */
.ae-product-gallery {
  position: relative;
  width: 100%;
}

/* Main slider */
.ae-product-gallery__main-slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--ae-radius);
  background: #fafafa;
  aspect-ratio: 1 / 1;
  max-width: var(--ae-gallery-width);
}

.ae-gallery-slide {
  display: none;
  width: 100%;
}

.ae-gallery-slide.is-active {
  display: block;
}

.ae-gallery-slide__img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Arrows */
.ae-gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--ae-color-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--ae-transition);
  z-index: 2;
}

.ae-gallery__arrow:hover {
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.ae-gallery__arrow--prev { left: .5rem; }
.ae-gallery__arrow--next { right: .5rem; }

/* Zoom trigger */
.ae-gallery__zoom-trigger {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: rgba(255,255,255,.8);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

/* Thumbnail strip */
.ae-product-gallery__thumbnails {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding-bottom: .25rem;
}

.ae-gallery-thumb {
  flex: 0 0 auto;
  width: 80px;
  height: 80px;
  border: 2px solid var(--ae-color-border);
  border-radius: var(--ae-radius);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: none;
  scroll-snap-align: start;
  transition: border-color var(--ae-transition);
}

.ae-gallery-thumb.is-active,
.ae-gallery-thumb:hover {
  border-color: var(--ae-color-accent);
}

.ae-gallery-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Warranty badge */
.ae-warranty-badge {
  display: block;
  width: 80px;
  margin-top: 1rem;
}

/* ─────────────────────────────────────────────────────────────────────────
   PRODUCT SUMMARY (right column)
───────────────────────────────────────────────────────────────────────── */
.ae-prod-summary {
  font-family: var(--ae-font-primary);
  color: var(--ae-color-text);
}

/* Title */
.ae-prod-summary__title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 .5rem;
  color: var(--ae-color-text);
}

.ae-prod-summary__subtitle {
  font-size: 1rem;
  color: #555;
  margin: 0 0 1rem;
}

/* Short description */
.ae-prod-summary__short-desc {
  font-size: .95rem;
  line-height: 1.65;
  color: #444;
  margin: 0 0 1.25rem;
}

.ae-prod-summary__short-desc p:last-child {
  margin-bottom: 0;
}

/* Connection types */
.ae-prod-summary__conn-types {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 .75rem;
  flex-wrap: wrap;
}

.ae-prod-summary__conn-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #555;
}

.ae-prod-summary__conn-icons {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.ae-conn-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ae-color-text);
  cursor: default;
  position: relative;
}

.ae-conn-icon img {
  width: 22px;
  height: 22px;
  display: block;
}

/* Tooltip */
.ae-conn-icon::after {
  content: attr(data-title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  font-size: .7rem;
  white-space: nowrap;
  padding: 3px 7px;
  border-radius: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--ae-transition);
}

.ae-conn-icon:hover::after {
  opacity: 1;
}

/* Dimensions */
.ae-prod-summary__dimensions {
  font-size: .875rem;
  color: #555;
  margin: 0 0 1rem;
}

/* Rating */
.ae-prod-summary__rating {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
}

.ae-review-count {
  font-size: .875rem;
  font-weight: 700;
  color: var(--ae-color-text);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.ae-review-count:hover {
  color: var(--ae-color-accent);
  border-color: var(--ae-color-accent);
}

/* Native WC stars override */
.ae-prod-summary__rating .star-rating {
  color: var(--ae-color-accent);
  font-size: 1rem;
}

/* Price */
.ae-prod-summary__price {
  margin: 0 0 1.25rem;
}

.ae-prod-summary__price .price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ae-color-text);
}

.ae-prod-summary__price .price del {
  color: #999;
  font-weight: 400;
  font-size: 1.1rem;
}

.ae-prod-summary__price .price ins {
  text-decoration: none;
  color: var(--ae-color-accent);
}

/* ── Variation swatches ─────────────────────────────────────────────── */
.ae-prod-summary__purchase-wrap .variations {
  border: none;
  width: 100%;
  margin-bottom: .5rem;
}

.ae-prod-summary__purchase-wrap .variations th,
.ae-prod-summary__purchase-wrap .variations td {
  padding: .25rem 0;
  vertical-align: middle;
}

.ae-prod-summary__purchase-wrap .variations th label {
  font-weight: 700;
  font-size: .875rem;
}

/* Swatch container */
.ae-prod-summary__purchase-wrap .swatch-control {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}

.ae-prod-summary__purchase-wrap .swatch-wrapper {
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 2px;
  cursor: pointer;
  transition: border-color var(--ae-transition);
}

.ae-prod-summary__purchase-wrap .swatch-wrapper.selected,
.ae-prod-summary__purchase-wrap .swatch-wrapper:hover {
  border-color: var(--ae-color-text);
}

.ae-prod-summary__purchase-wrap .swatch-anchor {
  display: block;
  border-radius: 50%;
}

/* Quantity + CTA row */
.ae-prod-summary__purchase-wrap .woocommerce-variation-add-to-cart {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.ae-prod-summary__purchase-wrap .quantity .input-text {
  width: 64px;
  height: 48px;
  text-align: center;
  border: 1px solid var(--ae-color-border);
  border-radius: var(--ae-radius);
  font-size: 1rem;
}

.ae-prod-summary__purchase-wrap .single_add_to_cart_button {
  flex: 1;
  min-width: 160px;
  height: 48px;
  background: var(--ae-color-text);
  color: #fff;
  border: 2px solid var(--ae-color-text);
  border-radius: 100px;
  font-family: var(--ae-font-primary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--ae-transition), color var(--ae-transition);
}

.ae-prod-summary__purchase-wrap .single_add_to_cart_button:hover {
  background: transparent;
  color: var(--ae-color-text);
}

/* Variation price + stock */
.woocommerce-variation-price .price {
  font-size: 1.4rem;
  font-weight: 700;
}

.woocommerce-variation-availability .stock {
  font-size: .875rem;
  font-weight: 700;
}

.woocommerce-variation-availability .in-stock {
  color: var(--ae-color-green);
}

.woocommerce-variation-availability .out-of-stock {
  color: #c00;
}

/* Shipping message */
.ae-prod-summary__shipping-msg {
  margin-top: 1.25rem;
  font-size: .875rem;
  color: #444;
}

.ae-prod-summary__shipping-msg > p {
  font-weight: 700;
  margin: 0 0 .5rem;
}

/* Shipping estimator */
.ae-shipping-estimator {
  margin-top: .5rem;
}

.ae-shipping-estimator label {
  display: block;
  font-size: .8rem;
  color: #555;
  margin-bottom: .35rem;
}

.ae-shipping-estimator__fields {
  display: flex;
  gap: .5rem;
}

.ae-shipping-estimator__input {
  flex: 1;
  max-width: 160px;
  height: 38px;
  border: 1px solid var(--ae-color-border);
  border-radius: var(--ae-radius);
  padding: 0 .6rem;
  font-size: .875rem;
}

.ae-shipping-estimator__btn {
  height: 38px;
  padding: 0 1rem;
  background: var(--ae-color-text);
  color: #fff;
  border: none;
  border-radius: var(--ae-radius);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--ae-transition);
}

.ae-shipping-estimator__btn:hover {
  opacity: .85;
}

.ae-shipping-estimator__result {
  margin: .4rem 0 0;
  font-size: .825rem;
  color: var(--ae-color-green);
  min-height: 1.2em;
}

/* Features spotlight */
.ae-prod-summary__features-spotlight {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ae-color-border);
}

.ae-feature-spotlight-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .4rem;
  flex: 0 0 auto;
  min-width: 70px;
}

.ae-feature-spotlight-item__icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.ae-feature-spotlight-item__text {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #555;
}

/* ─────────────────────────────────────────────────────────────────────────
   QUICK STATS BAND
───────────────────────────────────────────────────────────────────────── */
.ae-quick-stats {
  background: var(--ae-color-bg-alt);
  padding: 2.5rem 1rem;
}

.ae-quick-stats__inner {
  max-width: var(--ae-max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.ae-quick-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  text-align: center;
  flex: 0 1 140px;
}

.ae-quick-stat-item__icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.ae-quick-stat-item__info {
  font-size: .875rem;
  font-weight: 600;
  color: var(--ae-color-text);
}

/* ─────────────────────────────────────────────────────────────────────────
   PRODUCT MODULES
───────────────────────────────────────────────────────────────────────── */
.ae-product-module {
  padding: 3rem 1rem;
}

.ae-product-module:nth-child(even) {
  background: var(--ae-color-bg-alt);
}

.ae-product-module__inner {
  max-width: var(--ae-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .ae-product-module--text-left .ae-product-module__inner,
  .ae-product-module--text-right .ae-product-module__inner {
    grid-template-columns: 1fr 1fr;
  }

  /* Flip media/content order for text-right layout */
  .ae-product-module--text-right .ae-product-module__media {
    order: 2;
  }
  .ae-product-module--text-right .ae-product-module__content {
    order: 1;
  }
}

.ae-product-module__img {
  width: 100%;
  height: auto;
  border-radius: var(--ae-radius);
}

.ae-product-module__title {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 700;
  margin: 0 0 1rem;
}

.ae-product-module__text {
  font-size: .95rem;
  line-height: 1.7;
  color: #444;
}

.ae-product-module__text p:last-child {
  margin-bottom: 0;
}

.ae-product-module__cta {
  display: inline-block;
  margin-top: 1.25rem;
  padding: .7rem 1.75rem;
  background: var(--ae-color-text);
  color: #fff;
  border-radius: 100px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity var(--ae-transition);
}

.ae-product-module__cta:hover {
  opacity: .8;
}

/* ─────────────────────────────────────────────────────────────────────────
   WHAT'S IN THE BOX
───────────────────────────────────────────────────────────────────────── */
.ae-whats-in-box {
  padding: 3rem 1rem;
  background: var(--ae-color-bg);
}

.ae-whats-in-box__inner {
  max-width: var(--ae-max-width);
  margin: 0 auto;
}

.ae-whats-in-box__heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  text-align: center;
}

.ae-whats-in-box__content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 768px) {
  .ae-whats-in-box__content {
    grid-template-columns: 1fr 1fr;
  }
}

.ae-whats-in-box__img {
  width: 100%;
  height: auto;
}

.ae-whats-in-box__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.ae-witb-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .95rem;
}

.ae-witb-item__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.ae-witb-item__qty {
  font-weight: 700;
}

.ae-witb-item__label {
  color: #777;
  font-size: .85rem;
}

/* ─────────────────────────────────────────────────────────────────────────
   TECH SPECS TABLE
───────────────────────────────────────────────────────────────────────── */
.ae-tech-specs {
  padding: 3rem 1rem;
  background: var(--ae-color-bg-alt);
}

.ae-tech-specs__inner {
  max-width: var(--ae-max-width);
  margin: 0 auto;
}

.ae-tech-specs__heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  text-align: center;
}

.ae-tech-specs__table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.ae-tech-spec-row th,
.ae-tech-spec-row td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--ae-color-border);
  text-align: left;
  vertical-align: top;
}

.ae-tech-spec-row th {
  width: 35%;
  font-weight: 700;
  color: var(--ae-color-text);
  background: rgba(0,0,0,.02);
}

.ae-tech-spec-row td {
  color: #444;
  line-height: 1.6;
}

/* ─────────────────────────────────────────────────────────────────────────
   PRESS QUOTES
───────────────────────────────────────────────────────────────────────── */
.ae-press-quotes {
  padding: 3rem 1rem;
  background: var(--ae-color-text);
  color: #fff;
}

.ae-press-quotes__inner {
  max-width: var(--ae-max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.ae-press-quote {
  flex: 0 1 320px;
  margin: 0;
  text-align: center;
}

.ae-press-quote__logo {
  max-width: 120px;
  height: auto;
  filter: brightness(0) invert(1);
  margin: 0 auto .75rem;
  display: block;
}

.ae-press-quote__text {
  font-size: .95rem;
  line-height: 1.65;
  font-style: italic;
  margin: 0 0 .75rem;
}

.ae-press-quote__source {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
}

.ae-press-quote__source a {
  color: inherit;
  text-decoration: underline;
}

/* ─────────────────────────────────────────────────────────────────────────
   RESPONSIVE OVERRIDES
───────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .ae-prod-hero {
    padding: 1rem;
  }

  .ae-product-gallery__main-slider {
    max-width: 100%;
  }

  .ae-gallery-thumb {
    width: 60px;
    height: 60px;
  }

  .ae-prod-summary__title {
    font-size: 1.4rem;
  }

  .ae-prod-summary__price .price {
    font-size: 1.3rem;
  }

  .ae-prod-summary__purchase-wrap .single_add_to_cart_button {
    width: 100%;
  }

  .ae-tech-spec-row th,
  .ae-tech-spec-row td {
    display: block;
    width: 100%;
  }

  .ae-tech-spec-row th {
    border-bottom: none;
    padding-bottom: .25rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   RELATED PRODUCTS
───────────────────────────────────────────────────────────────────────── */
.ae-single-product .related.products {
  max-width: var(--ae-max-width);
  margin: 3rem auto;
  padding: 0 1rem;
}

.ae-single-product .related.products > h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ae-color-text);
  margin: 0 0 1.5rem;
}

/* ─────────────────────────────────────────────────────────────────────────
   PRINT STYLES
───────────────────────────────────────────────────────────────────────── */
@media print {
  .ae-gallery__arrow,
  .ae-gallery__zoom-trigger,
  .ae-shipping-estimator,
  .ae-prod-summary__purchase-wrap .single_add_to_cart_button {
    display: none !important;
  }
}
