/* ══════════════════════════════════════════════════════════
   PRODUCT DETAILS PAGE STYLES — Shaotal
   Matches exact existing Shaotal design language
   ══════════════════════════════════════════════════════════ */

.product-detail-page {
  padding-top: var(--space-md);
  padding-bottom: var(--space-3xl);
}

/* ── Main Layout Grid (Gallery Left, Info Right) ── */
.product-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
  gap: clamp(1.5rem, 3.5vw, 2.75rem);
  align-items: start;
  margin-top: var(--space-xs);
  margin-bottom: var(--space-4xl);
}

/* ══════════════════════════════════════════════════════════
   MAIN GALLERY VIEWPORT & ZOOM
   ══════════════════════════════════════════════════════════ */
.product-gallery-container {
  max-width: 430px;
  width: 100%;
  /* Sticky: stays in view while the (taller) right column scrolls, and stops at the bottom of
     .product-detail-layout, so the full-width sections below never overlap it. */
  position: sticky;
  top: 5.5rem; /* sticky navbar (~68px) + breathing room */
  align-self: start;
}

.main-image-viewport { flex-shrink: 0; }
/* thumbnails sit on the bottom edge of the row, level with the delivery bar */
.product-gallery-container .gallery-thumbnails-row { margin-top: auto; }
.product-gallery-container .main-image-viewport + .gallery-thumbnails-row { margin-top: auto; }

.main-image-viewport {
  position: relative;
  width: 100%;
  max-height: 430px;
  aspect-ratio: 1 / 1;
  background-color: var(--color-surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-grey-200);
  overflow: hidden;
  clip-path: inset(0 round var(--radius-md));
  cursor: crosshair;
  user-select: none;
  isolation: isolate;
}

.main-image-viewport img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition: transform 120ms cubic-bezier(0.2, 0, 0.2, 1), opacity var(--transition-fast);
  will-change: transform, transform-origin;
}

.zoom-lens {
  display: none;
  pointer-events: none;
}

/* Gallery Badges & Wishlist Trigger */
.detail-badge-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 5;
  pointer-events: none;
}

.detail-wishlist-trigger {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 5;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-surface-card);
  border: 1px solid var(--color-grey-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-dark);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.detail-wishlist-trigger:hover,
.detail-wishlist-trigger.active {
  color: var(--color-sale);
  border-color: var(--color-sale);
  transform: scale(1.08);
}

.detail-wishlist-trigger svg {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-fast);
}

.detail-wishlist-trigger.active svg {
  fill: var(--color-sale);
}

/* Gallery Thumbnails List */
.gallery-thumbnails-row {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 6px 2px 6px 2px;
  margin-top: 0.65rem;
  scrollbar-width: thin;
}

.gallery-thumb-item {
  width: 84px;
  height: 84px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-grey-200);
  background-color: var(--color-surface-alt);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.gallery-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumb-item:hover,
.gallery-thumb-item.active {
  border-color: var(--color-brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xs);
}

/* ══════════════════════════════════════════════════════════
   RIGHT PURCHASE COLUMN
   ══════════════════════════════════════════════════════════ */
.product-purchase-container {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.detail-category-eyebrow {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--color-brand);
  margin-bottom: -2px;
}

.detail-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  font-weight: var(--fw-bold);
  color: var(--color-black);
  line-height: 1.2;
}

.detail-short-desc {
  font-size: 0.95rem;
  color: var(--color-grey-700);
  line-height: 1.4;
}

/* Rating Summary */
.detail-rating-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-small);
}

.rating-stars-list {
  display: flex;
  align-items: center;
  gap: 2px;
  color: #F59E0B;
}

.rating-stars-list svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.rating-score-val {
  font-weight: var(--fw-bold);
  color: var(--color-black);
}

.rating-count-link {
  color: var(--color-grey-500);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.rating-count-link:hover {
  color: var(--color-brand);
}

/* Price Section: current price, original price and discount badge on one line */
.detail-price-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.7rem;
  padding: 0;
  background: none;
  border: 0;
}

.detail-offered-price {
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: var(--fw-bold);
  color: var(--color-black);
}

.detail-original-price {
  font-size: 1.05rem;
  color: var(--color-grey-400);
  text-decoration: line-through;
  font-weight: var(--fw-medium);
}

.detail-discount-pill {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--color-white);
  background-color: var(--color-sale);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  line-height: 1.2;
}

/* Pre-order Notice Box */
.detail-preorder-notice {
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preorder-notice-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: #1E40AF;
}

.preorder-notice-header svg {
  width: 18px;
  height: 18px;
}

.preorder-notice-body {
  font-size: var(--fs-small);
  color: #1E3A8A;
  line-height: 1.5;
}

.preorder-date-highlight {
  font-weight: var(--fw-bold);
  color: #1E40AF;
}

/* Option Selectors (Colors & Sizes) */
.detail-option-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-grey-200);
}

.detail-option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-option-title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--color-dark);
}

.selected-option-value {
  color: var(--color-brand);
  font-weight: var(--fw-bold);
}

.size-guide-trigger-btn {
  background-color: var(--color-brand-light);
  color: var(--color-brand-dark);
  border: 1.5px solid var(--color-brand);
  font-size: 0.8125rem;
  font-weight: var(--fw-bold);
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  transition: all var(--transition-fast);
  box-shadow: 0 1.5px 4px rgba(204, 122, 63, 0.18);
}

.size-guide-trigger-btn svg {
  width: 15px;
  height: 15px;
  stroke: var(--color-brand);
  transition: stroke var(--transition-fast);
}

.size-guide-trigger-btn[hidden] {
  display: none;
}

.size-guide-trigger-btn:hover {
  background-color: var(--color-brand);
  color: #ffffff;
  border-color: var(--color-brand);
  box-shadow: 0 4px 12px rgba(204, 122, 63, 0.35);
  transform: translateY(-1px);
}

.size-guide-trigger-btn:hover svg {
  stroke: #ffffff;
}

.detail-color-swatches-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.detail-color-swatch-item {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.detail-color-swatch-item:hover {
  transform: scale(1.15);
}

.detail-color-swatch-item.active {
  border-color: var(--color-brand);
  transform: scale(1.15);
  box-shadow: 0 0 0 2px var(--color-white) inset, 0 0 0 2px var(--color-brand);
}

.detail-size-pills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.detail-size-pill {
  min-width: 48px;
  height: 38px;
  padding: 0 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--color-grey-200);
  border-radius: var(--radius-sm);
  background: var(--color-surface-card);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  color: var(--color-dark);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.detail-size-pill:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.detail-size-pill.active {
  border-color: var(--color-brand);
  background: var(--color-brand);
  color: var(--color-white);
  font-weight: var(--fw-bold);
  box-shadow: 0 2px 6px hsla(25, 50%, 50%, 0.25);
}

.detail-size-pill.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: line-through;
  background-color: var(--color-grey-100);
  border-color: var(--color-grey-200);
}

/* Availability Badge Indicator */
.detail-availability-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  color: var(--color-grey-700);
}

.availability-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.availability-status-dot.instock {
  background-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.availability-status-dot.lowstock {
  background-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.availability-status-dot.preorder {
  background-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Price (left) + quantity & Add to Cart (right) share one row on desktop; wraps when the column is narrow */
.detail-buy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1.25rem;
}
.detail-buy-row .detail-cta-row {
  flex: 1 1 300px;
  max-width: 440px;
  margin: 0 0 0 auto;
}

/* Quantity & Action CTA Buttons */
.detail-cta-row {
  display: flex;
  gap: 0.85rem;
  align-items: stretch;
  margin-top: 0.15rem;
}

.detail-quantity-picker {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--color-dark);
  border-radius: var(--radius-sm);
  background: var(--color-surface-card);
  height: 48px;
  flex-shrink: 0;
}

.qty-btn {
  width: 40px;
  height: 100%;
  background: none;
  border: none;
  font-size: 1.2rem;
  font-weight: var(--fw-bold);
  color: var(--color-black);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.qty-btn:hover {
  color: var(--color-brand);
}

.qty-input-field {
  width: 44px;
  height: 100%;
  border: none;
  background: none;
  text-align: center;
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: 1rem;
  color: var(--color-black);
  outline: none;
}

/* Remove number spinner buttons */
.qty-input-field::-webkit-inner-spin-button,
.qty-input-field::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.detail-actions-wrap {
  display: flex;
  flex: 1;
  gap: 0.6rem;
  min-width: 0;
}

.detail-actions-wrap .btn {
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
  padding-inline: 0.75rem;
  font-size: 0.875rem;
  white-space: nowrap;
}
.detail-actions-wrap .btn-primary { flex-grow: 1.4; }

/* ══════════════════════════════════════════════════════════
   FULL DESCRIPTION (always visible)
   ══════════════════════════════════════════════════════════ */
.detail-full-description {
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-grey-200); /* divider between purchase info and details */
}
.detail-full-description-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: var(--fw-semibold);
  color: var(--color-black);
  margin: 0 0 1rem;
}
.detail-full-description-body {
  font-size: 0.9375rem;
  color: var(--color-grey-700);
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.detail-full-description-body p { margin: 0 0 0.75rem; }
.detail-full-description-body p:last-child { margin-bottom: 0; }
.detail-full-description-body ul { padding-left: 1.25rem; margin: 0.5rem 0 0.75rem; list-style: disc outside; }
.detail-full-description-body ol { padding-left: 1.25rem; margin: 0.5rem 0 0.75rem; list-style: decimal outside; }
.detail-full-description-body li + li { margin-top: 0.4rem; }
.detail-full-description-body h1,
.detail-full-description-body h2,
.detail-full-description-body h3,
.detail-full-description-body h4 {
  font-family: var(--font-heading);
  color: var(--color-black);
  font-size: 1rem;
  font-weight: var(--fw-bold);
  margin: 1rem 0 0.5rem;
}
.detail-full-description-body > :first-child { margin-top: 0; }
.detail-full-description-body a { color: var(--color-brand); text-decoration: underline; text-underline-offset: 2px; }
.detail-full-description-body strong,
.detail-full-description-body b { font-weight: var(--fw-bold); color: var(--color-black); }
.detail-full-description-body img { max-width: 100%; height: auto; border-radius: var(--radius-md); margin: 0.5rem 0; }
.detail-full-description-body blockquote { border-left: 2px solid var(--color-brand); padding-left: 1rem; margin: 0.75rem 0; font-style: italic; }

/* ══════════════════════════════════════════════════════════
   DELIVERY & RETURNS INFO BOX
   ══════════════════════════════════════════════════════════ */
.detail-section-divider {
  border: 0;
  border-top: 1px solid var(--color-grey-200);
  margin: 0.5rem 0 0.25rem;
}

.delivery-returns-box {
  margin-top: 0.4rem;
  padding: 0.75rem 0.25rem;
  border: 1px solid var(--color-grey-200);
  border-radius: var(--radius-md);
  background-color: var(--color-surface-card);
}

.delivery-returns-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.delivery-info-col {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 0.5rem;
  row-gap: 0.15rem;
  align-content: start;
  padding: 0 0.75rem;
}
.delivery-info-col + .delivery-info-col { border-left: 1px solid var(--color-grey-200); }

.delivery-info-col svg {
  grid-row: 1;
  width: 20px;
  height: 20px;
  color: var(--color-brand);
}

.delivery-info-title {
  grid-column: 2;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: var(--fw-bold);
  line-height: 1.3;
  color: var(--color-black);
}

.delivery-info-desc {
  grid-column: 2;
  font-size: var(--fs-xs);
  color: var(--color-grey-700);
  line-height: 1.45;
}

/* ══════════════════════════════════════════════════════════
   SIZE GUIDE MODAL
   ══════════════════════════════════════════════════════════ */
.size-guide-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.size-guide-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.size-guide-modal-card {
  background: var(--color-surface-card);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.size-guide-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--color-grey-200);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.size-guide-heading {
  min-width: 0;
}

.size-guide-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: var(--fw-bold);
  color: var(--color-black);
  line-height: 1.2;
}

.size-guide-subtitle {
  margin-top: 0.25rem;
  font-size: var(--fs-small);
  color: var(--color-grey-500);
}

.size-guide-subtitle:empty {
  display: none;
}

/* Unit selector + close, pinned to the top-right of the section */
.size-guide-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.size-guide-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--color-grey-700);
  cursor: pointer;
  line-height: 1;
}

.size-guide-body {
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.size-guide-note {
  font-size: var(--fs-small);
  color: var(--color-grey-700);
}

/* Inch | CM segmented control: warm track, raised light thumb on the selected unit (display only, nothing is saved) */
.size-unit-toggle {
  display: inline-flex;
  padding: 3px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-grey-200);
  border-radius: 999px;
}

.size-unit-toggle[hidden] {
  display: none;
}

.size-unit-btn {
  min-width: 56px;
  min-height: 34px;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-grey-500);
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), box-shadow var(--transition-base);
}

.size-unit-btn:hover:not(.active) {
  color: var(--color-dark);
}

.size-unit-btn.active {
  background: var(--color-surface-card);
  color: var(--color-black);
  box-shadow: 0 1px 2px rgba(60, 40, 20, 0.12);
}

.size-unit-btn:focus-visible {
  outline: 2px solid var(--color-grey-700);
  outline-offset: 2px;
}

.size-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.size-guide-table {
  width: 100%;
  min-width: 340px;
  border-collapse: collapse;
  font-size: var(--fs-small);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.size-guide-table thead th {
  background: var(--color-surface-alt);
  font-weight: var(--fw-bold);
  color: var(--color-grey-700);
  padding: 0.7rem 0.75rem;
  white-space: nowrap;
  text-transform: uppercase;
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
}

.size-guide-table th:first-child,
.size-guide-table td:first-child {
  text-align: left;
}

/* size label: distinct, and stays visible while the measurements scroll sideways on mobile */
.size-guide-table tbody th {
  position: sticky;
  left: 0;
  background: var(--color-surface-card);
  color: var(--color-black);
  font-weight: var(--fw-bold);
  padding: 0.8rem 0.75rem;
  white-space: nowrap;
}

.size-guide-table thead th:first-child {
  position: sticky;
  left: 0;
}

.size-guide-table td {
  padding: 0.8rem 0.75rem;
  color: var(--color-grey-700);
  white-space: nowrap;
}

.size-guide-table tbody tr + tr th,
.size-guide-table tbody tr + tr td {
  border-top: 1px solid var(--color-grey-200);
}

@media (max-width: 480px) {
  .size-guide-modal-overlay { padding: 0.75rem; }
  .size-guide-header { padding: 1rem 1rem 0.85rem; }
  .size-guide-body { padding: 1rem; }
  .size-unit-btn { min-width: 48px; padding: 0 0.7rem; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .product-gallery-container {
    position: static;
  }

}

@media (max-width: 768px) {
  .detail-buy-row { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .detail-buy-row .detail-cta-row { flex: none; max-width: none; margin: 0; }
  .delivery-returns-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .delivery-info-col { padding: 0 0.5rem; }
  .delivery-info-col + .delivery-info-col { border-left: 0; border-top: 1px solid var(--color-grey-200); padding-top: 0.75rem; }
}

@media (max-width: 576px) {
  .detail-cta-row {
    display: grid;
    grid-template-columns: 4fr 6fr;
    gap: 0.75rem;
  }

  .detail-quantity-picker {
    width: 100%;
    justify-content: space-between;
  }

  .detail-actions-wrap {
    display: contents;
  }

  #detail-add-to-cart-btn {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .detail-price-box {
    gap: 0.25rem 0.6rem;
  }

  .detail-offered-price {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  .detail-original-price {
    font-size: 1.05rem;
    line-height: 1.2;
  }

  .detail-discount-pill {
    display: inline-flex;
    align-items: center;
    line-height: 1;
  }

  .gallery-thumbnails-row {
    padding: 8px 4px 8px 4px;
    margin-top: 0.5rem;
  }

  .gallery-thumb-item {
    width: 64px;
    height: 64px;
  }
}

/* ══════════════════════════════════════════════════════════
   MAIN IMAGE LIGHTBOX (assets/js/image-lightbox.js)
   ══════════════════════════════════════════════════════════ */
.main-image-viewport { cursor: zoom-in; }
.main-image-viewport:focus-visible { outline: 2px solid var(--color-primary, currentColor); outline-offset: 2px; }

.lb {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(10, 10, 12, 0.88);
  opacity: 0; transition: opacity 200ms ease;
  overscroll-behavior: contain;
}
.lb[hidden] { display: none; }
.lb.is-open { opacity: 1; }
.lb-stage {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.lb-stage.is-zoomed { cursor: grab; }
.lb-stage.is-zoomed:active { cursor: grabbing; }
.lb-img {
  max-width: 100%; max-height: 100%; object-fit: contain; display: block;
  transform-origin: center center; will-change: transform;
  transform: scale(.96); transition: transform 200ms ease;
  -webkit-user-drag: none; user-select: none;
}
.lb.is-open .lb-img { transform: none; }
.lb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px;
  background: rgba(255,255,255,.14); color: #fff; cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background 150ms ease, opacity 150ms ease;
}
.lb-btn:hover:not(:disabled) { background: rgba(255,255,255,.26); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-btn:disabled { opacity: .4; cursor: default; }
.lb-close {
  position: absolute; z-index: 2;
  top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right));
}
.lb-controls {
  position: absolute; z-index: 2; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; gap: 8px; padding: 6px; border-radius: 999px; background: rgba(0,0,0,.35);
}
.lb-reset { min-width: 64px; font: 600 .8125rem/1 var(--font-body, system-ui, sans-serif); padding: 0 12px; }
@media (prefers-reduced-motion: reduce) {
  .lb, .lb-img, .lb-btn { transition: none; }
}
