/* E-commerce pages */
body.product-detail-page {
  --shop-topbar-offset: var(--site-top-offset);
}

body.product-detail-page .site-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  width: 100%;
}

body.product-detail-page .shop-page {
  padding-top: calc(var(--shop-topbar-offset) + 32px);
}

.top-actions {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-actions__link {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  opacity: .95;
}

.top-actions__link:hover { opacity: 1; text-decoration: underline; }

.top-actions__cart {
  position: relative;
  color: #fff;
  display: flex;
  align-items: center;
}

.top-actions__cart svg {
  width: 22px;
  height: 22px;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fff;
  color: var(--promo-red);
  font-size: 10px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
}

.product-card__link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.shop-page {
  padding: 32px 0 64px;
}

.shop-page h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.shop-form {
  max-width: 480px;
  margin: 0 auto;
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  font: inherit;
  background: #fff;
}

.form-field input:focus,
.form-field select:focus {
  outline: 2px solid rgba(31, 74, 46, .25);
  border-color: #1f4a2e;
}

.form-error {
  color: #971316;
  font-size: 13px;
  margin-bottom: 12px;
}

.form-success {
  color: #1f4a2e;
  font-size: 13px;
  margin-bottom: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, transform .2s, opacity .2s;
}

.btn:hover { transform: translateY(-1px); }

.btn--primary {
  background: #1f4a2e;
  color: #fff;
}

.btn--primary:hover { background: #163622; }

.btn--secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn--outline {
  background: transparent;
  border: 2px solid #1f4a2e;
  color: #1f4a2e;
}

.btn--block { width: 100%; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

/* Product detail page */
.product-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 24px;
  opacity: .85;
}

.product-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.product-breadcrumb a:hover { text-decoration: underline; }

.product-breadcrumb__sep { opacity: .5; }

.product-breadcrumb__current {
  opacity: .7;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 48px;
  align-items: start;
  margin-bottom: 48px;
}

.product-gallery {
  position: relative;
}

.product-gallery__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  background: var(--badge-sale);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 6px;
}

.product-gallery__main {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .25s ease;
}

.product-gallery__thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.product-gallery__thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: border-color .2s;
}

.product-gallery__thumb.is-active,
.product-gallery__thumb:hover {
  border-color: var(--text-primary);
}

.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-buybox {
  position: sticky;
  top: calc(var(--shop-topbar-offset, var(--site-top-offset, 64px)) + 16px);
}

.product-vendor {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .65;
  margin-bottom: 8px;
}

.product-type {
  font-size: 13px;
  opacity: .7;
  margin: -8px 0 12px;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.product-rating__stars {
  color: #f5a623;
  letter-spacing: 1px;
}

.product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.product-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.product-badge--shipping {
  background: #e8f5e9;
  color: #1f4a2e;
}

.product-badge--sale {
  background: var(--badge-sale);
  color: #fff;
}

.product-actions {
  margin: 24px 0;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.qty-stepper__btn {
  width: 44px;
  height: 44px;
  border: none;
  background: var(--bg-secondary);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.qty-stepper__btn:hover { background: #e8e8e8; }

.qty-stepper input {
  width: 56px;
  height: 44px;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  text-align: center;
  font: inherit;
  font-weight: 700;
}

.product-actions__buttons {
  display: grid;
  gap: 12px;
}

.product-trust {
  list-style: none;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

.product-trust li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.5;
  opacity: .9;
}

.product-trust li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #1f4a2e;
  font-weight: 800;
}

.product-highlights {
  margin: 0 0 20px;
  padding: 16px 18px;
  list-style: none;
  border: 1px solid rgba(18, 18, 18, .08);
  border-radius: 12px;
  background: rgba(199, 162, 84, .06);
}

.product-highlights li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: #333;
}

.product-highlights li + li {
  margin-top: 8px;
}

.product-highlights li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #c7a254;
  font-weight: 700;
}

.product-accordions {
  border-top: 1px solid #eee;
  padding-top: 8px;
}

.product-accordion {
  border-bottom: 1px solid #eee;
}

.product-accordion summary {
  padding: 18px 0;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-accordion summary::-webkit-details-marker { display: none; }

.product-accordion summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.product-accordion[open] summary::after { content: "−"; }

.product-accordion__body,
.product-prose {
  padding-bottom: 24px;
}

.product-accordion__list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

.product-accordion__list li { margin-bottom: 8px; }

.product-prose {
  line-height: 1.75;
  color: var(--text-secondary);
}

.product-prose h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 24px 0 12px;
  color: var(--text-primary);
}

.product-prose h2:first-child { margin-top: 0; }

.product-prose p { margin-bottom: 14px; }

.product-prose ul,
.product-prose ol {
  margin: 0 0 16px 20px;
}

.product-prose li { margin-bottom: 8px; }

.product-prose strong { font-weight: 800; }

.product-prose a {
  color: #2b00ff;
  text-decoration: underline;
}

.product-prose img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 12px 0;
}

.product-loading,
.product-empty {
  text-align: center;
  padding: 64px 0;
  opacity: .8;
}

/* Source-style product page */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.product-page__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 56px;
  align-items: start;
  margin-bottom: 56px;
}

.product-info {
  position: sticky;
  top: calc(var(--shop-topbar-offset, var(--site-top-offset, 64px)) + 16px);
}

.product-info__rating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
}

.product-info__rating a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.product-info__title {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -.01em;
}

.product-info__subtitle {
  font-size: 14px;
  line-height: 1.65;
  opacity: .85;
  margin-bottom: 16px;
  max-width: 52ch;
}

.product-info__type {
  font-size: 13px;
  opacity: .65;
  margin: -4px 0 16px;
}

.product-info__stock {
  font-size: 13px;
  font-weight: 700;
  color: #971316;
  margin: -12px 0 20px;
}

.product-info__stock.is-out {
  color: #666;
}

.product-info__social {
  font-size: 12px;
  opacity: .65;
  margin: 8px 0 20px;
  font-style: italic;
}

.product-info__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.product-info__price.price-list--lg {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  width: 100%;
}

.product-info__price .sale-price {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  color: var(--sale-color);
  line-height: 1;
}

.product-info__price .compare-price {
  font-size: 1rem;
  text-decoration: line-through;
  opacity: .55;
}

.product-info__price .discount-badge {
  background: var(--badge-sale);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
}

.product-badge--bestseller {
  background: #121212;
  color: #fff;
}

.product-badge--promo {
  background: #f2f2f2;
  color: #121212;
}

.product-badge--shipping {
  background: #e8f5e9;
  color: #1f4a2e;
}

.product-badge--ship {
  background: #121212;
  color: #fff;
}

.variant-picker {
  margin-bottom: 20px;
  padding-top: 4px;
}

.variant-picker__option {
  border: none;
  margin: 0 0 20px;
  padding: 0;
}

.variant-picker__legend {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
  display: block;
  line-height: 1.5;
}

.variant-picker__legend .variant-picker__value {
  font-weight: 600;
  opacity: .85;
}

.variant-picker__guide {
  float: right;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: .75;
}

.variant-picker__guide:hover {
  opacity: 1;
}

.variant-picker__values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.block-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  min-width: 52px;
  padding: 10px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: border-color .2s, background .2s, opacity .2s, box-shadow .2s;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  user-select: none;
}

.block-swatch span {
  pointer-events: none;
}

.block-swatch:hover:not(.is-disabled) {
  border-color: #121212;
}

.block-swatch.is-selected {
  border-color: #121212;
  background: #f7f7f7;
  box-shadow: inset 0 0 0 1px #121212;
}

.block-swatch.is-disabled {
  opacity: .35;
  cursor: not-allowed;
  text-decoration: line-through;
}

.product-form__quantity {
  margin: 24px 0 16px;
}

.product-form__buttons {
  display: grid;
  gap: 12px;
  margin-bottom: 8px;
}

.btn--cart {
  background: #121212;
  color: #fff;
  border: 2px solid #121212;
}

.btn--cart:hover {
  background: #000;
}

.btn--buy {
  background: #fff;
  color: #121212;
  border: 2px solid #121212;
}

.btn--buy:hover {
  background: #f7f7f7;
}

.btn--cart:disabled,
.btn--buy:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.product-guide {
  margin: 48px 0 64px;
  padding-top: 32px;
  border-top: 1px solid #eee;
}

.product-guide__title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.product-guide__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.product-guide__card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.product-guide__card strong {
  font-size: 1.1rem;
}

.product-specs p {
  margin-bottom: 10px;
  line-height: 1.6;
}

.cart-item__variant {
  font-size: 12px;
  opacity: .7;
  margin-top: 4px;
  line-height: 1.4;
}

.product-gallery__main {
  aspect-ratio: 1;
  background: #f7f7f7;
  border-radius: 10px;
}

.product-gallery__thumb {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  border-radius: 8px;
}

.product-detail__gallery img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--bg-secondary);
}

.product-detail__gallery .img-secondary {
  margin-top: 12px;
  max-height: 120px;
  object-fit: cover;
}

.product-detail__title {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
}

.product-detail__price {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.product-detail__price .sale-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--sale-color);
}

.product-detail__price .compare-price {
  font-size: 16px;
  text-decoration: line-through;
  opacity: .6;
}

.product-detail__desc {
  line-height: 1.7;
  opacity: .9;
  margin-bottom: 24px;
}

.qty-field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.qty-field input {
  width: 72px;
  padding: 10px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: var(--radius);
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th,
.cart-table td {
  padding: 16px 8px;
  border-bottom: 1px solid #eee;
  text-align: left;
  vertical-align: middle;
}

.cart-table img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius);
}

.cart-item__title {
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}

.cart-item__title:hover { text-decoration: underline; }

.cart-summary {
  max-width: 360px;
  margin-left: auto;
  margin-top: 24px;
  padding: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.cart-summary__row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 700;
}

.cart-summary__row--total {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed rgba(18, 18, 18, .12);
  font-size: 1.05rem;
}

.cart-shipping-note {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(18, 18, 18, .55);
}

.cart-shipping-note--free {
  color: #1f4a2e;
}

.cart-empty {
  text-align: center;
  padding: 48px 0;
  opacity: .8;
}

.auth-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
}

.auth-switch a {
  font-weight: 700;
}

@media (max-width: 900px) {
  .product-detail,
  .product-detail-layout,
  .product-page__grid {
    grid-template-columns: 1fr;
  }

  .product-info,
  .product-buybox {
    position: static;
  }

  .product-gallery__main {
    aspect-ratio: 1;
  }

  .block-swatch {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 12px;
  }

  .top-actions {
    position: static;
    transform: none;
    justify-content: center;
    padding-bottom: 4px;
  }

  .cart-table thead { display: none; }
  .cart-table tr { display: block; margin-bottom: 16px; border-bottom: 1px solid #eee; }
  .cart-table td { display: block; border: none; padding: 6px 0; }
}
