* {
  box-sizing: border-box;
}

:root {
  --widget-bg: #f5f7fb;
  --widget-surface: #ffffff;
  --widget-surface-soft: #f8fafc;
  --widget-text: #172033;
  --widget-muted: #5f6b85;
  --widget-line: #d9e1ee;
  --widget-primary: #1f4fff;
  --widget-primary-hover: #173ecc;
  --widget-success: #167c45;
  --widget-danger: #c53131;
  --widget-shadow: 0 12px 30px rgba(18, 31, 53, 0.10);
  --widget-radius-lg: 20px;
  --widget-radius-md: 14px;
}

body {
  margin: 0;
  background: var(--widget-bg);
  color: var(--widget-text);
  font-family: Arial, Helvetica, sans-serif;
}

.wine-page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px;
}

.wine-header {
  margin-bottom: 24px;
}

.widget-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.widget-btn:disabled:hover {
  transform: none;
}

.wine-kicker {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--widget-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wine-title {
  margin: 0 0 10px;
  font-size: 32px;
  line-height: 1.15;
}

.wine-intro {
  margin: 0;
  max-width: 760px;
  color: var(--widget-muted);
  line-height: 1.6;
}

.wine-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 24px;
  align-items: start;
  margin-top: 28px;
}

.widget-card {
  background: var(--widget-surface);
  border: 1px solid var(--widget-line);
  border-radius: var(--widget-radius-lg);
  box-shadow: var(--widget-shadow);
}

.widget-product-card {
  overflow: hidden;
}

.widget-product-media {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(31,79,255,0.10), rgba(31,79,255,0.02)),
    linear-gradient(180deg, #f0f4fb, #e7edf7);
}

.widget-bottle {
  position: relative;
  width: 90px;
  height: 210px;
  border-radius: 28px 28px 20px 20px;
  background: linear-gradient(180deg, #6c1422 0%, #481018 100%);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,0.08);
  top: 20px;
}

.widget-bottle::before {
  content: "";
  position: absolute;
  top: -38px;
  left: 30px;
  width: 30px;
  height: 46px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #262626 0%, #111 100%);
}

.widget-bottle::after {
  content: "";
  position: absolute;
  top: 66px;
  left: 12px;
  right: 12px;
  height: 52px;
  border-radius: 10px;
  background: rgba(255,255,255,0.88);
}

.widget-product-body {
  padding: 24px;
}

.widget-product-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  margin-bottom: 14px;
  background: #eef3ff;
  color: var(--widget-primary);
  font-size: 13px;
  font-weight: 700;
}

.widget-product-title {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.2;
}

.widget-product-copy {
  margin: 0 0 18px;
  color: var(--widget-muted);
  line-height: 1.65;
}

.widget-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.widget-meta-pill {
  padding: 10px 12px;
  border: 1px solid var(--widget-line);
  border-radius: 999px;
  background: var(--widget-surface-soft);
  font-size: 14px;
}

.widget-price-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--widget-line);
}

.widget-price-wrap small {
  display: block;
  margin-bottom: 4px;
  color: var(--widget-muted);
  font-size: 13px;
}

.widget-price {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.widget-checkout-card {
  padding: 22px;
}

.widget-checkout-title {
  margin: 0 0 8px;
  font-size: 24px;
}

.widget-checkout-copy {
  margin: 0 0 18px;
  color: var(--widget-muted);
  line-height: 1.6;
}

.widget-paybox {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.widget-paybox {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.widget-paybox.is-disabled {
  opacity: 0.6;
}

.widget-pay-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--widget-line);
  border-radius: var(--widget-radius-md);
  background: var(--widget-surface-soft);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.widget-pay-option strong {
  font-size: 15px;
}

.widget-pay-option span {
  color: var(--widget-muted);
  font-size: 14px;
}

.widget-pay-option.is-passive {
  background: var(--widget-surface-soft);
  border-color: var(--widget-line);
}

.widget-pay-option.is-active {
  background: #eef3ff;
  border-color: var(--widget-primary);
}

.widget-pay-option.is-active .widget-pay-state {
  color: var(--widget-primary);
  font-weight: 700;
}

.widget-pay-option:disabled {
  cursor: not-allowed;
}

.widget-pay-option:disabled:hover {
  transform: none;
}

.widget-pay-state {
  white-space: nowrap;
}

.widget-pay-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--widget-line);
  border-radius: var(--widget-radius-md);
  background: var(--widget-surface-soft);
}

.widget-pay-option strong {
  font-size: 15px;
}

.widget-pay-option span {
  color: var(--widget-muted);
  font-size: 14px;
}

.ixs-accept-widget {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #cfdafd;
  border-radius: var(--widget-radius-md);
  background: linear-gradient(180deg, #f7f9ff 0%, #f2f6ff 100%);
}

.ixs-accept-widget-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.ixs-accept-widget-title {
  margin: 0 0 6px;
  font-size: 20px;
}

.ixs-accept-widget-copy {
  margin: 0;
  color: var(--widget-muted);
  line-height: 1.55;
  font-size: 15px;
}

.ixs-accept-widget-state {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e8efff;
  color: var(--widget-primary);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ixs-accept-widget-state.is-pending {
  background: #eef2f7;
  color: #5f6b85;
}

.ixs-accept-widget-state.is-success {
  background: #eaf8ef;
  color: #167c45;
}

.ixs-accept-widget-state.is-error {
  background: #fff1f1;
  color: #c53131;
}

.ixs-accept-widget-actions {
  margin-top: 14px;
}

.widget-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.widget-btn {
  appearance: none;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.widget-btn:hover {
  transform: translateY(-1px);
}

.widget-btn:active {
  transform: translateY(0);
}

.widget-btn-primary {
  background: var(--widget-primary);
  color: #fff;
}

.widget-btn-primary:hover {
  background: var(--widget-primary-hover);
}

.widget-btn-secondary {
  background: #e9eefc;
  color: #17306f;
}

.widget-btn-ghost {
    background: transparent;
    color: var(--widget-primary);
    border: 1px solid #cfdafd;
    font-size: 14px;
    padding: 6px 6px;
    min-height: 0;
    margin: 10px 0 0 10px;
}

.widget-checkout-final {
  margin-top: 18px;
  width: 100%;
}

.ixs-accept-widget-note {
  margin-top: 12px;
  color: var(--widget-muted);
  font-size: 13px;
  line-height: 1.5;
}

.ixs-accept-widget-result {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
}

.ixs-accept-widget-result.is-visible {
  display: block;
}

.ixs-accept-widget-result.is-success {
  background: #edf9f1;
  border-color: #bfe4cb;
  color: var(--widget-success);
}

.ixs-accept-widget-result.is-error {
  background: #fff1f1;
  border-color: #f0c7c7;
  color: var(--widget-danger);
}

.widget-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
  overflow-y: auto;
  background: rgba(12, 19, 34, 0.52);
}

.widget-overlay.is-open {
  display: flex;
}

.widget-modal {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--widget-surface);
  border: 1px solid var(--widget-line);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(11, 20, 39, 0.28);
  overflow: hidden;
}

.widget-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--widget-line);
}

.widget-modal-title {
  margin: 0 0 6px;
  font-size: 24px;
}

.widget-modal-copy {
  margin: 0;
  color: var(--widget-muted);
  line-height: 1.55;
}

.widget-modal-close {
  appearance: none;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #eef2fb;
  color: var(--widget-text);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.widget-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 22px;
}

.widget-choice-grid {
  display: grid;
  gap: 14px;
}

.widget-choice-card {
  padding: 16px;
  border: 1px solid var(--widget-line);
  border-radius: 16px;
  background: var(--widget-surface-soft);
}

.widget-choice-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.widget-choice-card p {
  margin: 14px 0 14px 0;
  color: var(--widget-muted);
  line-height: 1.55;
  font-size: 14px;
}

.widget-auth-form {
  display: none;
  margin-top: 10px;
  gap: 12px;
}

.widget-auth-form.is-visible {
  display: grid;
}

.widget-field {
  display: grid;
  gap: 6px;
}

.widget-field label {
  font-size: 14px;
  font-weight: 700;
}

.widget-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--widget-line);
  border-radius: 12px;
  background: #fff;
  color: var(--widget-text);
  font-size: 15px;
}

.widget-field input:focus {
  outline: 2px solid rgba(31,79,255,0.16);
  border-color: var(--widget-primary);
}

.widget-inline-note {
  margin: 0;
  color: var(--widget-muted);
  font-size: 13px;
  line-height: 1.5;
}

.widget-modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 22px 22px;
}

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

@media (max-width: 640px) {
  .wine-page {
    padding: 20px 14px;
  }

  .wine-title {
    font-size: 28px;
  }

  .widget-product-title {
    font-size: 24px;
  }

  .widget-price {
    font-size: 30px;
  }

  .widget-price-row,
  .widget-modal-footer,
  .ixs-accept-widget-head {
    flex-direction: column;
    align-items: stretch;
  }

  .widget-button-row {
    flex-direction: column;
  }

  .widget-btn {
    width: 100%;
  }

  .widget-overlay {
    padding: 12px;
    align-items: flex-start;
  }

  .widget-modal {
    max-height: calc(100vh - 24px);
    margin: 0 auto;
  }
}
