/* [dtw_pergola_designer], see inc/pergola-designer.php. Renamed, never ?ver=, on any
   change: the WP.com edge cache keys on the path. */

.dtw-pg {
  background: var(--color-white);
  border-top: 1px solid var(--color-grey-light);
  border-bottom: 1px solid var(--color-grey-light);
  padding: clamp(48px, 7vw, 96px) 0;
  scroll-margin-top: calc(var(--header-height) + 16px);
}
.dtw-pg-inner { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.dtw-pg-eyebrow {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin: 0 0 12px;
}
.dtw-pg-title {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(32px, 4.5vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--color-dark);
  margin: 0 0 16px;
}
.dtw-pg-lead { color: #4a545e; font-size: 17px; line-height: 1.6; margin: 0 0 40px; max-width: 62ch; }

/* The model first (AJ 2026-11-04): it stays beside the steps on a wide screen, and is
   pinned above them on a phone until the enquiry form is reached. */
.dtw-pg-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.dtw-pg-stage { position: sticky; top: calc(var(--header-height) + 24px); z-index: 5; min-width: 0; }
.dtw-pg-steps { min-width: 0; }
.dtw-pg-step { padding: 0 0 40px; margin: 0 0 40px; border-bottom: 1px solid var(--color-grey-light); scroll-margin-top: calc(var(--header-height) + 16px); }
.dtw-pg-step:last-child { border-bottom: 0; margin-bottom: 0; }
.dtw-pg-step-n {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-grey-mid);
  margin: 0 0 6px;
}
.dtw-pg-step h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(22px, 2.6vw, 28px);
  letter-spacing: -0.01em;
  color: var(--color-dark);
  margin: 0 0 20px;
}
.dtw-pg-sub { font-family: var(--font-heading); font-size: 16px; font-weight: 600; color: var(--color-dark); margin: 28px 0 12px; }
.dtw-pg-note { font-size: 14px; color: #4a545e; line-height: 1.55; margin: 12px 0 0; }

/* Picture cards: design, colour, fitting. */
.dtw-pg-cards { display: grid; gap: 12px; }
.dtw-pg-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dtw-pg-cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dtw-pg-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--color-white);
  border: 1px solid #d9dde1;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color var(--transition);
}
.dtw-pg-card:hover { border-color: var(--color-dark); }
.dtw-pg-card[aria-pressed="true"] { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
.dtw-pg-card:focus-visible, .dtw-pg-chip:focus-visible, .dtw-pg-qty button:focus-visible { outline: 2px solid var(--color-dark); outline-offset: 2px; }
.dtw-pg-card-img { display: block; background: #f3f4f5; aspect-ratio: 4 / 3; overflow: hidden; }
.dtw-pg-card-img img { width: 100%; height: 100%; object-fit: contain; display: block; mix-blend-mode: multiply; }
.dtw-pg-cards.is-text .dtw-pg-card-img { display: none; }
.dtw-pg-cards-2 .dtw-pg-card-img { aspect-ratio: 16 / 7; }
.dtw-pg-card-body { display: block; padding: 14px 16px 16px; }
.dtw-pg-card-tag { display: block; font-family: var(--font-heading); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-primary); margin-bottom: 4px; }
.dtw-pg-card-name { display: block; font-family: var(--font-heading); font-weight: 600; font-size: 16px; color: var(--color-dark); }
.dtw-pg-card-sub { display: block; font-size: 13px; line-height: 1.45; color: #4a545e; margin-top: 4px; }

/* Size, set on the model; the step says what was chosen. */
.dtw-pg-size-now { font-family: var(--font-heading); font-size: 20px; color: var(--color-dark); margin: 0; }
.dtw-pg-field { display: grid; gap: 6px; font-size: 14px; color: var(--color-dark); }
.dtw-pg-field > span { font-weight: 600; }
.dtw-pg-field select, .dtw-pg-field input, .dtw-pg-field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c9ced4;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--color-dark);
  background: var(--color-white);
}
.dtw-pg-field select, .dtw-pg-field input { height: 48px; box-sizing: border-box; line-height: 1.2; margin: 0; }
.dtw-pg-field textarea { min-height: 96px; resize: vertical; box-sizing: border-box; margin: 0; }
/* The 3D model, with the size controls laid over its foot. */
.dtw-pg-preview { position: relative; margin: 0; }
.dtw-pg-preview-canvas { position: relative; width: 100%; aspect-ratio: 4 / 3.3; background: #eef1f4; overflow: hidden; }
.dtw-pg-preview-canvas.is-flat { display: flex; align-items: center; justify-content: center; }
.dtw-pg-preview-canvas.is-flat img { max-width: 80%; max-height: 70%; mix-blend-mode: multiply; }
.dtw-pg-dims {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  padding: 10px 12px; background: rgba(255, 255, 255, 0.92); border-top: 1px solid #d9dde1;
}
.dtw-pg-dim { display: grid; gap: 4px; min-width: 0; }
.dtw-pg-dim-name { font-family: var(--font-heading); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #4a545e; }
.dtw-pg-dim-ctl { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 40px; align-items: center; border: 1px solid #c9ced4; background: var(--color-white); }
.dtw-pg-dim-ctl button { height: 42px; border: 0; background: #f3f4f5; font-size: 20px; line-height: 1; color: var(--color-dark); cursor: pointer; padding: 0; border-radius: 0; }
.dtw-pg-dim-ctl button:hover { background: #e6e9ec; }
.dtw-pg-dim-ctl button:focus-visible, .dtw-pg-dim-ctl input:focus-visible { outline: 2px solid var(--color-dark); outline-offset: -2px; }
.dtw-pg-dim-ctl input { width: 100%; min-width: 0; height: 42px; border: 0; padding: 0 2px 0 8px; margin: 0; text-align: right; font: 600 17px/1 var(--font-body); color: var(--color-dark); background: transparent; box-shadow: none; border-radius: 0; }
.dtw-pg-dim-u { font-size: 14px; color: #4a545e; padding: 0 8px 0 2px; }
.dtw-pg-dim-msg { font-size: 13px; color: #b0072a; margin: 6px 0 0; min-height: 0; }
.dtw-pg-dim-msg:empty { display: none; }
.dtw-pg-preview-canvas canvas { display: block; width: 100% !important; height: 100% !important; cursor: grab; }
.dtw-pg-preview-hint { font-size: 12px; color: #4a545e; margin: 6px 0 0; }
.dtw-pg-preview-hint:empty { display: none; }
.dtw-pg-steps .dtw-pg-preview-hint { color: #4a545e; }

/* Sides: a tab per side, then the choices for the one picked. */
.dtw-pg-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid #d9dde1; margin-top: 16px; }
.dtw-pg-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 12px; min-height: 56px; text-align: left;
  background: #f6f7f8; border: 0; border-right: 1px solid #d9dde1; border-radius: 0;
  font: inherit; cursor: pointer; color: var(--color-dark);
}
.dtw-pg-tab:last-child { border-right: 0; }
.dtw-pg-tab[aria-selected="true"] { background: var(--color-white); box-shadow: inset 0 -3px 0 var(--color-primary); }
.dtw-pg-tab:focus-visible { outline: 2px solid var(--color-dark); outline-offset: -2px; }
.dtw-pg-tab-name { font-family: var(--font-heading); font-weight: 600; font-size: 15px; }
.dtw-pg-tab-val { font-size: 12px; color: #4a545e; }
.dtw-pg-tabs + .dtw-pg-side { border-top: 0; }
.dtw-pg-open { display: block; width: 100%; aspect-ratio: 391 / 200; background: repeating-linear-gradient(135deg, #f6f7f8 0 8px, #eef0f2 8px 16px); }
.dtw-pg-tabs:has(.dtw-pg-tab:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Sides. */
.dtw-pg-sides { display: grid; gap: 12px; margin-top: 16px; }
.dtw-pg-side { border: 1px solid var(--color-grey-light); padding: 14px 16px 16px; }
.dtw-pg-side-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--color-dark); }
.dtw-pg-side-head span { font-size: 13px; color: #4a545e; }
.dtw-pg-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dtw-pg-chip {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 6px;
  min-height: 48px;
  padding: 6px;
  background: var(--color-white);
  border: 1px solid #d9dde1;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-dark);
}
.dtw-pg-chip img { width: 100%; aspect-ratio: 391 / 200; object-fit: cover; object-position: top; display: block; mix-blend-mode: multiply; }
.dtw-pg-chip.is-plain { justify-content: center; }
.dtw-pg-chip[aria-pressed="true"] { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
.dtw-pg-side-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }

/* Extras. */
.dtw-pg-extras { border-top: 1px solid var(--color-grey-light); }
.dtw-pg-extra { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--color-grey-light); }
.dtw-pg-extra-img { width: 64px; height: 44px; background: #f3f4f5; overflow: hidden; }
.dtw-pg-extra-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; mix-blend-mode: multiply; }
.dtw-pg-extra-name { font-size: 15px; font-weight: 600; color: var(--color-dark); }
.dtw-pg-extra-name small { display: block; font-weight: 400; font-size: 13px; color: #4a545e; }
.dtw-pg-qty { display: inline-flex; align-items: center; border: 1px solid #c9ced4; }
.dtw-pg-qty button { width: 44px; height: 44px; border: 0; background: var(--color-white); font-size: 20px; color: var(--color-dark); cursor: pointer; }
.dtw-pg-qty output { min-width: 28px; text-align: center; font-weight: 600; color: var(--color-dark); }
.dtw-pg-more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dtw-pg-more figure { margin: 0; border: 1px solid var(--color-grey-light); }
.dtw-pg-more img { width: 100%; aspect-ratio: 391 / 220; object-fit: cover; object-position: top; display: block; }
.dtw-pg-more figcaption { font-size: 13px; padding: 8px 10px; color: var(--color-dark); }

/* The form. */
.dtw-pg-form { display: grid; gap: 14px; }
.dtw-pg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dtw-pg-form .btn { min-height: 50px; justify-self: start; }
.dtw-pg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.dtw-pg-msg { margin: 0; font-size: 15px; min-height: 1.4em; }
.dtw-pg-msg.is-error { color: #b0072a; }
.dtw-pg-msg.is-ok { color: #1d6b3a; font-weight: 600; }

/* What they built, above the form in the last step. */
.dtw-pg-summary { background: #f6f7f8; border: 1px solid var(--color-grey-light); padding: 16px 20px; margin: 0 0 20px; }
.dtw-pg-sline { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid #e2e5e8; font-size: 14px; line-height: 1.4; color: var(--color-dark); }
.dtw-pg-sline span:first-child { color: #4a545e; }
.dtw-pg-small { font-size: 12px; color: #4a545e; margin: 12px 0 0; line-height: 1.5; }
.dtw-pg-bar { display: none; }
.dtw-pg-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

@media (max-width: 960px) {
  .dtw-pg-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  /* On a phone the size row sits above the picture and slides up under the header as the
     page scrolls, so only the picture stays pinned: small enough to leave room for the
     steps on a short phone (AJ 2026-11-04: "so that you can see the render"). */
  .dtw-pg-stage { top: calc(var(--header-height) - 64px); background: var(--color-white); padding: 0 0 8px; margin: 0; }
  .dtw-pg-preview { display: flex; flex-direction: column; }
  .dtw-pg-dims { order: -1; position: static; height: 64px; box-sizing: border-box; align-content: start; padding: 0 0 8px; background: none; border: 0; }
  .is-form .dtw-pg-stage { position: relative; top: auto; }
  .dtw-pg-preview-canvas { aspect-ratio: 16 / 10; max-height: 30vh; }
  /* While the model is pinned, anything scrolled or tabbed to stops below it. */
  .dtw-pg-steps * { scroll-margin-top: calc(var(--header-height) + 30vh + 24px); }
  .is-bar-on .dtw-pg-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--color-dark);
    color: #fff;
    font-size: 14px;
  }
  .dtw-pg-bar .btn { min-height: 44px; padding: 10px 16px; white-space: nowrap; }
}
@media (max-width: 640px) {
  .dtw-pg-cards-3 { grid-template-columns: minmax(0, 1fr); }
  .dtw-pg-cards-3 .dtw-pg-card { flex-direction: row; }
  .dtw-pg-cards-3 .dtw-pg-card-img { width: 38%; flex: none; aspect-ratio: 4 / 3; }
  .dtw-pg-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dtw-pg-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .dtw-pg-tab:nth-child(2) { border-right: 0; }
  .dtw-pg-tab:nth-child(-n+2) { border-bottom: 1px solid #d9dde1; }
  /* On a phone the size row sits under the model, not over it, and the unit moves into
     the label so a size like 5.25 fits. */
  .dtw-pg-preview-canvas { aspect-ratio: 16 / 10; }
  .dtw-pg-dims { gap: 6px; }
  .dtw-pg-dim-name { font-size: 10px; letter-spacing: 0.1em; }
  .dtw-pg-dim-name::after { content: " (m)"; text-transform: none; letter-spacing: 0; }
  .dtw-pg-dim-ctl { grid-template-columns: 28px minmax(0, 1fr) 28px; }
  .dtw-pg-dim-u { display: none; }
  .dtw-pg-dim-ctl button, .dtw-pg-dim-ctl input { height: 38px; }
  .dtw-pg-dim-ctl input { font-size: 16px; padding: 0; text-align: center; }
  .dtw-pg-preview-hint { display: none; }
  .dtw-pg-side-detail, .dtw-pg-grid { grid-template-columns: minmax(0, 1fr); }
  .dtw-pg-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dtw-pg-extra { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; }
  .dtw-pg-extra-img { width: 52px; height: 38px; }
  .dtw-pg-form .btn { justify-self: stretch; }
}

/* ---------- The rest of the pergola page, tightened (AJ 2026-11-04: "get rid of so much
   white space everywhere on the text. i want the text to be slick, no white gaps").
   Only on pages holding the designer (body class from inc/pergola-designer.php). ---------- */
.has-dtw-pergola .dtw-custom-code { padding: 0; }
.has-dtw-pergola .dtw-pg { padding: clamp(36px, 4.5vw, 56px) 0; }
.has-dtw-pergola .dtw-pg-lead { margin-bottom: 28px; }
.has-dtw-pergola .dtw-pg-step { padding-bottom: 28px; margin-bottom: 28px; }
.has-dtw-pergola .dtw-pg-step h3 { margin-bottom: 14px; }
.has-dtw-pergola .dtw-repeater-content { padding: 48px 0; }
.has-dtw-pergola .dtw-ri-block { padding: 36px 0; }
.has-dtw-pergola .dtw-ri-block:first-child { padding-top: 0; }
.has-dtw-pergola .dtw-ri-block:last-child { padding-bottom: 0; }
.has-dtw-pergola .dtw-ri-cards { margin-top: 24px; }
.has-dtw-pergola .dtw-ri-content p { margin-bottom: 12px; }
.has-dtw-pergola .dtw-ri-content h2 { margin-bottom: 18px; }
.has-dtw-pergola .dtw-tabs-section,
.has-dtw-pergola .dtw-faqs-section,
.has-dtw-pergola .dtw-more-products { padding: 48px 0; }

/* Text-only sections use the whole width: heading and lead across the top, the rest in
   two columns, instead of a narrow column with nothing beside it. */
@media (min-width: 900px) {
  .has-dtw-pergola .dtw-ri-full .dtw-ri-content {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 48px;
    align-items: start;
  }
  .has-dtw-pergola .dtw-ri-full .dtw-ri-content > h2,
  .has-dtw-pergola .dtw-ri-full .dtw-ri-content > p:first-of-type { grid-column: 1 / -1; }
  .has-dtw-pergola .dtw-ri-full .dtw-ri-content > p:first-of-type { max-width: 80ch; }
  .has-dtw-pergola .dtw-ri-full .dtw-ri-content > ul { margin-top: 0; }
}

/* Beside a photo, a list of short points runs in two columns so the text ends near the
   photo's foot instead of trailing far below it. */
@media (min-width: 900px) {
  .has-dtw-pergola .dtw-ri-row:not(.dtw-ri-full) .dtw-ri-content > ul {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 24px;
  }
}
.has-dtw-pergola .dtw-ri-cards.dtw-ri-cards-inline { row-gap: 20px; }
.has-dtw-pergola .dtw-ri-cards-inline .dtw-ri-card { padding-top: 14px; }
.has-dtw-pergola .dtw-ri-card h3 { margin: 0 0 8px; }

/* Popular RAL colours (AJ 2026-11-04): a swatch per colour under the two standard cards. */
.dtw-pg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.dtw-pg-swatch { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 1px solid var(--color-grey-light, #e2e5e8); border-radius: 0; cursor: pointer; text-align: left; font: inherit; color: var(--color-dark); }
.dtw-pg-swatch:hover { border-color: var(--color-dark); }
.dtw-pg-swatch[aria-pressed="true"] { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
.dtw-pg-swatch:focus-visible { outline: 2px solid var(--color-dark); outline-offset: 2px; }
.dtw-pg-swatch-chip { flex: none; width: 28px; height: 28px; border: 1px solid rgba(0, 0, 0, .15); }
.dtw-pg-swatch-name { font-size: 13px; font-weight: 600; line-height: 1.25; }
.dtw-pg-swatch-name small { display: block; font-weight: 400; color: #4a545e; font-size: 12px; }
@media (max-width: 960px) { .dtw-pg-swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Pin the model only where it leaves room for the steps: not on a phone held sideways
   or a short laptop screen, where it would cover them. */
@media (min-width: 961px) and (max-height: 699px), (max-height: 460px) {
  .dtw-pg-stage { position: relative; top: auto; }
  .dtw-pg-steps * { scroll-margin-top: calc(var(--header-height) + 16px); }
}

/* Each size box in the colour of its size on the model (pergola-3d DIM_COLOUR). */
.dtw-pg-dim[data-dim="length"] { --dim: #db0933; }
.dtw-pg-dim[data-dim="projection"] { --dim: #1f6fb2; }
.dtw-pg-dim[data-dim="height"] { --dim: #2e7d32; }
.dtw-pg-dim .dtw-pg-dim-name { color: var(--dim); }
.dtw-pg-dim .dtw-pg-dim-ctl { border-color: var(--dim); box-shadow: inset 0 -3px 0 var(--dim); }
