/*
 * The frame block in an electric desk's left column (inc/frame-section.php) and
 * the product layout around it. Everything here is for products with the
 * `mf-has-frame` body class; every other product page is untouched.
 *
 * Desktop: the gallery, the frame block and the summary are grid items in
 * ordinary flow. The gallery and the frame block stack in the left column; the
 * summary spans both rows on the right. The last row takes whatever height the
 * summary needs beyond the gallery, so no gap opens between the two left
 * items. No sticky, no fixed height, nothing absolute.
 * Phone: one column, in source order: gallery, summary, frame block.
 */

body.single-product.mf-has-frame div.product {
  /* About 55 / 45, with a gap of up to 72px. */
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: clamp(2rem, 5vw, 4.5rem);
  row-gap: 0;
  align-items: start;
}

@media (min-width: 861px) {
  body.single-product.mf-has-frame div.product .woocommerce-product-gallery {
    grid-column: 1;
    grid-row: 1;
    position: static;
    top: auto;
  }

  body.single-product.mf-has-frame div.product .summary {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  body.single-product.mf-has-frame div.product .mf-frame-col {
    grid-column: 1;
    grid-row: 2;
  }
}

@media (max-width: 860px) {
  body.single-product.mf-has-frame div.product {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  body.single-product.mf-has-frame div.product .woocommerce-product-gallery,
  body.single-product.mf-has-frame div.product .summary,
  body.single-product.mf-has-frame div.product .mf-frame-col {
    grid-column: 1;
    grid-row: auto;
  }
}

/* The column: the picture card, then the facts card. */
.mf-frame-col {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.mf-frame-visual {
  padding: clamp(1.1rem, 2.4vw, 1.9rem);
  border-radius: calc(var(--radius-card) * 1.25);
  background: var(--paper);
}

.mf-frame-visual__title {
  margin: 0;
  font-size: var(--step-1);
  line-height: 1.15;
}

.mf-frame-visual__sub {
  margin: 0.35rem 0 0;
  color: var(--text-muted, rgba(20, 21, 24, 0.62));
}

.mf-frame-visual__figure {
  margin: 1.1rem 0 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--paper-bright);
}

.mf-frame-visual__img {
  display: block;
  width: 100%;
  height: auto;
}

.mf-frame-specs {
  padding: clamp(1.1rem, 2.4vw, 1.9rem);
  border: 1px solid var(--rule);
  border-radius: calc(var(--radius-card) * 1.25);
  background: var(--paper-bright);
}

.mf-frame-specs__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0;
}

.mf-frame-specs__item {
  display: flex;
  flex-direction: column-reverse; /* the value reads first, its name under it */
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-inner);
  background: var(--paper);
}

.mf-frame-specs__item--wide {
  grid-column: 1 / -1;
}

.mf-frame-specs__item dt {
  font-size: var(--step--1);
  color: var(--text-muted, rgba(20, 21, 24, 0.62));
}

.mf-frame-specs__item dd {
  margin: 0;
  font-size: var(--step-1);
  font-weight: 700;
  line-height: 1.2;
}

.mf-frame-specs__sub {
  margin: 1.6rem 0 0.9rem;
  font-size: var(--step--1);
  font-weight: 700;
}

.mf-frame-specs__colours {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 2.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mf-frame-specs__colours li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-size: var(--step-0);
}

.mf-frame-specs__dot {
  flex: none;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid var(--rule);
  border-radius: 50%;
}

/* A hint of the metal; the RAL code beside each is the colour. */
.mf-frame-specs__dot--grey {
  background: #8c8f91;
}

.mf-frame-specs__dot--white {
  background: #fff;
  border-color: #b9b9b4;
}

.mf-frame-specs__dot--black {
  background: #141518;
}

@media (max-width: 480px) {
  .mf-frame-specs__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
