/* CubeGraphiX Pricing & Checkout V4 Styles */

.calc-section {
  padding: 64px 0 88px;
}

.calc-header-intro {
  margin-bottom: 36px;
}

.calc-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 390px);
  gap: 32px;
  align-items: start;
}

.calc-steps-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.calc-step-card {
  background: var(--cgx-surface);
  border: 1px solid var(--cgx-line);
  border-radius: var(--cgx-radius-card);
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.calc-step-header {
  margin-bottom: 18px;
}

.calc-step-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.calc-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--cgx-radius-pill);
  background: var(--cgx-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.calc-step-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--cgx-ink);
  letter-spacing: -0.01em;
}

.calc-step-subtitle {
  font-size: 13px;
  color: var(--cgx-muted);
  line-height: 1.5;
  margin: 0;
}

/* Page Tiers */
.calc-tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.calc-tier-label {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 12px;
  background: var(--cgx-surface-2);
  border: 1px solid var(--cgx-line-soft);
  border-radius: var(--cgx-radius-control);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-height: 78px;
}

.calc-tier-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.calc-tier-label:hover {
  border-color: var(--cgx-line);
  background: color-mix(in srgb, var(--cgx-surface-2) 90%, var(--cgx-accent) 10%);
}

.calc-tier-label.is-selected {
  border-color: var(--cgx-accent);
  background: color-mix(in srgb, var(--cgx-surface-2) 80%, var(--cgx-accent) 20%);
  box-shadow: 0 0 0 1px var(--cgx-accent);
}

.calc-tier-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cgx-ink);
  margin-bottom: 6px;
}

.calc-tier-rate {
  font-size: 12px;
  font-weight: 700;
  color: var(--cgx-accent-soft);
}

.calc-tier-label.is-selected .calc-tier-rate {
  color: var(--cgx-accent);
}

/* Base Inclusions List */
.calc-inclusions-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.calc-inclusion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--cgx-surface-2);
  border: 1px solid var(--cgx-line-soft);
  border-radius: var(--cgx-radius-control);
}

.calc-inclusion-text-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--cgx-ink);
  font-weight: 500;
}

.calc-check-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.calc-tag-free {
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: var(--cgx-radius-pill);
  white-space: nowrap;
}

/* Add-ons List */
.calc-addons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.calc-addon-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--cgx-surface-2);
  border: 1px solid var(--cgx-line-soft);
  border-radius: var(--cgx-radius-control);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.calc-addon-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.calc-addon-label:hover {
  border-color: var(--cgx-line);
}

.calc-addon-label.is-selected {
  border-color: var(--cgx-accent);
  background: color-mix(in srgb, var(--cgx-surface-2) 85%, var(--cgx-accent) 15%);
}

.calc-addon-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.calc-custom-checkbox {
  width: 18px;
  height: 18px;
  border: 1px solid var(--cgx-line);
  border-radius: 4px;
  background: var(--cgx-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.calc-addon-label.is-selected .calc-custom-checkbox {
  background: var(--cgx-accent);
  border-color: var(--cgx-accent);
}

.calc-custom-checkbox svg {
  display: none;
  width: 12px;
  height: 12px;
  stroke: #fff;
}

.calc-addon-label.is-selected .calc-custom-checkbox svg {
  display: block;
}

.calc-addon-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--cgx-ink);
}

.calc-addon-rate {
  font-size: 12px;
  font-weight: 700;
  color: var(--cgx-accent-soft);
  white-space: nowrap;
}

.calc-addon-label.is-selected .calc-addon-rate {
  color: var(--cgx-accent);
}

/* Extra Languages */
.calc-lang-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.calc-lang-pill {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  background: var(--cgx-surface-2);
  border: 1px solid var(--cgx-line-soft);
  border-radius: var(--cgx-radius-control);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.calc-lang-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.calc-lang-pill.is-selected {
  border-color: var(--cgx-accent);
  background: color-mix(in srgb, var(--cgx-surface-2) 85%, var(--cgx-accent) 15%);
}

.calc-lang-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--cgx-ink);
  margin-bottom: 2px;
}

.calc-lang-rate {
  font-size: 11px;
  color: var(--cgx-accent-soft);
  font-weight: 600;
}

/* Custom Quote Note */
.calc-custom-trigger-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--cgx-surface-2);
  border: 1px dashed var(--cgx-line);
  border-radius: var(--cgx-radius-control);
  font-size: 12px;
  color: var(--cgx-muted);
  line-height: 1.6;
}

.calc-custom-trigger-note a {
  color: var(--cgx-accent);
  text-decoration: underline;
  font-weight: 600;
}

/* Sticky Summary Column */
.calc-summary-col {
  position: sticky;
  top: 84px;
  align-self: start;
}

.calc-summary-panel {
  background: var(--cgx-surface);
  border: 1px solid var(--cgx-line);
  border-radius: var(--cgx-radius-card);
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-summary-head-title {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 700;
  color: var(--cgx-ink);
}

.calc-summary-head-sub {
  margin: 0;
  font-size: 11px;
  color: var(--cgx-muted);
  line-height: 1.35;
}

/* Toggle: Monthly vs Pay Once */
.calc-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--cgx-surface-2);
  border: 1px solid var(--cgx-line-soft);
  border-radius: var(--cgx-radius-control);
  padding: 2px;
  gap: 2px;
}

.calc-mode-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 5px 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--cgx-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.calc-mode-btn.is-active {
  background: var(--cgx-accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(255, 106, 22, 0.3);
}

.calc-mode-save-badge {
  font-size: 9px;
  background: #10b981;
  color: #fff;
  padding: 1px 4px;
  border-radius: 999px;
  font-weight: 700;
}

.calc-mode-btn.is-active .calc-mode-save-badge {
  background: #fff;
  color: var(--cgx-accent);
}

/* Spotlight Price */
.calc-price-spotlight {
  background: var(--cgx-surface-2);
  border: 1px solid var(--cgx-line-soft);
  border-radius: var(--cgx-radius-control);
  padding: 8px 10px;
  text-align: center;
}

.calc-spotlight-top {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 1px;
}

.calc-spotlight-amount {
  font-size: 24px;
  font-weight: 800;
  color: var(--cgx-ink);
  letter-spacing: -0.02em;
  line-height: 1;
}

.calc-spotlight-cadence {
  font-size: 11.5px;
  color: var(--cgx-muted);
  font-weight: 600;
}

.calc-spotlight-meta {
  font-size: 10.5px;
  color: var(--cgx-muted);
  margin-top: 1px;
}

.calc-spotlight-savings {
  display: inline-block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 1px 6px;
  border-radius: var(--cgx-radius-pill);
}

/* Breakdown List */
.calc-breakdown-box {
  border-top: 1px solid var(--cgx-line-soft);
  border-bottom: 1px solid var(--cgx-line-soft);
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.calc-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--cgx-muted);
}

.calc-breakdown-row.is-total {
  font-weight: 700;
  color: var(--cgx-ink);
  font-size: 11.5px;
  padding-top: 2px;
  border-top: 1px dashed var(--cgx-line-soft);
}

/* Terms Checkbox */
.calc-terms-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--cgx-muted);
}

.calc-terms-wrap input {
  margin-top: 1px;
  accent-color: var(--cgx-accent);
  cursor: pointer;
}

.calc-terms-link {
  color: var(--cgx-accent);
  text-decoration: underline;
  font-weight: 600;
  transition: opacity 0.15s ease;
}

.calc-terms-link:hover {
  opacity: 0.85;
}

/* Payment Button */
.calc-checkout-action {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calc-pay-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--cgx-accent);
  color: #fff;
  border: none;
  border-radius: var(--cgx-radius-control);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 10px rgba(255, 106, 22, 0.25);
}

.calc-pay-button:hover:not(:disabled) {
  background: var(--cgx-accent-soft);
  transform: translateY(-1px);
}

.calc-pay-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Feedback Message States */
.calc-feedback-msg {
  padding: 8px 12px;
  border-radius: var(--cgx-radius-control);
  font-size: 11px;
  line-height: 1.4;
  color: var(--cgx-ink);
  display: none;
}

.calc-feedback-msg code {
  font-size: 10.5px;
  background: rgba(0, 0, 0, 0.2);
  padding: 1px 4px;
  border-radius: 3px;
}

.calc-feedback-msg.is-success {
  display: block;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid #10b981;
}

.calc-feedback-msg.is-error {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid #ef4444;
}

.calc-feedback-msg.is-warning {
  display: block;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid #f59e0b;
}

.calc-feedback-msg.is-info {
  display: block;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid #3b82f6;
}

/* Trust Strip */
.calc-trust-strip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px 8px;
  background: var(--cgx-surface-2);
  border: 1px solid var(--cgx-line-soft);
  border-radius: var(--cgx-radius-control);
}

.calc-trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.calc-badge-svg {
  height: 13px;
  opacity: 0.85;
}

.calc-trust-copy {
  font-size: 9.5px;
  line-height: 1.35;
  color: var(--cgx-muted);
  text-align: center;
  margin: 0;
}

/* Social Proof */
.calc-social-proof {
  padding: 5px 8px;
  border-radius: var(--cgx-radius-control);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--cgx-line-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
  font-size: 10px;
  color: var(--cgx-muted);
}

.calc-proof-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.calc-proof-line strong {
  color: var(--cgx-ink);
  font-weight: 700;
}

.calc-proof-sep {
  opacity: 0.4;
}

/* Order Notes & Conditions Section */
.calc-notes-section {
  margin-top: 48px;
  padding: 32px;
  background: var(--cgx-surface);
  border: 1px solid var(--cgx-line);
  border-radius: var(--cgx-radius-card);
}

.calc-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.calc-note-card {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--cgx-muted);
}

.calc-note-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--cgx-ink);
  margin: 0 0 8px;
}

.calc-note-card ul {
  margin: 0;
  padding-inline-start: 18px;
}

/* Mobile Sticky Bottom Drawer */
.calc-mobile-bar {
  display: none;
}

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

  .calc-summary-col {
    position: static;
    top: auto;
  }

  .calc-mobile-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 95;
    background: var(--cgx-surface);
    border-top: 1px solid var(--cgx-line);
    padding: 10px 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .calc-mobile-bar-info {
    display: flex;
    flex-direction: column;
  }

  .calc-mobile-bar-total {
    font-size: 18px;
    font-weight: 800;
    color: var(--cgx-ink);
    line-height: 1.2;
  }

  .calc-mobile-bar-sub {
    font-size: 11px;
    color: var(--cgx-muted);
  }

  .calc-mobile-bar-btn {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    background: var(--cgx-accent);
    color: #fff;
    border: none;
    border-radius: var(--cgx-radius-control);
    cursor: pointer;
    white-space: nowrap;
  }
}

/* RTL Support */
[dir="rtl"] .calc-addon-left,
[dir="rtl"] .calc-inclusion-text-wrap,
[dir="rtl"] .calc-terms-wrap {
  text-align: right;
}

[dir="rtl"] .calc-step-num {
  font-family: var(--cgx-font-sans);
}
