@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600;700&display=swap');

.buy-page {
  font-family: 'Comfortaa', sans-serif;
  background: #F2F8F8;
  min-height: 100vh;
  padding: 60px 20px;
  box-sizing: border-box;
  color: #434B49;
}

.buy-page *,
.buy-page *::before,
.buy-page *::after {
  box-sizing: border-box;
}

.buy-container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.buy-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

/* Grid items default to min-width: auto, which lets a large photo's
   own intrinsic size push its whole column (and the page) wider than
   intended, ignoring the 1fr track sizing entirely - min-width: 0 on
   both columns is what actually makes the percentage/aspect-ratio
   sizing below take effect instead of being overridden by content. */
.buy-gallery,
.buy-card {
  min-width: 0;
}

.buy-gallery-main {
  /* Fixed, not percentage/aspect-ratio based - the photo's own
     resolution or the grid column's width can no longer affect this at
     all, regardless of what's happening upstream. */
  width: 350px;
  height: 350px;
  border-radius: 24px;
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: 0 18px 50px rgba(67, 75, 73, 0.08);
}

.buy-gallery-main img {
  width: 350px;
  height: 350px;
  object-fit: cover;
  display: block;
  transition: opacity 0.15s ease;
}

.buy-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  width: 350px;
}

.buy-gallery-thumb {
  width: 74px;
  height: 74px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #FFFFFF;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(67, 75, 73, 0.08);
}

.buy-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.buy-gallery-thumb.is-active {
  border-color: #007274;
}

@media (max-width: 460px) {
  .buy-gallery-main,
  .buy-gallery-main img,
  .buy-gallery-thumbs {
    width: 100%;
  }
}

.buy-gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #839898;
  font-size: 16px;
  text-align: center;
  padding: 20px;
}

.buy-card {
  background: #FFFFFF;
  border-radius: 28px;
  padding: 40px;
  box-shadow: 0 18px 50px rgba(67, 75, 73, 0.08);
}

.buy-eyebrow {
  margin: 0 0 8px;
  color: #007274;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.buy-item-name {
  margin: 0 0 12px;
  font-size: 30px;
}

.buy-item-description {
  margin: 0 0 24px;
  line-height: 1.7;
  color: #5d6c69;
}

/* Item.description is authored with the dashboard's rich text editor
   (dashboard.richTextEditorHtml()/wireRichTextEditor() in trk-dashboard) -
   rendered here with {{ item.description | safe }} rather than escaped,
   so these mirror that editor's own output styling. */
.buy-item-description p {
  margin: 0 0 16px;
}

.buy-item-description p:last-child {
  margin-bottom: 0;
}

.buy-item-description ul,
.buy-item-description ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.buy-item-description li {
  margin-bottom: 6px;
}

.buy-item-description h2 {
  margin: 24px 0 12px;
  font-size: 20px;
  color: #434B49;
}

.buy-item-description h2:first-child {
  margin-top: 0;
}

.buy-item-description h3 {
  margin: 20px 0 10px;
  font-size: 16px;
  color: #434B49;
}

.buy-item-description h3:first-child {
  margin-top: 0;
}

.buy-item-description strong,
.buy-item-description b {
  color: #434B49;
}

.buy-item-description a {
  color: #007274;
}

.buy-item-description img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 12px 0;
}

.buy-description-section {
  width: min(1120px, 92%);
  margin: 48px auto 0;
  background: #FFFFFF;
  border-radius: 28px;
  padding: 36px 40px;
  box-shadow: 0 18px 50px rgba(67, 75, 73, 0.08);
}

.buy-description-section h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.buy-description-section .buy-item-description {
  margin: 0;
}

.buy-price-row,
.buy-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid #E6EFEF;
  font-weight: 700;
}

.buy-total-row {
  border-bottom: 1px solid #E6EFEF;
  margin-bottom: 24px;
  color: #007274;
  font-size: 18px;
}

.buy-section-title {
  font-size: 18px;
  margin: 28px 0 14px;
}

.buy-help {
  margin: -8px 0 14px;
  color: #839898;
  font-size: 13px;
}

.buy-field {
  margin-bottom: 16px;
}

.buy-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.buy-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 13px;
  color: #5d6c69;
}

.buy-field input,
.buy-field select {
  width: 100%;
  border: 1px solid #D9E6E6;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  color: #434B49;
  background: #FFFFFF;
}

.buy-field input:focus,
.buy-field select:focus {
  outline: none;
  border-color: #007274;
}

/* Variant pickers (Size, Style, ...) read as one row each - label on
   the left, dropdown on the right - rather than stacked like the rest
   of the form's fields. */
#buyVariantFields .buy-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

#buyVariantFields .buy-field label {
  margin-bottom: 0;
  white-space: nowrap;
}

#buyVariantFields .buy-field select {
  width: auto;
  min-width: 180px;
}

.buy-error {
  margin: 8px 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #FDE7EC;
  color: #C0392B;
  font-size: 14px;
}

.buy-logo-choice-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.buy-logo-choice-option {
  width: 100px;
  border: 2px solid #D9E6E6;
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  background: #FFFFFF;
}

.buy-logo-choice-option img {
  width: 100%;
  height: 64px;
  object-fit: contain;
  display: block;
  margin-bottom: 6px;
}

.buy-logo-choice-option span {
  font-size: 12px;
  font-weight: 700;
  color: #434B49;
}

.buy-logo-choice-option.is-selected {
  border-color: #007274;
  background: #EAF6F6;
}

.buy-submit-btn {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 16px 24px;
  background: #007274;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.buy-submit-btn:hover {
  background: #005355;
}

.buy-submit-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.buy-secure-note {
  margin: 16px 0 0;
  text-align: center;
  color: #839898;
  font-size: 12px;
}

@media (max-width: 800px) {
  .buy-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .buy-page {
    padding: 32px 16px;
  }

  .buy-card,
  .buy-description-section {
    padding: 28px 22px;
  }

  .buy-field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  #buyVariantFields .buy-field {
    flex-direction: column;
    align-items: flex-start;
  }

  #buyVariantFields .buy-field select {
    width: 100%;
  }
}
