/* Product page additions: swipeable gallery, discount pricing, badges, toast. */

.gallery-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  touch-action: pan-y;
}

#productImage {
  touch-action: pan-y;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform .25s cubic-bezier(.34, 1.3, .64, 1);
  cursor: grab;
}
#productImage.dragging { transition: none; cursor: grabbing; }

@keyframes gallerySlideFromRight { from { opacity: 0; transform: translateX(46px); } to { opacity: 1; transform: translateX(0); } }
@keyframes gallerySlideFromLeft  { from { opacity: 0; transform: translateX(-46px); } to { opacity: 1; transform: translateX(0); } }
#productImage.slide-in-right { animation: gallerySlideFromRight .3s ease; }
#productImage.slide-in-left  { animation: gallerySlideFromLeft .3s ease; }

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 22px rgba(42, 59, 36, .18);
  color: #2A3B24;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease, background .2s ease;
}
.product-gallery:hover .gallery-arrow,
.gallery-arrow:focus-visible { opacity: 1; }
.gallery-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.1); }
.gallery-prev { inset-inline-start: 16px; }
.gallery-next { inset-inline-end: 16px; }
@media (hover: none) { .gallery-arrow { opacity: 1; } }
.product-gallery .gallery-arrow,
.product-gallery .gallery-dots { display: none; }
.product-gallery-shell { display: grid; gap: 14px; }
.product-gallery-shell .product-thumbs {
  position: static;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 0 8px;
  z-index: auto;
}
.product-gallery-shell .product-thumb {
  width: 66px;
  height: 66px;
  border-radius: 16px;
  border: 2px solid rgba(155, 197, 130, .22);
  background: #fff;
  padding: 4px;
  box-shadow: 0 8px 20px rgba(42, 59, 36, .08);
  opacity: .72;
}
.product-gallery-shell .product-thumb.active,
.product-gallery-shell .product-thumb:hover { opacity: 1; border-color: var(--primary, #9BC582); transform: translateY(-2px); }
.product-gallery-shell .product-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }

.gallery-dots {
  position: absolute;
  bottom: 96px;
  inset-inline: 0;
  display: flex;
  justify-content: center;
  gap: 7px;
  z-index: 4;
}
.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(42, 59, 36, .22);
  transition: width .2s ease, background .2s ease;
}
.gallery-dot.active { width: 22px; border-radius: 5px; background: var(--primary, #9BC582); }

.product-discount-badge { top: 18px; inset-inline-end: 18px; z-index: 5; }
.discount-badge {
  position: absolute;
  background: linear-gradient(135deg, #E04848, #F26D4B);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(224, 72, 72, .3);
}

.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price-old {
  font-size: 1rem;
  font-weight: 700;
  color: #8A9585;
  text-decoration: line-through;
  text-decoration-color: #E04848;
  text-decoration-thickness: 2px;
}

.related-card { position: relative; }
.related-card .discount-badge { top: 10px; inset-inline-end: 10px; font-size: .72rem; padding: 4px 9px; }
.related-card .price-old { font-size: .82rem; margin-inline-end: 4px; }

.reviews-empty {
  padding: 26px;
  border: 2px dashed #DCE3D4;
  border-radius: 18px;
  text-align: center;
  color: #6A7A63;
  font-weight: 600;
}

.customer-review header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.group-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: color-mix(in srgb, var(--badge-color, #7EA966) 16%, #fff);
  color: var(--badge-color, #7EA966);
  border: 1px solid color-mix(in srgb, var(--badge-color, #7EA966) 40%, #fff);
  font-size: .72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}
.group-badge i { font-size: .7rem; }

.heart-button.active { color: #E04848; background: #FFF0F0; }

/* Toast */
.toast {
  position: fixed;
  inset-block-end: 22px;
  inset-inline-end: 22px;
  z-index: 90;
  width: min(340px, calc(100vw - 32px));
  background: #fff;
  border-radius: 18px;
  border-inline-start: 5px solid var(--primary, #9BC582);
  box-shadow: 0 22px 55px rgba(42, 59, 36, .22);
  padding: 16px 18px;
  transform: translateY(24px) scale(.96);
  opacity: 0;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.34, 1.4, .64, 1), opacity .28s ease;
}
.toast.show { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.toast strong { display: block; font-size: 1.02rem; font-weight: 800; color: #2A3B24; margin-bottom: 5px; }
.toast p { margin: 0; font-size: .9rem; color: #5C6B56; line-height: 1.8; }
.toast button {
  position: absolute;
  top: 10px;
  inset-inline-start: 12px;
  border: 0;
  background: none;
  font-size: 1.3rem;
  line-height: 1;
  color: #98A392;
  cursor: pointer;
}
.toast.toast-error { border-inline-start-color: #E04848; }
.toast.toast-error strong { color: #B93030; }

.product-page { padding-bottom: 72px; }
.product-page .breadcrumb { padding: 22px 0 10px; font-size: .88rem; }
.breadcrumb-current { color: var(--text-dark, #2A3B24); font-weight: 800; }
.product-main { padding: 18px 0 72px; }
.product-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 52px;
  align-items: center;
}
.product-gallery {
  background-color: var(--bg-hero, #F6F3E6);
  border-radius: 30px;
  padding: 44px 32px;
  min-height: 500px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 50px rgba(155, 197, 130, .1), 0 22px 55px rgba(42, 59, 36, .08);
  overflow: hidden;
}
.gallery-bg-blob {
  position: absolute;
  width: 80%;
  height: 80%;
  background: var(--primary-light, #EAF3E4);
  border-radius: 50%;
  z-index: 0;
  animation: pulse-bg 5s ease-in-out infinite;
}
.product-gallery #productImage {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  max-height: 390px;
  object-fit: contain;
  filter: drop-shadow(0 25px 35px rgba(42, 59, 36, .15));
  animation: float-img 6s ease-in-out infinite;
}
.gallery-badge {
  position: absolute;
  top: 30px;
  right: 30px;
  z-index: 6;
  background: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 900;
  color: var(--text-dark, #2A3B24);
  box-shadow: var(--shadow-soft, 0 12px 35px rgba(42, 59, 36, .06));
  border: 2px solid var(--primary-border, #D1E5C5);
  display: flex;
  align-items: center;
  gap: 6px;
}
.gallery-badge i { color: var(--star-color, #F5A623); }
.product-discount-badge { top: 30px; left: 30px; right: auto; z-index: 6; }
.product-info { padding: 10px 0; background: transparent; border: 0; box-shadow: none; }
.eyebrow { margin: 0 0 8px; color: var(--primary-hover, #7EA966); font-weight: 900; font-size: .88rem; }
.title-row { display: block; }
.product-title {
  font-family: 'Lalezar', cursive;
  font-size: clamp(2.05rem, 4vw, 3.05rem);
  color: var(--text-dark, #2A3B24);
  line-height: 1.2;
  margin: 0 0 12px;
}
.product-meta-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; font-size: .9rem; font-weight: 800; color: var(--text-muted, #8E9C88); flex-wrap: wrap; }
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-rating { color: var(--star-color, #F5A623); }
.meta-divider { width: 4px; height: 4px; background: var(--border-light, #EAE6D8); border-radius: 50%; }
.product-price { font-size: clamp(1.85rem, 4vw, 2.45rem); font-weight: 900; color: var(--primary-hover, #7EA966); margin-bottom: 18px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.product-price strong { font-size: inherit; }
.product-price span { font-size: 1.05rem; font-weight: 700; color: var(--text-muted, #8E9C88); }
.product-price .price-old { font-size: 1rem; }
.product-kicker { margin: 0 0 12px; color: var(--text-dark, #2A3B24); font-weight: 900; line-height: 1.8; }
.product-brief {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}
.product-desc {
  font-size: 1.05rem;
  color: var(--text-body, #4A5D43);
  line-height: 2;
  margin: 0;
}
.product-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.product-detail-item {
  min-height: 64px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  column-gap: 10px;
  background: #fff;
  border: 1px solid var(--border-light, #EAE6D8);
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 8px 22px rgba(42, 59, 36, .05);
}
.product-detail-item i {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark, #2A3B24);
  background: var(--primary-light, #EAF3E4);
}
.product-detail-item span { color: var(--text-muted, #8E9C88); font-size: .78rem; font-weight: 800; }
.product-detail-item strong { color: var(--text-dark, #2A3B24); font-size: .92rem; line-height: 1.5; }
.product-highlights { display: flex; gap: 8px; flex-wrap: wrap; }
.product-highlight-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--bg-hero, #F6F3E6);
  border: 1px solid var(--border-light, #EAE6D8);
  color: var(--text-dark, #2A3B24);
  font-size: .85rem;
  font-weight: 900;
}
.product-highlight-item i { color: var(--primary-hover, #7EA966); }
.options-row { display: flex; gap: 22px; margin-bottom: 22px; flex-wrap: wrap; }
.option-group h4 { font-size: .95rem; font-weight: 800; color: var(--text-dark, #2A3B24); margin: 0 0 12px; }
.option-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.opt-btn {
  min-height: 42px;
  padding: 8px 18px;
  border: 2px solid var(--border-light, #EAE6D8);
  background: #fff;
  border-radius: 999px;
  font-weight: 700;
  color: var(--text-muted, #8E9C88);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.opt-btn small { color: inherit; font-size: .72rem; font-weight: 800; }
.opt-btn.active, .opt-btn.selected { border-color: var(--primary, #9BC582); background: var(--primary-light, #EAF3E4); color: var(--text-dark, #2A3B24); }
.opt-btn:hover:not(.active) { border-color: var(--primary-border, #D1E5C5); color: var(--primary-hover, #7EA966); }
.product-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.qty-selector { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 2px solid var(--border-light, #EAE6D8); border-radius: 999px; height: 54px; padding: 4px; min-width: 132px; }
.qty-btn { width: 42px; height: 42px; border-radius: 50%; background: var(--bg-hero, #F6F3E6); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: var(--text-dark, #2A3B24); font-weight: 900; }
.qty-btn:hover { background: var(--primary-light, #EAF3E4); color: var(--primary-hover, #7EA966); }
.qty-input { width: 42px; text-align: center; border: 0; font-weight: 900; font-size: 1.1rem; color: var(--text-dark, #2A3B24); outline: 0; background: transparent; }
.btn-main-cart {
  flex: 1;
  min-width: 220px;
  height: 58px;
  background: var(--text-dark, #2A3B24);
  color: var(--bg-cream, #FDFBF7);
  border-radius: var(--radius-pill, 9999px);
  font-weight: 900;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(42, 59, 36, .28);
  transition: var(--transition, all .35s cubic-bezier(.34, 1.56, .64, 1));
}
.btn-main-cart i { font-size: 1.15rem; transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.btn-main-cart::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .6s ease;
}
.btn-main-cart:hover {
  background: var(--primary, #9BC582);
  color: var(--text-dark, #2A3B24);
  box-shadow: 0 18px 36px rgba(155, 197, 130, .45);
  transform: translateY(-3px);
}
.btn-main-cart:hover i { transform: scale(1.15) rotate(-8deg); }
.btn-main-cart:hover::before { transform: translateX(100%); }
.btn-main-cart:active { transform: translateY(-1px) scale(.98); }
.btn-main-cart:disabled { background: #C9CFC3; color: #fff; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-fav-large { width: 54px; height: 54px; background: #fff; border: 2px solid var(--border-light, #EAE6D8); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-muted, #8E9C88); box-shadow: 0 4px 10px rgba(0,0,0,.05); font-size: 1.45rem; }
.btn-fav-large:hover { border-color: #E04848; color: #E04848; transform: scale(1.05); }
.product-features {
  margin-top: 40px;
  padding: 24px;
  background: var(--bg-hero, #F6F3E6);
  border: 1px solid var(--border-light, #EAE6D8);
  border-radius: var(--radius-md, 24px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: .92rem;
  color: var(--text-dark, #2A3B24);
  background: #fff;
  border: 1px solid var(--border-light, #EAE6D8);
  border-radius: var(--radius-sm, 16px);
  padding: 12px 14px;
  box-shadow: 0 6px 16px rgba(42, 59, 36, .05);
  transition: var(--transition, all .35s cubic-bezier(.34, 1.56, .64, 1));
}
.feature-item:hover { transform: translateY(-3px); box-shadow: 0 12px 22px rgba(42, 59, 36, .1); border-color: var(--primary-border, #D1E5C5); }
.feature-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--bg-cream, #FDFBF7);
  background: var(--text-dark, #2A3B24);
  box-shadow: 0 6px 14px rgba(42, 59, 36, .3);
}
.feature-text { line-height: 1.4; }
.related-products { background: var(--bg-hero, #F6F3E6); border-radius: 44px; padding-inline: 24px; }
.review-form { position: relative; display: grid; gap: 12px; background: #fff; border: 1px solid #EAE6D8; border-radius: 22px; padding: 18px; margin-bottom: 18px; }
.review-form[hidden] { display: none; }
.review-form label { display: grid; gap: 6px; font-weight: 800; color: #2A3B24; }
.review-form input, .review-form textarea { width: 100%; border: 1px solid #EAE6D8; border-radius: 14px; padding: 11px 13px; background: #fff; }
.review-form textarea { min-height: 110px; resize: vertical; }
.review-close { position: absolute; top: 12px; left: 14px; font-size: 1.25rem; color: #8E9C88; background: none; }
.star-picker { display: flex; gap: 4px; direction: ltr; justify-content: flex-end; }
.star-picker button { color: #F5A623; font-size: 1.35rem; background: none; }
.customer-review { background: #fff; border: 1px solid #EAE6D8; border-radius: 18px; padding: 16px; margin-bottom: 10px; }
.customer-review p { margin: 8px 0 0; color: #4A5D43; line-height: 1.9; }

@media (max-width: 820px) {
  .product-page { padding-bottom: 132px; }
  .product-page .breadcrumb { padding: 14px 0 8px; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
  .product-page .breadcrumb::-webkit-scrollbar { display: none; }
  .product-grid-layout { grid-template-columns: 1fr; gap: 18px; }
  .product-main { padding-top: 10px; padding-bottom: 38px; }
  .product-gallery { min-height: auto; aspect-ratio: 1 / .92; border-radius: 24px; padding: 24px 12px 62px; }
  .product-gallery #productImage { max-height: 260px; }
  .gallery-bg-blob { width: 78%; height: 78%; }
  .gallery-badge { top: 14px; right: 14px; padding: 6px 12px; font-size: .82rem; }
  .product-discount-badge { top: 14px; left: 14px; }
  .product-gallery-shell .product-thumbs { justify-content: flex-start; overflow-x: auto; padding: 0 2px 4px; scrollbar-width: none; }
  .product-gallery-shell .product-thumbs::-webkit-scrollbar { display: none; }
  .product-gallery-shell .product-thumb { width: 58px; height: 58px; border-radius: 14px; }
  .product-title { font-size: 2rem; margin-bottom: 8px; }
  .product-meta-top { margin-bottom: 14px; gap: 9px; }
  .product-price { margin-bottom: 12px; font-size: 1.85rem; }
  .product-price span { font-size: .88rem; }
  .product-desc { font-size: .96rem; line-height: 1.9; }
  .product-detail-list { grid-template-columns: 1fr 1fr; gap: 8px; }
  .product-detail-item { min-height: 58px; border-radius: 16px; padding: 9px 10px; }
  .product-detail-item strong { font-size: .84rem; }
  .options-row { gap: 16px; margin-bottom: 100px; }
  .option-group { width: 100%; }
  .option-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .opt-btn { justify-content: center; min-height: 46px; padding: 8px 10px; border-radius: 16px; text-align: center; }
  .purchase-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 70;
    display: grid;
    grid-template-columns: 104px 1fr 48px;
    gap: 8px;
    align-items: center;
    padding: 10px;
    background: rgba(253, 251, 247, .96);
    border: 1px solid rgba(209, 229, 197, .8);
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(42, 59, 36, .22);
    backdrop-filter: blur(14px);
  }
  .qty-selector { width: 100%; min-width: 0; height: 48px; }
  .qty-btn { width: 36px; height: 36px; }
  .qty-input { width: 26px; }
  .btn-main-cart { width: 100%; min-width: 0; height: 48px; font-size: .92rem; }
  .btn-fav-large { width: 48px; height: 48px; margin: 0; }
  .product-features { grid-template-columns: 1fr; }
  .gallery-dots { bottom: 82px; }
}

@media (max-width: 390px) {
  .product-detail-list { grid-template-columns: 1fr; }
  .purchase-panel { grid-template-columns: 96px 1fr 44px; left: 8px; right: 8px; bottom: 8px; border-radius: 20px; }
  .btn-main-cart { font-size: .85rem; }
  .btn-main-cart i { display: none; }
}
