* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #0f172a;
  color: #f8fafc;
  overflow: hidden;
}

.cdisp {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 32px 32px;
}

.cdisp__header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.cdisp__logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}
.cdisp__store {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}
.cdisp__status {
  margin-left: auto;
  font-size: 0.85rem;
  color: #64748b;
}

.cdisp__views {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.cdisp-view {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  animation: cdispFadeIn 0.35s ease;
}
.cdisp-view.active {
  display: flex;
}

@keyframes cdispFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* idle */
.cdisp-idle {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.cdisp-idle__title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin: 24px 0 12px;
  color: #f8fafc;
}
.cdisp-idle__sub {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: #94a3b8;
}

/* cart */
.cdisp-cart__list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}
.cdisp-cart__item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cdisp-cart__thumb {
  width: clamp(64px, 10vw, 96px);
  height: clamp(64px, 10vw, 96px);
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}
.cdisp-cart__info {
  flex: 1;
  min-width: 0;
}
.cdisp-cart__name {
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  font-weight: 700;
  margin: 0 0 4px;
}
.cdisp-cart__meta {
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: #94a3b8;
  margin: 0;
}
.cdisp-cart__line-total {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: #60a5fa;
  white-space: nowrap;
}
.cdisp-cart__footer {
  flex-shrink: 0;
  padding-top: 20px;
  border-top: 2px solid rgba(255, 255, 255, 0.15);
}
.cdisp-cart__footer-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(40px, 4vw, 48px);
}
.cdisp-cart__footer-row--single .cdisp-cart__total-wrap {
  text-align: center;
}
.cdisp-cart__discount-wrap,
.cdisp-cart__total-wrap {
  flex: 0 0 auto;
  text-align: center;
}
.cdisp-cart__discount-wrap.hidden {
  display: none;
}
.cdisp-cart__total-label {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: #94a3b8;
  margin: 0 0 8px;
}
.cdisp-cart__amount {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 900;
  margin: 0;
  line-height: 1.1;
}
.cdisp-cart__discount {
  color: #4ade80;
}
.cdisp-cart__total {
  color: #3b82f6;
}

/* checkout */
.cdisp-checkout {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.cdisp-checkout__label {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: #94a3b8;
  margin: 0 0 16px;
}
.cdisp-checkout__amount {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 900;
  margin: 0;
  color: #fbbf24;
  line-height: 1;
  text-shadow: 0 4px 24px rgba(251, 191, 36, 0.3);
}

/* thankyou */
.cdisp-thankyou {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.cdisp-thankyou__title {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 900;
  margin: 0 0 32px;
  color: #4ade80;
}
.cdisp-thankyou__row {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin: 12px 0;
  color: #e2e8f0;
}
.cdisp-thankyou__row strong {
  color: #60a5fa;
  font-weight: 800;
}

.cdisp__errors {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  gap: 8px;
  max-width: min(520px, calc(100vw - 32px));
  width: 100%;
  z-index: 100;
}
.cdisp__errors.show {
  display: flex;
}
.cdisp__error-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #dc2626;
  color: #fff;
  padding: 10px 12px 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.cdisp__error-msg {
  flex: 1;
  line-height: 1.4;
}
.cdisp__error-dismiss {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.cdisp__error-dismiss:hover {
  background: rgba(0, 0, 0, 0.35);
}
