/* ========================================
   PRODUCT DETAIL LAYOUT
======================================== */
.product-page {
  padding-block-start: 38px;
}

.product-breadcrumb {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--font-size-sm);
  gap: 9px;
  margin-block-end: 34px;
}

.product-breadcrumb a {
  transition: color var(--transition-fast);
}

.product-breadcrumb a:hover,
.product-breadcrumb a:focus-visible {
  color: var(--brown);
}

.product-breadcrumb-separator {
  color: var(--gold);
}

.product-overview {
  align-items: start;
  display: grid;
  gap: clamp(32px, 5vw, 62px);
  grid-template-columns: minmax(0, 1.03fr) minmax(360px, 0.97fr);
  padding-block-end: 78px;
}

/* ========================================
   PRODUCT GALLERY
======================================== */
.product-gallery {
  min-inline-size: 0;
}

.product-main-media {
  border-radius: var(--radius-xl);
  margin: 0;
  padding: 10px;
}

.product-main-image {
  aspect-ratio: 1 / 1.04;
  border-radius: var(--radius-lg);
  inline-size: 100%;
  object-fit: cover;
  object-position: center 43%;
  transition: object-position var(--transition-base), transform var(--transition-base);
}

.product-main-image[data-view="detail"] {
  object-position: center 61%;
  transform: scale(1.17);
}

.product-main-image[data-view="binding"] {
  object-position: center 78%;
  transform: scale(1.14);
}

.product-thumbnails {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-block-start: var(--space-4);
}

.product-thumbnail {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 5px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.product-thumbnail:hover,
.product-thumbnail:focus-visible,
.product-thumbnail.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--color-focus-ring);
}

.product-thumbnail.is-active {
  transform: translateY(-2px);
}

.product-thumbnail img {
  aspect-ratio: 1 / 0.82;
  border-radius: var(--radius-sm);
  inline-size: 100%;
  object-fit: cover;
}

.product-thumbnail[data-view="detail"] img {
  object-position: center 64%;
  transform: scale(1.18);
}

.product-thumbnail[data-view="binding"] img {
  object-position: center 84%;
  transform: scale(1.18);
}

/* ========================================
   PRODUCT SUMMARY
======================================== */
.product-summary {
  min-inline-size: 0;
  padding-block-start: 5px;
}

.product-summary .badge {
  margin-block-end: var(--space-4);
}

.product-title {
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 650;
  line-height: 1.6;
  margin: 0 0 var(--space-4);
}

.product-excerpt {
  color: var(--muted);
  font-size: var(--font-size-md);
  line-height: 2.15;
  margin: 0 0 var(--space-6);
}

.product-price {
  align-items: center;
  border-block: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-block-end: var(--space-6);
  padding-block: var(--space-5);
}

.product-price > .amount,
.product-price ins {
  color: var(--ink);
  font-size: clamp(25px, 2.6vw, 31px);
  font-weight: var(--font-weight-semibold);
}

.product-price ins {
  text-decoration: none;
}

.product-price del {
  color: var(--muted);
  font-size: var(--font-size-base);
  order: 2;
}

.product-price .badge {
  margin-block-end: 0;
  order: 3;
}

.product-mode-label,
.product-status-label {
  color: var(--brown);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.product-meta {
  border-block-end: 1px solid var(--line);
  display: grid;
  gap: var(--space-3);
  margin: 0 0 var(--space-6);
  padding-block-end: var(--space-6);
}

.product-meta div {
  align-items: baseline;
  display: flex;
  gap: var(--space-4);
}

.product-meta dt {
  color: var(--muted);
  flex: 0 0 86px;
  font-size: var(--font-size-sm);
}

.product-meta dd {
  color: var(--ink);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  margin: 0;
}

.product-meta .in-stock {
  color: var(--brown);
}

.product-meta .out-of-stock {
  color: var(--muted);
}

.product-meta .in-stock::before {
  background: var(--gold);
  block-size: 8px;
  border-radius: 50%;
  content: "";
  display: inline-block;
  inline-size: 8px;
  margin-inline-end: var(--space-2);
}

.cart-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-block-end: var(--space-5);
}

.product-quantity {
  flex: 0 0 137px;
}

.quantity-control {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: 42px minmax(48px, 1fr) 42px;
  min-block-size: 50px;
  overflow: hidden;
}

.quantity-control button {
  align-items: center;
  background: transparent;
  color: var(--brown);
  display: inline-flex;
  font-size: 20px;
  justify-content: center;
  transition: background var(--transition-fast);
}

.quantity-control button:hover,
.quantity-control button:focus-visible {
  background: var(--color-gold-soft);
}

.quantity-input {
  appearance: textfield;
  background: transparent;
  border: 0;
  border-inline: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--font-en);
  inline-size: 100%;
  outline: 0;
  padding-inline: 4px;
  text-align: center;
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.product-add-cart {
  flex: 1 1 240px;
  min-block-size: 52px;
}

.purchase-note,
.product-purchase-note {
  background: var(--color-surface-glass);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: var(--font-size-sm);
  line-height: 2;
  margin: 0 0 var(--space-6);
  padding: var(--space-3) var(--space-4);
}

.product-inquiry-actions,
.product-add-cart-wrapper {
  margin-block-end: var(--space-5);
}

.product-add-cart-wrapper form.cart,
.product-add-cart-wrapper .variations_form {
  display: grid;
  gap: var(--space-3);
}

.product-add-cart-wrapper .single_add_to_cart_button {
  min-block-size: 52px;
}

.product-trust {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.product-trust li {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  font-size: var(--font-size-xs);
  gap: var(--space-2);
  justify-content: center;
  min-block-size: 82px;
  padding: var(--space-3) var(--space-2);
  text-align: center;
}

.product-trust svg {
  block-size: 22px;
  color: var(--brown);
  inline-size: 22px;
}

/* ========================================
   PRODUCT EDITOR CONTENT
======================================== */
.product-description {
  background: var(--color-surface-subtle);
  border-block: 1px solid var(--color-border-section);
  padding-block: 70px 74px;
}

.product-section-heading {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  margin-block-end: var(--space-8);
}

.product-section-heading h2 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-2);
}

.product-section-heading p {
  color: var(--muted);
  font-size: var(--font-size-base);
  margin: 0;
}

.product-content {
  color: var(--ink);
  font-size: var(--font-size-md);
  line-height: var(--line-height-editorial);
  overflow-wrap: anywhere;
}

.product-content > *:first-child {
  margin-block-start: 0;
}

.product-content h1,
.product-content h2,
.product-content h3,
.product-content h4 {
  color: var(--ink);
  font-weight: var(--font-weight-semibold);
  line-height: 1.75;
  margin-block: 42px var(--space-4);
}

.product-content h1 {
  font-size: clamp(29px, 3vw, 36px);
}

.product-content h2 {
  font-size: clamp(25px, 2.6vw, 30px);
}

.product-content h3 {
  font-size: clamp(21px, 2.1vw, 24px);
}

.product-content h4 {
  font-size: var(--font-size-lg);
}

.product-content p {
  margin-block: 0 var(--space-6);
}

.product-content a {
  color: var(--brown);
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: var(--color-gold-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.product-content a:hover,
.product-content a:focus-visible {
  color: var(--color-accent-hover);
  text-decoration-color: var(--gold);
}

.product-content strong {
  color: var(--color-text-strong);
  font-weight: 650;
}

.product-content em {
  color: var(--color-text-secondary);
}

.product-content ul,
.product-content ol {
  margin-block: 0 29px;
  padding-inline-start: 29px;
}

.product-content li {
  margin-block-end: var(--space-2);
  padding-inline-start: 5px;
}

.product-content li::marker {
  color: var(--gold);
}

.product-content blockquote {
  background: var(--color-surface-raised);
  border-end-end-radius: var(--radius-md);
  border-inline-start: 3px solid var(--gold);
  border-start-end-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-editorial);
  margin-block: var(--space-10);
  margin-inline: 0;
  padding-block: var(--space-5);
  padding-inline: var(--space-8) var(--space-6);
}

.product-content blockquote p {
  margin: 0;
}

.product-content img {
  block-size: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  max-inline-size: 100%;
}

.product-content figure {
  margin-block: 36px;
  margin-inline: 0;
  max-inline-size: 100%;
}

.product-content figcaption {
  color: var(--muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-base);
  margin-block-start: var(--space-3);
  text-align: center;
}

.product-content table {
  background: var(--white);
  border: 1px solid var(--line);
  border-collapse: collapse;
  border-radius: var(--radius-md);
  display: block;
  inline-size: 100%;
  margin-block: 35px;
  overflow-x: auto;
}

.product-content tbody,
.product-content thead {
  display: table;
  inline-size: 100%;
  min-inline-size: 560px;
  table-layout: fixed;
}

.product-content th,
.product-content td {
  border-block-end: 1px solid var(--line);
  padding: var(--space-3) var(--space-4);
  text-align: start;
}

.product-content th {
  background: var(--color-gold-table);
  color: var(--brown);
  font-weight: var(--font-weight-semibold);
}

.product-content tbody tr:last-child td {
  border-block-end: 0;
}

.product-content hr {
  border: 0;
  border-block-start: 1px solid var(--line-gold);
  margin-block: var(--space-12);
}

/* ========================================
   PRODUCT SPECIFICATIONS
======================================== */
.product-information {
  padding-block: 72px;
}

.product-specifications {
  background: var(--white);
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
}

.product-specifications div {
  border-block-end: 1px solid var(--line);
  min-inline-size: 0;
  padding: var(--space-5) var(--space-6);
}

.product-specifications div:not(:nth-child(3n)) {
  border-inline-end: 1px solid var(--line);
}

.product-specifications div:nth-last-child(-n + 3) {
  border-block-end: 0;
}

.product-specifications dt {
  color: var(--muted);
  font-size: var(--font-size-xs);
  margin-block-end: var(--space-2);
}

.product-specifications dd {
  color: var(--ink);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-relaxed);
  margin: 0;
}

/* ========================================
   SERVICE NOTES AND RELATED PRODUCTS
======================================== */
.product-services {
  background: var(--ivory);
  padding-block: 54px;
}

.service-grid {
  gap: var(--space-4);
}

.service-card {
  align-items: start;
  border: 1px solid var(--line);
  box-shadow: none;
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5);
}

.service-card svg {
  block-size: 30px;
  color: var(--brown);
  flex: none;
  inline-size: 30px;
}

.service-card h3 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-base);
  margin: 0 0 var(--space-1);
}

.service-card p {
  color: var(--muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  margin: 0;
}

.related-products {
  padding-block: 76px 80px;
}

.related-product-grid {
  gap: var(--space-5);
}

.related-products .shop-product-card {
  display: flex;
  flex-direction: column;
  list-style: none;
}

.related-products .product-card-media {
  aspect-ratio: 1 / 1;
  background: var(--color-surface-subtle);
  display: block;
  overflow: hidden;
  position: relative;
}

.related-products .shop-product-card .product-card-media img,
.related-products .product-card-placeholder {
  block-size: 100%;
  display: block;
  inline-size: 100%;
  object-fit: cover;
}

.related-products .product-card-placeholder {
  block-size: 100%;
  inline-size: 100%;
}

@supports not (aspect-ratio: 1 / 1) {
  .related-products .product-card-media::before {
    content: "";
    display: block;
    padding-block-start: 100%;
  }

  .related-products .shop-product-card .product-card-media img,
  .related-products .product-card-placeholder {
    inset: 0;
    position: absolute;
  }
}

.related-products .shop-product-card:nth-child(3n) .product-card-media img {
  object-position: center 42%;
}

.related-products .shop-product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px 18px 20px;
}

.related-products .shop-product-body .badge {
  align-self: start;
  margin-block-end: var(--space-3);
}

.related-products .shop-product-title {
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.75;
  margin: 0 0 var(--space-2);
}

.related-products .shop-product-title a {
  transition: color var(--transition-fast);
}

.related-products .shop-product-title a:hover,
.related-products .shop-product-title a:focus-visible {
  color: var(--brown);
}

.related-products .shop-product-meta {
  color: var(--muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-relaxed);
  margin: 0 0 var(--space-4);
}

.related-products .shop-product-price {
  align-items: baseline;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}

.related-products .shop-product-price del {
  color: var(--muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
}

.related-products .shop-product-price ins {
  text-decoration: none;
}

.related-products .shop-product-link {
  border-block-start: 1px solid var(--line);
  color: var(--brown);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  margin-block-start: auto;
  padding-block-start: var(--space-3);
  transition: color var(--transition-fast);
}

.related-products .shop-product-link:hover,
.related-products .shop-product-link:focus-visible {
  color: var(--ink);
}

@media (max-width: 1100px) {
  .product-overview {
    gap: 38px;
    grid-template-columns: minmax(0, 1fr) minmax(335px, 0.92fr);
  }

  .related-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .product-page {
    padding-block-start: 30px;
  }

  .product-overview {
    display: flex;
    flex-direction: column;
    padding-block-end: 56px;
  }

  .product-gallery,
  .product-summary {
    inline-size: 100%;
  }

  .product-main-image {
    aspect-ratio: 1 / 0.9;
  }

  .product-description,
  .product-information,
  .related-products {
    padding-block: 56px;
  }

  .product-services {
    padding-block: 45px;
  }

  .service-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-specifications {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-specifications div:nth-child(3n) {
    border-inline-end: 1px solid var(--line);
  }

  .product-specifications div:nth-child(2n) {
    border-inline-end: 0;
  }

  .product-specifications div:nth-last-child(-n + 3) {
    border-block-end: 1px solid var(--line);
  }

  .product-specifications div:last-child {
    border-block-end: 0;
  }
}

@media (max-width: 540px) {
  .product-breadcrumb {
    margin-block-end: var(--space-6);
  }

  .product-title {
    font-size: 29px;
  }

  .product-thumbnails {
    gap: var(--space-2);
  }

  .cart-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .product-quantity,
  .product-add-cart {
    inline-size: 100%;
  }

  .product-trust {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-trust li {
    flex-direction: row;
    justify-content: start;
    min-block-size: 58px;
    padding-inline: var(--space-4);
    text-align: start;
  }

  .product-content {
    font-size: 15px;
  }

  .product-content blockquote {
    font-size: var(--font-size-md);
    padding: var(--space-4) var(--space-5);
  }

  .product-specifications,
  .related-product-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-specifications div,
  .product-specifications div:nth-child(2n),
  .product-specifications div:nth-child(3n) {
    border-block-end: 1px solid var(--line);
    border-inline-end: 0;
  }

  .product-specifications div:last-child {
    border-block-end: 0;
  }
}
