/* Shared quantity control for catalog product pages.
 * form.canuto-order-form.canuto-order-form repeats the class on purpose to keep the selector weight. */
.canuto-quantity-control {
  display: inline-grid;
  grid-template-columns: 1fr 26px 1fr;
  align-items: center;
  width: 76px;
  min-height: 26px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid color-mix(in srgb, var(--text-dark) 16%, transparent);
  border-radius: 999px;
  box-shadow: none;
}

.canuto-quantity-control .canuto-quantity {
  display: contents;
}

.canuto-quantity-control__button,
.canuto-quantity-control input.canuto-qty {
  width: 100%;
  min-width: 0;
  height: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.canuto-quantity-control input.canuto-qty {
  appearance: textfield;
  -moz-appearance: textfield;
}

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

.canuto-quantity-control__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Keep the product media and summary visually flat. */
.canuto-catalog-single .canuto-single-product__summary,
.canuto-catalog-single .canuto-product-gallery {
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.canuto-catalog-single .canuto-single-product-content article.canuto-single-product.canuto-product {
  background: transparent;
  background-color: transparent;
  background-image: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.canuto-catalog-single .canuto-single-product__summary > .canuto-single-product__categories {
  display: none;
}

.canuto-catalog-single .canuto-product-gallery__main {
  width: 100%;
  max-width: 460px;
  height: clamp(340px, 105vw, 380px);
  min-height: 0;
  aspect-ratio: auto;
  margin: 0 auto;
  padding: 14px;
  overflow: hidden;
  border-radius: 6px;
}

.canuto-catalog-single .canuto-product-gallery {
  width: 100%;
  padding: 0;
}

.canuto-catalog-single .canuto-product-gallery__thumbs {
  width: 100%;
  margin-top: 8px;
  padding: 8px 0 0;
}

.canuto-catalog-single .canuto-single-product__details {
  margin-top: 1.8rem;
}

/* Remove the divider between the product price and short description. */
.canuto-catalog-single .canuto-single-product__price,
.canuto-catalog-single .canuto-single-product__price .canuto-price {
  border-bottom: 0;
}

.canuto-catalog-single .canuto-single-product__price::after {
  display: none;
  content: none;
}

body.canuto-catalog-single .canuto-catalog .canuto-single-product__summary
  .canuto-product-short-description {
  border-top: 0;
  border-bottom: 0;
}

/* Align the price and description copy with the product title. */
body.canuto-catalog-single .canuto-catalog .canuto-single-product__summary
  .canuto-single-product__price .canuto-price,
body.canuto-catalog-single .canuto-catalog .canuto-single-product__summary
  .canuto-product-short-description p {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
  border-top: 0;
  border-bottom: 0;
}

.canuto-catalog-single .canuto-single-product-content .canuto-single-product {
  column-gap: clamp(1.5rem, 2.5vw, 2.5rem);
}

@media (min-width: 769px) {
  .canuto-catalog-single .canuto-single-product-content-section > .container {
    max-width: 1520px;
  }

  .canuto-catalog-single .canuto-single-product-content {
    max-width: 1320px;
  }

  .canuto-catalog-single .canuto-single-product__related {
    width: 100%;
    max-width: 1320px;
    margin-right: auto;
    margin-left: auto;
  }
}

/* Shared related-product grid; demos only control each card's presentation. */
@media (min-width: 601px) and (max-width: 1099px) {
  body.canuto-catalog-single .canuto-single-product__related ul.canuto-products {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: center;
    width: 100%;
    max-width: 760px;
    margin-inline: auto;
  }
}

/* Demo 1 long prices in related custom products. */
body.canuto-active-demo-01 .canuto-single-product__related .product-card-price--long {
  font-size: 0.5rem;
}

@media (min-width: 981px) {
  .canuto-catalog-single .canuto-single-product-content {
    max-width: 1160px;
  }

  body.canuto-catalog-single .canuto-single-product-content .canuto-single-product {
    grid-template-columns: minmax(0, 460px) minmax(360px, 500px);
    justify-content: center;
    column-gap: clamp(1.75rem, 3vw, 2.75rem);
  }

  .canuto-catalog-single .canuto-single-product__gallery {
    width: 100%;
    max-width: 460px;
    justify-self: end;
  }

  .canuto-catalog-single .canuto-product-gallery__main {
    height: 500px;
  }
}

@media (min-width: 641px) and (max-width: 980px) {
  .canuto-catalog-single .canuto-single-product__gallery {
    width: 100%;
    max-width: 400px;
    margin-inline: auto;
  }

  .canuto-catalog-single .canuto-product-gallery__main {
    max-width: 400px;
    height: 440px;
  }
}

/* Single-product information accordion. */
.canuto-catalog-single .canuto-product-tabs-accordion {
  max-width: 890px;
  margin: clamp(2rem, 5vw, 4.5rem) auto 0;
  overflow: hidden;
  border: 1px solid var(--content-card-border-color);
  border-radius: 18px;
  background: var(--white);
}

.canuto-catalog-single .canuto-product-tabs-accordion__item {
  margin: 0;
  border-bottom: 1px solid var(--content-card-border-color);
}

.canuto-catalog-single .canuto-product-tabs-accordion__item:last-child {
  border-bottom: 0;
}

.canuto-catalog-single .canuto-product-tabs-accordion__item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  padding: 1.25rem 1.7rem;
  color: var(--text-dark);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}

.canuto-catalog-single .canuto-product-tabs-accordion__item > summary::-webkit-details-marker {
  display: none;
}

.canuto-catalog-single .canuto-product-tabs-accordion__item > summary::after {
  width: 9px;
  height: 9px;
  margin-left: 1rem;
  border-right: 2px solid var(--text-light);
  border-bottom: 2px solid var(--text-light);
  transform: rotate(45deg) translateY(-3px);
  content: '';
}

.canuto-catalog-single .canuto-product-tabs-accordion__item[open] > summary::after {
  transform: rotate(225deg) translate(-3px, -1px);
}

.canuto-catalog-single .canuto-product-tabs-accordion__content {
  padding: .35rem 2.25rem 1.5rem;
  color: var(--text-medium);
}

/* Do not show a decorative rule after the full product description. */
.canuto-catalog-single .canuto-product-tabs-accordion__content hr,
.canuto-catalog-single .canuto-product-tabs-accordion__content .wp-block-separator {
  display: none;
}

.canuto-catalog-single .canuto-product-tabs-accordion__content > :last-child {
  border-bottom: 0;
}

.canuto-catalog-single .canuto-product-tabs-accordion__content > h2 {
  display: none;
}

.canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes {
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: collapse;
}

.canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes tr {
  border-bottom: 1px solid var(--content-card-border-color);
}

.canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes tr:last-child {
  border-bottom: 0;
}

.canuto-catalog.canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes th,
.canuto-catalog.canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes td {
  padding: 1.15rem .6rem;
  border: 0;
  background: transparent;
  text-align: left;
  vertical-align: middle;
}

.canuto-catalog.canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes tr:nth-child(even) td {
  background: transparent;
}

.canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes th {
  width: 42%;
  color: var(--text-medium);
  font-size: .82rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes td {
  color: var(--text-dark);
  font-size: .9rem;
  font-style: normal;
  font-weight: 600;
  text-align: right;
}

.canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes td p {
  margin: 0;
}

@media (max-width: 640px) {

  .canuto-catalog-single .canuto-product-gallery__main {
    height: clamp(280px, 82vw, 320px);
  }

  .canuto-catalog-single .canuto-product-gallery__thumbs {
    max-width: 460px;
    margin-right: auto;
    margin-left: auto;
  }

  .canuto-catalog-single .canuto-product-tabs-accordion__item > summary {
    min-height: 68px;
    padding: 1rem 1.15rem;
  }

  .canuto-catalog-single .canuto-product-tabs-accordion__content {
    padding: 0 1.15rem 1rem;
  }

  .canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes,
  .canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes tbody,
  .canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes tr,
  .canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes th,
  .canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes td {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes tr {
    padding: .6rem .25rem;
  }

  .canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes th.canuto-product-attributes__label {
    min-width: 0;
    margin: 0 0 .35rem;
    padding: 0;
    font-size: .72rem;
    line-height: 1.3;
    text-indent: 0;
    overflow-wrap: anywhere;
  }

  .canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes td.canuto-product-attributes__value {
    margin: 0;
    padding: 0;
    font-size: .82rem;
    line-height: 1.3;
    white-space: normal;
    text-align: left;
    text-indent: 0;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes td.canuto-product-attributes__value > * {
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
    text-indent: 0;
  }

  .canuto-catalog-single .canuto-product-tabs-accordion__content table.canuto-shop-attributes td.canuto-product-attributes__value p {
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-wrap: anywhere;
    word-break: normal;
  }
}

.canuto-catalog-single .canuto-product-gallery__main img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: none;
  margin-inline: auto;
  object-fit: contain;
  object-position: center;
  border-radius: inherit;
}

.canuto-catalog-single .canuto-product-gallery__main .canuto-product-gallery__zoom-trigger {
  display: flex;
  width: 100%;
  height: 100%;
  padding: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: zoom-in;
}

/* Global single-product purchase controls. */
@media (min-width: 769px) {
  .canuto-catalog .canuto-single-product__cart form.canuto-order-form.canuto-order-form {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
  }

  .canuto-catalog .canuto-single-product__cart .canuto-quantity-control {
    grid-template-columns: 1fr 32px 1fr;
    width: 96px;
    min-height: 64px;
    border-color: var(--content-card-border-color);
    border-radius: 16px;
  }

  .canuto-catalog .canuto-single-product__cart .canuto-quantity-control__button,
  .canuto-catalog .canuto-single-product__cart .canuto-quantity-control input.canuto-qty {
    height: 62px;
    min-height: 62px;
    font-size: 1rem;
    font-weight: 700;
  }

  .canuto-catalog .canuto-single-product__cart form.canuto-order-form.canuto-order-form .canuto-add-to-order-button {
    grid-column: 2;
    width: 100%;
    min-height: 64px;
    margin: 0;
    padding-inline: 1.5rem;
    border-color: var(--success-color);
    border-radius: var(--product-button-radius);
    background: var(--success-color);
    color: var(--white);
    font-size: .875rem;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
  }
}

/* Keep the product layout stacked through tablet widths. */
@media (min-width: 701px) and (max-width: 920px) {
  .canuto-single-product-content .canuto-single-product {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.35rem;
  }
}

@media (min-width: 921px) and (max-width: 980px) {
  .canuto-single-product-content .canuto-single-product {
    grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
    gap: clamp(1.5rem, 3vw, 2.5rem);
  }

  .canuto-catalog-single .canuto-product-gallery__main {
    width: 100%;
  }
}

.canuto-catalog .canuto-single-product__cart form.canuto-order-form .canuto-quantity-control {
  border-radius: 10px;
}

@media (max-width: 768px) {
  body.canuto-active-demo-01.canuto-catalog-single .canuto-single-product-content-section {
    padding-top: 60px;
  }

  .canuto-catalog .canuto-single-product__cart form.canuto-order-form.canuto-order-form {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: center;
    gap: .65rem;
  }

  .canuto-catalog .canuto-single-product-content div.canuto-product .canuto-product-short-description {
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .canuto-catalog .canuto-single-product__cart form.canuto-order-form .canuto-add-to-order-button {
    display: inline-flex;
    grid-column: 2;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    min-height: 46px;
    max-height: 46px;
    margin: 0;
    padding: .65rem 1rem;
    border-radius: var(--product-button-radius);
    line-height: 1.2;
  }
}

@media (min-width: 400px) and (max-width: 768px) {
  .canuto-catalog .canuto-single-product__cart form.canuto-order-form.canuto-order-form {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: center;
    gap: .65rem;
  }

  .canuto-catalog .canuto-single-product__cart form.canuto-order-form.canuto-order-form .canuto-quantity {
  }

  .canuto-catalog .canuto-single-product__cart form.canuto-order-form .canuto-quantity-control {
    width: 90px;
    min-height: 46px;
    border: var(--product-button-border-width) solid var(--product-button-border-color);
  }

  .canuto-catalog .canuto-single-product__cart form.canuto-order-form.canuto-order-form .canuto-add-to-order-button {
    grid-column: 2;
    margin-inline-start: .35rem;
  }
}

@media (min-width: 300px) and (max-width: 399px) {
  .canuto-catalog-single .canuto-single-product-content-section .container {
    padding-inline: 12px;
  }

  .canuto-catalog .canuto-single-product-content .canuto-single-product__title {
    font-size: 1.02rem;
    line-height: 1.2;
  }

  .canuto-catalog .canuto-single-product__price p.canuto-price,
  .canuto-catalog .canuto-single-product__price span.canuto-price {
    font-size: .98rem;
  }

  .canuto-catalog .canuto-single-product__cart form.canuto-order-form.canuto-order-form {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: .9rem;
  }

  .canuto-catalog .canuto-single-product__cart form.canuto-order-form.canuto-order-form .canuto-quantity {
  }

  .canuto-catalog .canuto-single-product__cart form.canuto-order-form.canuto-order-form .canuto-add-to-order-button {
    grid-column: 2;
    margin-inline-start: .2rem;
  }
}

@media (max-width: 439px) {
  .canuto-catalog .canuto-single-product__cart form.canuto-order-form.canuto-order-form {
    grid-template-columns: 90px 46px;
    align-items: center;
    justify-content: start;
    gap: .65rem;
  }

  .canuto-catalog .canuto-single-product__cart form.canuto-order-form.canuto-order-form .canuto-quantity {
    grid-column: 1;
  }

}

@media (min-width: 440px) {
  .canuto-catalog .canuto-single-product__cart form.canuto-order-form.canuto-order-form {
    display: grid;
    grid-template-columns: 90px 46px;
    align-items: center;
    justify-content: start;
    gap: .65rem;
  }
}

/* Respect the hidden attribute on the quantity control. */
.canuto-catalog .canuto-single-product__cart .canuto-quantity-control[hidden] {
  display: none;
}

/* Keep the quantity control consistent across every product-page breakpoint. */
.canuto-catalog .canuto-single-product__cart form.canuto-order-form .canuto-quantity-control {
  grid-template-columns: 1fr 30px 1fr;
  width: 90px;
  min-height: 46px;
  border-color: var(--product-button-border-color);
  border-radius: 10px;
}

.canuto-catalog .canuto-single-product__cart form.canuto-order-form .canuto-quantity-control__button,
.canuto-catalog .canuto-single-product__cart form.canuto-order-form .canuto-quantity-control input.canuto-qty {
  height: 44px;
  min-height: 44px;
  font-size: .88rem;
}

/* Keep sale badges inside related-product images. */
.canuto-catalog .canuto-related ul.canuto-products li.canuto-product {
  position: relative;
}

.canuto-catalog .canuto-related ul.canuto-products li.canuto-product .canuto-price,
.canuto-catalog .canuto-related ul.canuto-products li.canuto-product .canuto-price ins {
  text-decoration: none;
}

/* Keep the product image preview above the page content. */
.canuto-product-gallery__modal {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  overflow: auto;
}

.canuto-product-gallery__modal[hidden] {
  display: none;
}

.canuto-product-gallery__modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.82);
  cursor: zoom-out;
}

.canuto-product-gallery__modal-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

.canuto-product-gallery__modal-content img {
  display: block;
  max-width: min(92vw, 1400px);
  max-height: calc(100vh - clamp(2rem, 6vw, 5rem));
  object-fit: contain;
}

.canuto-product-gallery__modal-close {
  position: absolute;
  z-index: 2;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--white) 92%, transparent);
  color: var(--text-dark);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 768px) {
  .canuto-product-gallery__modal-close {
    width: 34px;
    height: 34px;
    font-size: 1.35rem;
  }
}

/* Keep the desktop purchase controls aligned with the compact product layout. */
@media (min-width: 769px) {
  .canuto-catalog .canuto-single-product__cart form.canuto-order-form.canuto-order-form .canuto-add-to-order-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    min-height: 46px;
    max-height: 46px;
    padding: .65rem 1rem;
    border-color: var(--product-button-border-color);
    border-radius: var(--product-button-radius);
    background: var(--product-button-background-color);
    color: var(--product-button-text-color);
    font-size: var(--product-button-font-size);
    font-weight: var(--product-button-font-weight);
    text-transform: var(--product-button-text-transform);
  }

  .canuto-catalog-single .canuto-single-product__details {
    margin-top: .65rem;
  }
}

.canuto-catalog .canuto-single-product__cart form.canuto-order-form .canuto-add-to-order-button {
  position: relative;
  grid-column: 2;
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  height: 46px;
  min-height: 46px;
  max-height: 46px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: transparent;
  font-size: 0;
  text-indent: -9999px;
}

.canuto-catalog .canuto-single-product__cart form.canuto-order-form .canuto-add-to-order-button::before {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 20px;
  height: 20px;
  background-color: var(--product-button-text-color);
  content: "";
  transform: translate(-50%, -50%);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.canuto-catalog .canuto-single-product__cart form.canuto-order-form .canuto-add-to-order-button:is(:hover, :focus-visible)::before {
  background-color: var(--product-button-hover-text-color);
}
