/**
 * @file
 * The product page and the product landing page: the image on the left, the
 * details on the right.
 */

.sm-product {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 768px) {
  .sm-product {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.sm-product__media img {
  display: block;
  max-width: 100%;
  height: auto;
}

.sm-product__title {
  margin: 0 0 0.5rem;
  font-size: 1.8rem;
  line-height: 1.25;
}

.sm-product__sku {
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

/* The SKU has the color of the SKU of the catalog cards. */
.sm-product__sku-value {
  color: var(--color-primary, #b0347f);
  font-weight: 700;
}

.sm-product__stock {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--color-primary, #b0347f);
  background: var(--light-primary, #f6f6f6);
  line-height: 1.5;
}

/* Like the prices of the catalog cards, larger. */
.sm-product__prices {
  margin-bottom: 1.25rem;
}

.sm-product__price {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.sm-product__price-sqm {
  font-size: 1.2rem;
  opacity: 0.75;
}

.sm-product__cart {
  margin-bottom: 1.75rem;
}

.sm-product__cart .form-item {
  margin: 0;
}

.sm-add-to-cart {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

/* The quantity: "-" [number] "+", the switch of the pieces and the meters. */
.sm-qty {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sm-qty__field {
  display: inline-flex;
  align-items: stretch;
}

.sm-qty__field[hidden],
.sm-qty__hint[hidden] {
  display: none;
}

.sm-qty__field input {
  width: 5.5rem;
  margin: 0;
  text-align: center;
  -moz-appearance: textfield;
}

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

.sm-qty__step {
  min-width: 2.5rem;
  border: 1px solid var(--color-border, #ccc);
  background: #fff;
  color: var(--text-color, #333);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.sm-qty__step,
.sm-qty__mode {
  /* the buttons of the kart theme widen their borders on hover */
  transition: none;
}

.sm-qty__step:hover,
.sm-qty__step:focus {
  border: 1px solid var(--color-primary, #b0347f);
  background: #fff;
  color: var(--color-primary, #b0347f);
}

.sm-qty__mode:hover,
.sm-qty__mode:focus {
  border: 1px solid var(--color-border, #ccc);
  background: #fff;
  color: var(--text-color, #333);
}

.sm-qty__mode + .sm-qty__mode:hover,
.sm-qty__mode + .sm-qty__mode:focus {
  border-left: 0;
}

.sm-qty__mode.is-active:hover,
.sm-qty__mode.is-active:focus {
  border-color: var(--color-primary, #b0347f);
  background: var(--color-primary, #b0347f);
  color: #fff;
}

.sm-qty__modes {
  display: inline-flex;
}

.sm-qty__mode {
  padding: 0.2rem 0.75rem;
  border: 1px solid var(--color-border, #ccc);
  background: #fff;
  color: var(--text-color, #333);
  cursor: pointer;
}

.sm-qty__mode + .sm-qty__mode {
  border-left: 0;
}

.sm-qty__mode.is-active {
  border-color: var(--color-primary, #b0347f);
  background: var(--color-primary, #b0347f);
  color: #fff;
}

.sm-qty__hint {
  font-size: 0.9rem;
  opacity: 0.75;
}

/* The properties: the single values with the labels inline, the others above. */
.sm-product__properties {
  margin-bottom: 1.25rem;
}

.sm-product__properties--single .field {
  display: flex;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px dotted var(--color-border, #ddd);
}

.sm-product__properties--single .field-label {
  flex: 0 0 45%;
  font-weight: 400;
  opacity: 0.75;
}

.sm-product__properties--single .field-label::after {
  content: ":";
}

.sm-product__properties--multiple .field,
.sm-product__properties--text .field {
  margin-bottom: 1rem;
}

.sm-product__properties--multiple .field-label,
.sm-product__properties--text .field-label {
  margin-bottom: 0.3rem;
  font-weight: 600;
}
