/* Photo-count screen; decorative strip designs are chosen in the editor. */
.template-collection-body {
  min-height: 100vh;
  min-height: 100dvh;
  background-position: center;
  color: #f8f2e9;
  font-family: "DM Sans", sans-serif;
}

.template-collection-body .shell {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  max-width: none;
  min-height: calc(100svh - 72px);
  height: auto;
  justify-content: center;
  padding: clamp(16px, 2.5vh, 26px) 24px 28px;
}

.template-collection-body main {
  display: flex;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
}

.template-collection-body .collection-page {
  display: flex;
  width: fit-content;
  max-width: min(1120px, 100%);
  height: auto;
  min-height: 0;
  flex: 0 0 auto;
  flex-direction: column;
  margin: 0 auto;
  overflow: visible;
  padding: 0;
}

.template-collection-body .collection-hero {
  width: 100%;
  max-width: none;
  flex: 0 0 auto;
  margin: 0 0 clamp(12px, 1.8vh, 17px);
  color: #fff8ee;
  text-align: center;
}

.template-collection-body .collection-eyebrow {
  margin: 0 0 5px;
  color: #ead7bd;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.23em;
}

.template-collection-body .collection-hero h1 {
  margin: 0;
  color: #fff8ee;
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: clamp(2rem, 3.25vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.template-collection-body .collection-hero h1 em {
  color: #f0d7c8;
  font-style: italic;
  font-weight: 400;
}

.template-collection-body .collection-hero p {
  margin: 5px 0 0;
  color: rgba(255, 248, 238, 0.88);
  font-size: clamp(0.78rem, 1vw, 0.92rem);
  line-height: 1.45;
}

.template-collection-body .collection-layout {
  display: grid;
  width: fit-content;
  max-width: 100%;
  height: auto;
  grid-auto-rows: max-content;
  max-height: none;
  min-height: 0;
  grid-template-columns: auto auto;
  align-items: stretch;
  align-self: auto;
  gap: 14px;
  flex: 0 0 auto;
  margin: 0;
  overflow: visible;
}

.template-collection-body .collection-library,
.template-collection-body .collection-selection {
  box-sizing: border-box;
  width: auto;
  height: auto;
  max-height: none;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  overflow: visible;
  border: 1px solid rgba(218, 195, 161, 0.72);
  border-radius: 10px;
  background: rgba(250, 246, 238, 0.98);
  color: #352820;
  box-shadow: 0 12px 30px rgba(27, 10, 10, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.template-collection-body .count-choice-panel {
  display: flex;
  width: fit-content;
  height: auto;
  min-height: 0;
  flex: 0 0 auto;
  align-items: stretch;
  justify-content: center;
  padding: 21px;
}

.count-choice-grid {
  display: grid;
  width: fit-content;
  height: 100%;
  max-width: none;
  grid-template-columns: repeat(3, 180px);
  grid-template-rows: 1fr;
  align-content: stretch;
  align-items: stretch;
  align-self: stretch;
  gap: 14px;
}

.count-choice-card {
  position: relative;
  box-sizing: border-box;
  display: flex;
  width: 180px;
  height: auto;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 12px;
  border: 1px solid #e1d8cb;
  border-radius: 6px;
  background: #f4f0e9;
  color: #362921;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.count-choice-card:hover {
  border-color: #bda98f;
  background: #fffdf8;
  box-shadow: 0 6px 14px rgba(55, 37, 23, 0.1);
  transform: translateY(-2px);
}

.count-choice-card.is-selected {
  border: 1px solid #70252c;
  background: #fffdf8;
  box-shadow: 0 4px 12px rgba(112, 37, 44, 0.1);
}

.count-choice-card:focus-visible {
  outline: 2px solid #70252c;
  outline-offset: 3px;
}

.count-choice-check {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #70252c;
  color: #fffaf4;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.count-choice-check .lucide {
  width: 13px;
  height: 13px;
  stroke-width: 2.5;
}

.count-choice-card.is-selected .count-choice-check {
  opacity: 1;
  transform: scale(1);
}

.count-strip-preview {
  box-sizing: border-box;
  display: flex;
  width: auto;
  height: var(--count-strip-preview-height, 228px);
  aspect-ratio: var(--count-strip-ratio, 0.375);
  flex: 0 0 auto;
  flex-direction: column;
  padding: var(--count-strip-margin, 8px) var(--count-strip-margin, 8px) 0;
  background: #fcfaf5;
  box-shadow: 0 4px 9px rgba(44, 34, 25, 0.2), 0 1px 2px rgba(44, 34, 25, 0.12);
}

.count-strip-preview::before {
  display: block;
  height: var(--count-strip-title-band, 0px);
  flex: 0 0 var(--count-strip-title-band, 0px);
  content: "";
}

.count-strip-photos {
  display: flex;
  width: 100%;
  height: var(--count-strip-photo-region-height, auto);
  min-height: 0;
  flex: 0 0 auto;
  flex-direction: column;
  gap: var(--count-strip-gap, 3px);
}

.count-strip-photos > span {
  display: block;
  height: var(--count-strip-photo-height, auto);
  min-height: 0;
  flex: 0 0 var(--count-strip-photo-height, auto);
  background: #dcdad6;
}

.count-strip-footer {
  position: relative;
  position: relative;
  display: block;
  height: var(--count-strip-footer-height, 8px);
  flex: 0 0 var(--count-strip-footer-height, 8px);
  background: #fcfaf5;
}

.count-strip-wordmark {
  position: absolute;
  top: 50%;
  left: 2px;
  max-width: calc(100% - var(--count-strip-qr-size, 0px) - 8px);
  overflow: hidden;
  transform: translateY(-50%);
  color: #382a22;
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: var(--count-strip-brand-size, 4px);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.count-strip-footer::after {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: var(--count-strip-qr-size, 0px);
  aspect-ratio: 1;
  box-sizing: border-box;
  border: 1px solid rgba(54, 47, 40, 0.5);
  background: #fff;
  content: "";
}

.count-choice-title {
  color: #382a22;
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.25;
}

.count-choice-description {
  max-width: 22ch;
  color: #776a5e;
  font-size: 0.72rem;
  line-height: 1.4;
}

.count-choice-card .count-choice-description {
  margin: 0;
}

.template-collection-body .collection-selection {
  display: flex;
  width: 288px;
  height: 100%;
  max-width: none;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  padding: 20px 21px;
  text-align: center;
}

.template-collection-body .selection-eyebrow {
  margin: 0 0 5px;
  color: #887b6f;
  font-size: 0.63rem;
  letter-spacing: 0.2em;
}

.template-collection-body .collection-selection h2 {
  margin: 0;
  color: #382a22;
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.template-collection-body .count-selection-preview {
  display: grid;
  width: auto;
  height: auto;
  max-height: none;
  min-height: 0;
  flex: 0 0 auto;
  place-items: center;
  margin: 9px 0 7px;
  overflow: visible;
  padding: 0;
  background: transparent;
}

.count-strip-preview--large {
  height: var(--count-strip-large-preview-height, 218px);
  box-shadow: 0 6px 14px rgba(44, 34, 25, 0.22), 0 1px 3px rgba(44, 34, 25, 0.15);
}

.template-collection-body .selection-details {
  flex: 0 0 auto;
  color: #62564c;
  font-size: 0.76rem;
}

.template-collection-body .selection-note {
  max-width: 26ch;
  margin: 5px 0 0;
  color: #8a7d72;
  font-size: 0.68rem;
  line-height: 1.4;
}

.template-collection-body .selection-continue {
  display: flex;
  width: 100%;
  min-height: 42px;
  flex: 0 0 auto;
  justify-content: center;
  gap: 8px;
  margin-top: 11px;
  border: 1px solid #70252c;
  border-radius: 5px;
  background: #70252c;
  color: #fffaf4;
  font-family: "DM Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 5px 12px rgba(112, 37, 44, 0.16);
}

.template-collection-body .selection-continue:hover {
  border-color: #5c1c23;
  background: #5c1c23;
  color: #fffaf4;
  box-shadow: 0 7px 16px rgba(112, 37, 44, 0.2);
  transform: translateY(-1px);
}

.template-collection-body .selection-continue:focus-visible {
  outline: 2px solid #70252c;
  outline-offset: 3px;
}

.template-collection-body .selection-continue .lucide {
  width: 16px;
  height: 16px;
}

@media (max-height: 820px) and (min-width: 761px) {
  .template-collection-body .shell {
    padding-top: 14px;
    padding-bottom: 18px;
  }

  .template-collection-body .collection-hero {
    margin-bottom: 12px;
  }

  .template-collection-body .collection-hero h1 {
    font-size: clamp(1.9rem, 3.25vw, 2.8rem);
  }

  .count-strip-preview {
    height: clamp(190px, 28vh, 218px);
  }

  .count-strip-preview--large {
    height: clamp(190px, 28vh, 218px);
  }
}

@media (min-width: 963px) {
  .template-collection-body .collection-layout {
    grid-auto-rows: max-content;
  }
}

@media (max-width: 962px) {
  .template-collection-body .collection-page {
    width: min(100%, 660px);
  }

  .template-collection-body .collection-layout {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 14px;
  }

  .template-collection-body .count-choice-panel {
    width: fit-content;
    height: auto;
    max-width: 100%;
    padding: 16px;
  }

  .count-choice-grid {
    height: auto;
  }

  .count-choice-card {
    height: auto;
  }

  .template-collection-body .collection-selection {
    width: min(100%, 320px);
  }
}

@media (max-width: 760px) {
  .template-collection-body .shell {
    min-height: calc(100svh - 64px);
    height: auto;
    padding: 18px 16px 28px;
  }

  .template-collection-body .collection-hero {
    margin-bottom: 14px;
  }

  .template-collection-body .collection-hero h1 {
    font-size: clamp(1.9rem, 6.5vw, 2.5rem);
  }

  .template-collection-body .collection-hero p {
    max-width: 34ch;
    margin-inline: auto;
  }

  .template-collection-body .count-choice-panel {
    padding: clamp(10px, 3vw, 16px);
  }

  .count-choice-grid {
    width: 100%;
    grid-template-rows: auto;
    align-self: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(6px, 2vw, 12px);
  }

  .count-choice-card {
    width: auto;
    gap: 7px;
    justify-content: flex-start;
    padding: 12px 5px;
  }

  .count-choice-card .count-choice-description {
    margin-top: 0;
  }

  .count-choice-check {
    top: 5px;
    right: 5px;
    width: 19px;
    height: 19px;
  }

  .count-choice-check .lucide {
    width: 11px;
    height: 11px;
  }

  .count-strip-preview {
    height: clamp(112px, 34vw, 148px);
  }

  .count-choice-title {
    font-size: clamp(0.76rem, 3vw, 0.94rem);
  }

  .count-choice-description {
    font-size: clamp(0.58rem, 2.3vw, 0.68rem);
    line-height: 1.32;
  }

  .template-collection-body .collection-selection {
    padding: 17px 18px;
  }

  .count-strip-preview--large {
    height: clamp(198px, 58vw, 226px);
  }
}

@media (max-width: 360px) {
  .template-collection-body .shell {
    padding-inline: 11px;
  }

  .count-choice-grid {
    gap: 5px;
  }

  .count-choice-card {
    padding-inline: 3px;
  }

  .count-choice-description {
    font-size: 0.54rem;
  }
}

/* Shared strip geometry; header wordmark mirrors White/Black/Burgundy output. */
.count-strip-header-brand::before {
  content: "SnapBack";
  display: flex; align-items: center; justify-content: center;
  font: 600 calc(var(--count-strip-brand-size, 6px) * 1.3333)/1 "Bodoni Moda", Georgia, serif;
  color: #262220;
}
.count-strip-header-brand .count-strip-wordmark { display: none; }
