﻿/* Bookaro product page — single shell, no inner scrollbars */

.page-product .main,
.page-product .site-main {
  padding: 16px 0 calc(88px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

html.is-product-page,
body.page-product {
  overflow-x: hidden;
  max-width: 100%;
}

.bookaro-p {
  max-width: 1140px;
  margin: 0 auto;
  padding-inline: var(--gutter-inline, 16px);
}

/* One unified card */
.bookaro-p__shell {
  background: var(--surface, #fff);
  border-radius: 16px;
  box-shadow: var(--shadow-sm, 0 8px 30px rgba(15, 23, 42, 0.08));
  overflow: hidden;
}

/* Hero: mobile order = gallery → checkout → about */
.bookaro-p__hero {
  display: flex;
  flex-direction: column;
}

.bookaro-p__gallery {
  padding: 16px;
  order: 1;
}

.bookaro-p__checkout {
  padding: 16px;
  border-top: 1px solid var(--line, #e8eef5);
  background: #fafbff;
  order: 2;
}

.bookaro-p__about {
  padding: 16px;
  border-top: 1px solid var(--line);
  order: 3;
}

/* Carousel */
.product-carousel {
  position: relative;
  border-radius: 12px;
  background: #f4f8ff;
  overflow: hidden;
}

.carousel-main {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(50vh, 380px);
  object-fit: contain;
  margin: 0 auto;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

.carousel-prev { inset-inline-start: 8px; }
.carousel-next { inset-inline-end: 8px; }

.product-carousel-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.carousel-thumb {
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
}

.carousel-thumb.is-active {
  border-color: var(--accent);
}

.carousel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-cover-placeholder {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f1f5f9;
  border-radius: 12px;
}

.bookaro-p__heading {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
}

.product-desc-prose {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
}

.product-desc-prose p {
  margin: 0 0 0.6em;
}

.product-highlights {
  margin: 10px 0 0;
  padding-inline-start: 1.1rem;
  font-size: 0.92rem;
}

.product-highlights li {
  margin-bottom: 4px;
}

/* Checkout column */
.product-page-title {
  margin: 0 0 6px;
  font-size: clamp(1.15rem, 4vw, 1.5rem);
  font-weight: 800;
  line-height: 1.3;
}

.product-page-audience {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.product-specs {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-specs li {
  font-size: 0.78rem;
  padding: 3px 10px;
  background: #eff6ff;
  border-radius: 999px;
  color: #1e40af;
}

.product-price-block {
  margin: 8px 0;
}

.product-price-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent);
}

.product-price-meta {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
}

.product-stock-indicator {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #047857;
  margin-bottom: 8px;
}

.product-stock-indicator.is-low {
  color: #9a3412;
}

.product-whatsapp-quick {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #047857;
  margin-bottom: 8px;
}

.product-trust-strip {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-trust-strip li {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  background: #f0f9ff;
  border-radius: 6px;
  color: #1e3a8a;
}

/* Form — flat, no nested box */
.bookaro-p__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bookaro-p__field label,
.bookaro-p__field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--muted);
}

.bookaro-p__field input,
.bookaro-p__field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  background: #fff;
}

.qty-picker {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 6px;
  align-items: center;
  max-width: 200px;
}

.qty-picker input {
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font-weight: 800;
  font-size: 1rem;
}

.qty-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.bundle-offer-card {
  display: block;
  padding: 10px;
  border: 1px dashed #f59e0b;
  border-radius: 10px;
  background: #fffbeb;
  cursor: pointer;
}

.bundle-offer-input {
  float: inline-end;
}

.bundle-offer-inner {
  display: flex;
  gap: 10px;
  align-items: center;
}

.bundle-offer-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}

.bundle-offer-title {
  font-weight: 800;
  font-size: 0.88rem;
  display: block;
}

.bundle-offer-sub {
  font-size: 0.8rem;
  color: #92400e;
}

.product-live-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #eff6ff;
  border-radius: 8px;
  font-weight: 800;
}

.product-order-cta {
  width: 100%;
  padding: 14px !important;
  font-size: 1rem !important;
  font-weight: 800 !important;
  border-radius: 10px !important;
}

/* Extras — no extra card borders */
.bookaro-p__extras {
  border-top: 1px solid var(--line);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bookaro-p__extra + .bookaro-p__extra {
  padding-top: 0;
}

.product-video-wrap {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
}

.product-video-wrap.is-vertical {
  aspect-ratio: 9 / 16;
  max-width: 220px;
}

.product-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.product-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  max-width: 520px;
}

.product-gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
}

.product-reviews-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.product-review-card {
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 0.9rem;
}

.product-review-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.product-review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.product-review-stars {
  color: #f59e0b;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

/* Sticky mobile bar */
.sticky-mobile-order {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.sticky-mobile-order span {
  font-weight: 800;
  color: var(--accent);
}

/* Lightbox */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.image-lightbox[hidden] {
  display: none !important;
}

.image-lightbox-img {
  max-width: 96vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.image-lightbox-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  inset-inline-start: max(12px, env(safe-area-inset-left));
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

.bookaro-order-errors .alert-error,
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* Hide WooCommerce defaults */
.page-product .woocommerce-breadcrumb,
.page-product .woocommerce-product-gallery,
.page-product form.cart,
.page-product .product_meta,
.page-product .related.products {
  display: none !important;
}

.page-product div.product {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  float: none;
}

/* Tablet */
@media (min-width: 700px) {
  .product-reviews-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Desktop — 2 columns, NO scrollbar on checkout */
@media (min-width: 900px) {
  .page-product .main {
    padding-bottom: 32px;
  }

  .bookaro-p__hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    grid-template-areas:
      'gallery checkout'
      'about checkout';
    align-items: start;
    gap: 0;
  }

  .bookaro-p__gallery {
    grid-area: gallery;
    order: unset;
    padding: 20px;
    border-inline-end: 1px solid var(--line);
  }

  .bookaro-p__checkout {
    grid-area: checkout;
    order: unset;
    padding: 20px;
    border-top: 0;
    border-inline-start: 0;
    position: sticky;
    top: 72px;
    align-self: start;
    max-height: none;
    overflow: visible;
  }

  .bookaro-p__about {
    grid-area: about;
    order: unset;
    padding: 16px 20px 20px;
    border-top: 1px solid var(--line);
    border-inline-end: 1px solid var(--line);
  }

  .carousel-main {
    max-height: 320px;
  }

  .bookaro-p__extras {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
  }

  .bookaro-p__extra--wide,
  .bookaro-p__extra:only-child,
  .bookaro-p__extra:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .sticky-mobile-order {
    display: none;
  }
}

@media (max-width: 399px) {
  .product-carousel-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  html.is-product-page {
    direction: ltr;
    overflow-x: hidden;
  }

  body.page-product {
    direction: ltr;
    overflow-x: hidden;
  }

  .bookaro-p__shell {
    border-radius: 12px;
  }
}
