/**
 * Certificate shell — hand-maintained layout glue.
 *
 * Design visuals: designs/{name}/front/styles.css (source)
 * WordPress scoped CSS: dist/scoped/{name}-front.css (build output)
 */

.gc-cert-scale,
.gc-cert-scale *,
.gc-cert-scale *::before,
.gc-cert-scale *::after {
  box-sizing: border-box;
}

.gc-cert-scale .gc-cert-card {
  width: 920px;
  height: 580px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  display: block;
  margin: 0;
  padding: 0;
  max-width: none;
  min-width: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Premium/navruz: front-el-6 is a full-bleed gradient overlay (stripped in build).
   Classic: front-el-6 is the inner umber frame — keep it visible. */
.gc-cert--premium .front-el-6,
.gc-cert--navruz .front-el-6 {
  display: none !important;
}

/* ── Viewport contexts (920×580 source scaled via container queries) ── */

.gc-cert-viewport {
  position: relative;
  overflow: hidden;
  container-type: size;
}

.gc-cert-viewport .gc-cert-scale {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 920px;
  height: 580px;
  transform: translate(-50%, -50%) scale(min(100cqw / 920px, 100cqh / 580px));
  transform-origin: center center;
}

.gc-cert-viewport--hero {
  position: absolute;
  inset: 0;
}

.gc-cert-viewport--hero.gc-hero__cert-viewport--premium {
  background: rgb(26, 20, 16);
}

.gc-cert-viewport--tier {
  width: 200px;
  height: 126px;
  margin: 0 auto;
  border-radius: 13px 13px 0 0;
}

/* Tier pick grid — preview fills card width, height follows 920×580 ratio */
.gc-tier-pick__preview .gc-cert-viewport--tier {
  width: 100%;
  height: auto;
  aspect-ratio: 920 / 580;
  margin: 0;
  border-radius: 0;
}

/* Tier preview — keep dynamic amounts on one line */
.gc-tier-pick__preview .gc-cert .field-amount {
  white-space: nowrap !important;
  width: auto !important;
  max-width: none !important;
}

.gc-tier-pick__preview .gc-cert--classic .front-el-29 {
  flex-wrap: nowrap !important;
}

.gc-tier-pick__preview .gc-cert--classic .field-amount {
  display: inline !important;
}

.gc-cert-viewport--picker {
  width: 160px;
  height: 100px;
  border-radius: 14px;
}

/* Wizard template picker — preview fills card width, keeps 920×580 ratio */
.gc-template-card-inner .gc-cert-viewport--picker {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 920 / 580 !important;
  margin: 0 !important;
  border-radius: 0;
}

.gc-template-card-inner .gc-cert .field-amount {
  white-space: nowrap !important;
  width: auto !important;
  max-width: none !important;
}

.gc-template-card-inner .gc-cert--classic .front-el-29 {
  flex-wrap: nowrap !important;
}

.gc-template-card-inner .gc-cert--classic .field-amount {
  display: inline !important;
}

/* Admin design template table — preview fills cell, keeps 920×580 ratio */
.gc-tpl-preview-cell .gc-cert-viewport--picker {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 920 / 580 !important;
  margin: 0 !important;
  border-radius: 14px;
}

.gc-tpl-preview-cell .gc-cert .field-amount {
  white-space: nowrap !important;
  width: auto !important;
  max-width: none !important;
}

.gc-tpl-preview-cell .gc-cert--classic .front-el-29 {
  flex-wrap: nowrap !important;
}

.gc-tpl-preview-cell .gc-cert--classic .field-amount {
  display: inline !important;
}

.gc-cert-viewport--card {
  width: 280px;
  height: 176px;
  border-radius: 14px;
}

/* LK account cards — certificate fills tile width */
.gc-account-card .gc-cert-viewport--card {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 920 / 580 !important;
  margin: 0 !important;
  border-radius: 13px 13px 0 0;
}

.gc-account-card .gc-cert .field-amount {
  white-space: nowrap !important;
  width: auto !important;
  max-width: none !important;
}

.gc-account-card .gc-cert--classic .front-el-29 {
  flex-wrap: nowrap !important;
}

.gc-account-card .gc-cert--classic .field-amount {
  display: inline !important;
}

/* Shop product page + purchase wizard — full-width certificate preview */
.gc-single-product__visual .gc-cert-viewport--card,
.gc-wizard-aside-card__preview .gc-cert-viewport--card {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 920 / 580 !important;
  margin: 0 auto !important;
  max-width: 100%;
  border-radius: 22px;
  box-shadow:
    0 16px 40px -12px rgba(28, 20, 16, 0.28),
    0 6px 16px rgba(28, 20, 16, 0.1);
}

.gc-single-product__visual .gc-cert .field-amount,
.gc-wizard-aside-card__preview .gc-cert .field-amount {
  white-space: nowrap !important;
  width: auto !important;
  max-width: none !important;
}

.gc-single-product__visual .gc-cert--classic .front-el-29,
.gc-wizard-aside-card__preview .gc-cert--classic .front-el-29 {
  flex-wrap: nowrap !important;
}

.gc-single-product__visual .gc-cert--classic .field-amount,
.gc-wizard-aside-card__preview .gc-cert--classic .field-amount {
  display: inline !important;
}

/* Gift presentation page (/podarok/) — certificate fills column width */
.gc-gift-card-visual .gc-cert-viewport--card {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 920 / 580 !important;
  margin: 0 auto !important;
  max-width: 100%;
  border-radius: 14px;
  box-shadow:
    0 16px 40px -12px rgba(28, 20, 16, 0.28),
    0 6px 16px rgba(28, 20, 16, 0.1);
}

.gc-gift-card-visual .gc-cert .field-amount {
  white-space: nowrap !important;
  width: auto !important;
  max-width: none !important;
}

.gc-gift-card-visual .gc-cert--classic .front-el-29 {
  flex-wrap: nowrap !important;
}

.gc-gift-card-visual .gc-cert--classic .field-amount {
  display: inline !important;
}

.gc-gift-card-visual .gc-cert--navruz .front-el-28 {
  flex-wrap: nowrap !important;
  justify-content: center !important;
}

.gc-gift-card-visual .gc-cert--navruz .field-amount {
  display: inline !important;
}

.gc-cert-viewport--checkout {
  width: 240px;
  height: 151px;
  margin: 0 auto;
  border-radius: 14px;
}

/* Checkout + thank you — certificate fills column width */
.gc-checkout .gc-cert-viewport--checkout,
.gc-thankyou .gc-cert-viewport--checkout {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 920 / 580 !important;
  margin: 0 !important;
  max-width: 100%;
  border-radius: 14px;
}

.gc-checkout .gc-cert .field-amount,
.gc-thankyou .gc-cert .field-amount {
  white-space: nowrap !important;
  width: auto !important;
  max-width: none !important;
}

.gc-checkout .gc-cert--classic .front-el-29,
.gc-thankyou .gc-cert--classic .front-el-29 {
  flex-wrap: nowrap !important;
}

.gc-checkout .gc-cert--classic .field-amount,
.gc-thankyou .gc-cert--classic .field-amount {
  display: inline !important;
}

.gc-checkout .gc-cert--navruz .front-el-28,
.gc-thankyou .gc-cert--navruz .front-el-28 {
  flex-wrap: nowrap !important;
  justify-content: center !important;
}

.gc-checkout .gc-cert--navruz .field-amount,
.gc-thankyou .gc-cert--navruz .field-amount {
  display: inline !important;
}

/* Hero preview — hardcoded demo amounts are wider than default canvas widths */
.gc-cert-viewport--hero .gc-cert .field-amount {
  white-space: nowrap !important;
  width: auto !important;
  max-width: none !important;
}

.gc-cert-viewport--hero .gc-cert--classic .front-el-29 {
  flex-wrap: nowrap !important;
  width: auto !important;
  max-width: 100% !important;
}

.gc-cert-viewport--hero .gc-cert--classic .field-amount {
  display: inline !important;
}

.gc-cert-viewport--hero .gc-cert--navruz .front-el-28 {
  flex-wrap: nowrap !important;
  justify-content: center !important;
}

.gc-cert-viewport--hero .gc-cert--navruz .field-amount {
  display: inline !important;
}
