.page-status {
  max-width: 520px;
  margin: auto;
  padding: 14px 18px;
  background: #fff;
  color: #666;
  font-size: 14px;
  text-align: center;
}

.page-status[hidden] {
  display: none;
}

.features[hidden],
.product-benefits[hidden],
.catalog-details[hidden],
.gallery-thumbnails[hidden] {
  display: none !important;
}

.catalog-only,
.gallery-thumbnails,
.price-label {
  display: none;
}

.page-status.error {
  color: #c62828;
}

.product-page .hero {
  display: flex;
  flex-direction: column;
  padding-top: 12px;
}

.product-gallery {
  margin-top: 0;
}

.product-page .product-title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
}

.product-subtitle {
  margin-top: 8px;
  line-height: 1.5;
}

.product-description {
  margin-top: 26px;
}

.sale-banner,
.discount-badge {
  display: none;
}

.product-gallery {
  order: 1;
}

.gallery-dots {
  order: 2;
}

.product-title {
  order: 3;
}

.product-subtitle {
  order: 4;
}

.price-box {
  order: 5;
}

.hero > .buy-btn {
  order: 6;
}

.hero > .features {
  order: 7;
}

.secondary-media {
  order: 8;
  margin-top: 26px;
  overflow: hidden;
  border-radius: 20px;
}

.secondary-media[hidden] {
  display: none;
}

.secondary-media img {
  display: block;
  width: 100%;
  max-height: 620px;
  object-fit: cover;
}

.product-description {
  order: 9;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: -8px 0 20px;
}

.gallery-dots[hidden] { display: none; }

.gallery-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #c9c9c9;
  cursor: pointer;
  transition: width .2s ease, background .2s ease;
}

.gallery-dots button.active {
  width: 24px;
  background: #171717;
}

.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
  touch-action: pan-x pan-y;
}

.gallery-track::-webkit-scrollbar { display: none; }

.gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.template-kicker {
  display: none;
  order: 3;
  margin: 2px 0 10px;
  color: #777;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.trust-strip {
  margin: 0 18px 28px;
  padding: 18px;
  border: 1px solid #ececec;
  border-radius: 18px;
  background: #fff;
  display: grid;
  gap: 14px;
}

.trust-strip > div {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.trust-strip > div > span { flex: 0 0 34px; font-size: 24px; text-align: center; }
.trust-strip p { color: #666; font-size: 13px; line-height: 1.45; }
.trust-strip strong { display: block; margin-bottom: 2px; color: #171717; font-size: 14px; }
.trust-strip h2 { font-size: 20px; line-height: 1.25; text-align: center; }
.trust-before { display: none; }

#orderForm input {
  scroll-margin-block: 25vh;
}

#order {
  scroll-margin-block: max(18px, env(safe-area-inset-top, 0px));
}

.sticky-buy {
  z-index: 1200;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  width: min(500px, calc(100% - 20px));
}

.sticky-buy[hidden] {
  display: none !important;
}

body.keyboard-open .sticky-buy {
  display: none;
}

.success-actions {
  display: grid;
  gap: 10px;
}

.success-card .success-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  border: 1px solid #d8d8d8;
  border-radius: 12px;
  background: #f7f7f7;
  color: #252525;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.success-card .success-secondary:focus-visible {
  outline: 3px solid rgba(49, 92, 66, .28);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .order-section {
    margin-bottom: 40px;
  }

  body.keyboard-open .order-section {
    margin-bottom: min(44vh, 360px);
  }
}

/* Minimal */

.template-minimal .product-page {
  background: #fff;
}

.template-minimal .hero > .features {
  grid-template-columns: 1fr;
}

.template-minimal .features div {
  text-align: left;
}

/* Premium */

body.template-premium {
  background: #171717;
}

.template-premium .product-page {
  background: linear-gradient(180deg, #f7f5f0 0, #fff 48%);
}

.template-premium .product-page .hero {
  padding-top: 14px;
}

.template-premium .product-gallery,
.template-premium .secondary-media {
  background: #dedbd4;
  border-radius: 6px;
}

.template-premium .product-page .product-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.15;
}

.template-premium .product-subtitle {
  color: #57534e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.template-premium .price-box strong {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.template-premium .buy-btn,
.template-premium .submit-btn,
.template-premium .sticky-buy a,
.template-premium .success-card button {
  background: #171717;
  color: #fff;
  border-radius: 5px;
}

.template-premium .secondary-media {
  order: 7;
}

.template-premium .hero > .features {
  order: 8;
  grid-template-columns: 1fr 1fr;
}

.template-premium .features div,
.template-premium .simple-list > div {
  border: 1px solid #e7e2d9;
  background: rgba(255,255,255,.7);
  box-shadow: none;
}

.template-premium .delivery {
  background: linear-gradient(135deg, #171717, #393939);
  border-radius: 6px;
}

.template-premium .order-section {
  border: 1px solid #e7e2d9;
  background: #faf9f6;
  border-radius: 6px;
}

.template-premium .sticky-buy {
  border: 1px solid #e5e5e5;
  border-radius: 7px;
}

/* Sales */

body.template-sales {
  background: #fff3e7;
}

.template-sales .product-page {
  background: #fffdf9;
}

.template-sales .sale-banner {
  order: 0;
  display: block;
  align-self: center;
  margin-bottom: 12px;
  padding: 9px 18px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.template-sales .product-page .product-title {
  font-size: 31px;
  font-weight: 900;
  line-height: 1.12;
}

.template-sales .product-subtitle {
  color: #44403c;
  font-size: 16px;
  font-weight: 600;
}

.template-sales .price-box {
  padding: 15px;
  border: 2px dashed #f59e0b;
  border-radius: 14px;
  background: #fff7d6;
}

.template-sales .price-box strong,
.template-sales .order-price strong {
  color: #dc2626;
  font-size: 38px;
}

.template-sales .discount-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 7px;
  background: #dc2626;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.template-sales .buy-btn,
.template-sales .submit-btn,
.template-sales .sticky-buy a,
.template-sales .success-card button {
  background: #ffc928;
  color: #111;
  box-shadow: 0 7px 0 #d89f00;
}

.template-sales .hero > .features {
  grid-template-columns: 1fr;
}

.template-sales .features div {
  border-left: 5px solid #16a34a;
  background: #f0fdf4;
  text-align: left;
}

.template-sales .product-benefits {
  margin: 0 12px 24px;
  border: 2px solid #fde68a;
  border-radius: 18px;
  background: #fffbeb;
}

.template-sales .delivery {
  border: 2px solid #ffc928;
  background: #1c1917;
}

.template-sales .order-section {
  border: 2px solid #ffc928;
  background: #fff7d6;
}

/* Modern: airy cards, rounded imagery, and a clear green conversion path. */
body.template-modern { background: #eef3f8; }
.template-modern .product-page { background: #f8fafc; }
.template-modern .hero { padding: 12px 16px 26px; }
.template-modern .product-gallery,
.template-modern .secondary-media {
  border-radius: 26px;
  background: #e8eef4;
  box-shadow: 0 12px 38px rgba(35, 55, 80, .12);
}
.template-modern .product-title { font-size: 32px; }
.template-modern .price-box {
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(35, 55, 80, .08);
}
.template-modern .price-box strong { color: #126b54; font-size: 38px; }
.template-modern .buy-btn,
.template-modern .submit-btn,
.template-modern .sticky-buy a { background: #126b54; color: #fff; }
.template-modern .features { grid-template-columns: 1fr; }
.template-modern .features div {
  padding: 16px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(35, 55, 80, .07);
  text-align: left;
}
.template-modern .trust-before { display: grid; }

/* Trust: calm reassurance is prominent before the mid-page form. */
body.template-trust { background: #edf5f2; }
.template-trust .product-page { display: flex; flex-direction: column; background: #fbfdfc; }
.template-trust .hero { order: 1; }
.template-trust .trust-before { order: 2; display: grid; }
.template-trust .product-benefits { order: 3; }
.template-trust .order-section { order: 4; }
.template-trust .delivery { order: 5; }
.template-trust .trust-after { order: 6; }
.template-trust .product-title { color: #163c32; }
.template-trust .price-box strong { color: #176b53; }
.template-trust .buy-btn,
.template-trust .submit-btn,
.template-trust .sticky-buy a { background: #176b53; color: #fff; }
.template-trust .trust-before,
.template-trust .order-section { border-color: #cfe3dc; background: #f1f8f5; }
.template-trust .hero > .features,
.template-trust .secondary-media,
.template-trust .product-description { display: none; }

/* Showcase: edge-to-edge editorial imagery and a tall swipe gallery. */
body.template-showcase { background: #e9e9e9; }
.template-showcase .product-page { background: #fff; }
.template-showcase .hero { padding: 0 18px 30px; }
.template-showcase .product-gallery { margin-inline: -18px; border-radius: 0 0 30px 30px; }
.template-showcase .main-image { aspect-ratio: 4 / 5; }
.template-showcase .gallery-dots { margin-top: -38px; margin-bottom: 28px; position: relative; z-index: 2; }
.template-showcase .gallery-dots button { background: rgba(255,255,255,.72); box-shadow: 0 1px 5px rgba(0,0,0,.2); }
.template-showcase .gallery-dots button.active { background: #fff; }
.template-showcase .secondary-media { order: 7; margin-inline: -18px; border-radius: 0; }
.template-showcase .hero > .features { order: 8; }
.template-showcase .product-description { order: 9; }
.template-showcase .trust-before { display: grid; }

/* Direct: compact high-contrast direct-response composition. */
body.template-direct { background: #fff4e5; }
.template-direct .product-page { display: flex; flex-direction: column; background: #fffcf8; }
.template-direct .hero { order: 1; }
.template-direct .trust-before { order: 2; display: grid; }
.template-direct .order-section { order: 3; }
.template-direct .product-benefits { order: 4; }
.template-direct .delivery { order: 5; }
.template-direct .trust-after { order: 6; }
.template-direct .sale-banner {
  order: 0;
  display: block;
  align-self: flex-start;
  padding: 8px 13px;
  border-radius: 8px;
  background: #e53935;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}
.template-direct .product-title { font-size: 32px; text-align: left; }
.template-direct .product-subtitle { text-align: left; }
.template-direct .price-box { padding: 16px; border-left: 5px solid #e53935; background: #fff1ee; text-align: left; }
.template-direct .price-box strong,
.template-direct .order-price strong { color: #d62f2f; font-size: 38px; }
.template-direct .buy-btn,
.template-direct .submit-btn,
.template-direct .sticky-buy a { background: #e53935; color: #fff; }
.template-direct .features { grid-template-columns: 1fr; }
.template-direct .features div { border-left: 4px solid #168b55; background: #f1fbf5; text-align: left; }

/* Elegant: editorial typography, neutral palette, restrained gold accents. */
body.template-elegant { background: #161513; }
.template-elegant .product-page { background: #f4f0e8; }
.template-elegant .hero { padding: 16px 22px 36px; }
.template-elegant .template-kicker { display: block; color: #8b6b31; }
.template-elegant .product-title,
.template-elegant .order-section h2,
.template-elegant .section h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.template-elegant .product-title { font-size: 36px; }
.template-elegant .product-gallery,
.template-elegant .secondary-media { border-radius: 2px; background: #ded8cc; }
.template-elegant .price-box strong { color: #7b5b24; font-family: Georgia, "Times New Roman", serif; font-size: 38px; font-weight: 500; }
.template-elegant .buy-btn,
.template-elegant .submit-btn,
.template-elegant .sticky-buy a { border-radius: 2px; background: #1f1d19; color: #f7f1e5; }
.template-elegant .secondary-media { order: 7; }
.template-elegant .hero > .features { order: 8; grid-template-columns: 1fr; }
.template-elegant .features div { border: 1px solid #d7cebd; border-radius: 2px; background: transparent; text-align: left; }
.template-elegant .order-section,
.template-elegant .trust-strip { border: 1px solid #d7cebd; border-radius: 2px; background: #faf7f1; }
.template-elegant .trust-before { display: grid; }
.template-elegant .delivery { border-radius: 2px; background: #1f1d19; }

/* Catalog: a calm, familiar mobile storefront product page. */
body.template-catalog {
  background: #eceeea;
  color: #20231f;
}

.template-catalog .product-page {
  display: flex;
  flex-direction: column;
  max-width: 500px;
  padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  background: #fbfaf7;
}

.template-catalog .catalog-only {
  display: block;
}

.template-catalog .catalog-header {
  order: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 18px;
  border-bottom: 1px solid #e5e6e1;
  background: rgba(251, 250, 247, .96);
}

.catalog-brand {
  color: #26322b;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-decoration: none;
}

.catalog-actions {
  display: flex;
  gap: 8px;
}

.catalog-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #dedfd9;
  border-radius: 10px;
  background: #fff;
  color: #26322b;
  font-size: 17px;
}

.template-catalog .hero {
  order: 1;
  padding: 14px 18px 22px;
  text-align: left;
}

.template-catalog .product-gallery {
  margin: 0;
  border: 1px solid #e3e4df;
  border-radius: 14px;
  background: #fff;
}

.template-catalog .main-image {
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.template-catalog .gallery-dots {
  display: none;
}

.template-catalog .gallery-thumbnails {
  order: 2;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 10px 0 0;
}

.template-catalog .gallery-thumbnails:not([hidden]) {
  display: grid;
}

.gallery-thumbnails button {
  overflow: hidden;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid #dedfd9;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.gallery-thumbnails button.active {
  border-color: #496a56;
  box-shadow: 0 0 0 1px #496a56;
}

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

.template-catalog .product-title {
  order: 3;
  margin-top: 22px;
  color: #20231f;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
}

.template-catalog .product-subtitle,
.template-catalog .hero > .buy-btn,
.template-catalog .hero > .features,
.template-catalog .secondary-media,
.template-catalog .product-description,
.template-catalog .discount-badge {
  display: none;
}

.template-catalog .price-box {
  order: 4;
  margin: 14px 0 0;
  padding: 15px 16px;
  border: 1px solid #e2e3de;
  border-radius: 12px;
  background: #fff;
  text-align: left;
}

.template-catalog .price-label {
  display: block;
  margin-bottom: 6px;
  color: #62675f;
  font-size: 14px;
  font-weight: 600;
}

.template-catalog .old-price {
  font-size: 14px;
}

.template-catalog .price-box strong {
  margin-top: 3px;
  color: #315c42;
  font-size: 30px;
}

.template-catalog .catalog-delivery-note {
  order: 2;
  margin: 0 18px 22px;
  padding: 16px;
  border: 1px solid #dce4dc;
  border-radius: 12px;
  background: #f3f7f2;
}

.catalog-delivery-note p {
  color: #4f574f;
  font-size: 14px;
  line-height: 1.5;
}

.catalog-delivery-note p + p {
  margin-top: 8px;
}

.catalog-delivery-note strong {
  color: #2e4736;
}

.template-catalog .catalog-details {
  order: 3;
  margin: 0 18px 28px;
  padding: 20px 18px;
  border: 1px solid #e2e3de;
  border-radius: 14px;
  background: #fff;
}

.catalog-short-description {
  color: #30352f;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.55;
}

.catalog-description {
  margin-top: 10px;
  color: #62675f;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-line;
}

.catalog-details h2 {
  margin: 24px 0 13px;
  font-size: 20px;
  line-height: 1.3;
}

.catalog-benefits {
  display: grid;
  gap: 9px;
}

.catalog-benefits > div {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 13px;
  border: 1px solid #e6e7e2;
  border-radius: 10px;
  background: #fafaf8;
}

.catalog-benefits span {
  color: #3f704f;
  font-size: 16px;
  font-weight: 800;
}

.catalog-benefits p {
  color: #3f443e;
  font-size: 14px;
  line-height: 1.5;
}

.template-catalog .order-section {
  order: 4;
  margin: 0 18px 28px;
  padding: 22px 18px;
  border: 1px solid #dedfd9;
  border-radius: 14px;
  background: #f4f4f0;
}

.template-catalog .order-section h2 {
  font-size: 24px;
  text-align: left;
}

.template-catalog .order-text {
  margin: 7px 0 16px;
  text-align: left;
}

.template-catalog .order-price {
  display: none;
}

.template-catalog form input {
  border-color: #d4d6d0;
  border-radius: 10px;
}

.template-catalog form input:focus {
  border-color: #496a56;
  box-shadow: 0 0 0 3px rgba(73, 106, 86, .12);
}

.template-catalog .submit-btn,
.template-catalog .success-card button {
  border-radius: 10px;
  background: #315c42;
  color: #fff;
  box-shadow: none;
}

.template-catalog .product-benefits,
.template-catalog .delivery,
.template-catalog .trust-before {
  display: none;
}

.template-catalog .trust-after {
  order: 5;
  margin: 0 18px 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.template-catalog .trust-after h2 {
  margin-bottom: 2px;
  font-size: 20px;
  text-align: left;
}

.template-catalog .trust-after > div {
  padding: 13px 14px;
  border: 1px solid #e2e3de;
  border-radius: 11px;
  background: #fff;
}

.template-catalog .catalog-footer {
  order: 6;
  padding: 22px 18px 26px;
  border-top: 1px solid #e2e3de;
  color: #747a72;
  font-size: 13px;
  text-align: center;
}

body.template-catalog.keyboard-open .order-section {
  margin-bottom: 28px;
}

@media (max-width: 380px) {
  .template-premium .hero > .features {
    grid-template-columns: 1fr;
  }

  .template-sales .price-box strong,
  .template-sales .order-price strong {
    font-size: 33px;
  }
}
