:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --accent: #10b981;
  --accent-light: #d1fae5;
  --dark: #0f172a;
  --dark-light: #1e293b;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg-card: #ffffff;
  --bg-app: #f8fafc;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(15,23,42,0.1), 0 8px 10px -6px rgba(15,23,42,0.05);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 90px; /* Space for mobile sticky footer */
}

/* Header & Hero */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0369a1 100%);
  color: #ffffff;
  padding: 48px 20px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 80% 20%, rgba(2, 132, 199, 0.25) 0%, transparent 60%);
  pointer-events: none;
}

.hero-container {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #38bdf8;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  margin-bottom: 16px;
  letter-spacing: 0.3px;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: #cbd5e1;
  max-width: 620px;
  margin: 0 auto;
}

/* Main Container */
.calculator-wrapper {
  max-width: 1240px;
  margin: -24px auto 40px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  position: relative;
  z-index: 2;
}

@media (max-width: 1024px) {
  .calculator-wrapper {
    grid-template-columns: 1fr;
  }
}

/* Tabs */
.category-tabs {
  display: flex;
  background: #ffffff;
  padding: 6px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  border: 1px solid var(--border);
  gap: 8px;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.tab-icon {
  font-size: 1.3rem;
}

/* Section Cards */
.calc-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
  transition: var(--transition);
}

.calc-card:hover {
  box-shadow: var(--shadow-md);
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Step 1: Base Items Cards Grid */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.item-card {
  position: relative;
  background: #ffffff;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.item-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: var(--shadow-md);
}

.item-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.item-img-container {
  height: 155px;
  overflow: hidden;
  position: relative;
  background: #0f172a;
}

.item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.item-card:hover .item-img {
  transform: scale(1.05);
}

.item-price-pill {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  z-index: 2;
  letter-spacing: -0.01em;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.item-check-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  color: transparent;
  border: 2px solid #cbd5e1;
  transition: var(--transition);
  z-index: 2;
}

.item-card.active .item-check-badge {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.item-content {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.item-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--dark);
  margin-bottom: 4px;
}

.item-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  flex: 1;
}

.item-price-tag {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

/* Slider Section */
.slider-container, .slider-box {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 22px;
  border: 1.5px solid var(--border);
}

.slider-header, .slider-header-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 16px !important;
  gap: 12px;
}

.slider-label, .slider-title-text {
  font-weight: 700;
  font-size: 1rem;
  color: var(--dark);
}

.slider-value-badge, .slider-badge-val {
  background: var(--primary) !important;
  color: #ffffff !important;
  padding: 6px 14px !important;
  border-radius: 9999px !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25) !important;
  white-space: nowrap !important;
}

.range-slider, .calc-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100% !important;
  display: block !important;
  height: 8px;
  border-radius: 999px;
  background: #cbd5e1;
  outline: none;
  cursor: pointer;
  margin: 14px 0 10px 0;
  transition: var(--transition);
}

.range-slider::-webkit-slider-thumb, .calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.15s ease;
}

.range-slider::-moz-range-thumb, .calc-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.range-slider::-webkit-slider-thumb:hover, .calc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Radio Buttons Group */
.radio-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.radio-card {
  position: relative;
  background: #ffffff;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.radio-card:hover {
  border-color: #93c5fd;
}

.radio-card.active {
  border-color: var(--primary);
  background: #f0f9ff;
}

.radio-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.radio-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--dark);
}

.radio-multiplier-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: #e2e8f0;
  color: var(--text-muted);
}

.radio-card.active .radio-multiplier-badge {
  background: var(--primary-light);
  color: var(--primary);
}

.radio-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Addons Checkbox List */
.addons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.addon-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.addon-card:hover {
  border-color: #93c5fd;
}

.addon-card.active {
  border-color: var(--accent);
  background: #f0fdf4;
}

.addon-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  flex-shrink: 0;
  transition: var(--transition);
  color: transparent;
  font-size: 12px;
  font-weight: 800;
}

.addon-card.active .addon-checkbox {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.addon-info {
  flex: 1;
}

.addon-header-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.addon-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--dark);
}

.addon-popular-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #b45309;
  background: #fef3c7;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

.addon-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.addon-price {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Sidebar Summary */
.summary-sidebar {
  position: sticky;
  top: 24px;
  height: fit-content;
}

.summary-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  padding: 26px;
}

.summary-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--border);
  max-height: 260px;
  overflow-y: auto;
}

.summary-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

.summary-item-name {
  color: var(--text-main);
  max-width: 65%;
  word-break: break-word;
}

.summary-item-cost {
  font-weight: 600;
  color: var(--dark);
}

/* Price Box */
.price-display-box {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  text-align: center;
}

.discount-promo-pill {
  display: inline-block;
  background: var(--accent-light);
  color: #065f46;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  margin-bottom: 8px;
}

.old-price-line {
  font-size: 0.95rem;
  color: #94a3b8;
  text-decoration: line-through;
  margin-bottom: 2px;
}

.current-price {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.cta-order-btn {
  width: 100%;
  background: var(--accent);
  color: #ffffff;
  border: none;
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.cta-order-btn:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

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

.guarantee-note {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Mobile Sticky Bar */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  padding: 12px 18px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  border-top: 1px solid var(--border);
  z-index: 99;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 1024px) {
  .mobile-bottom-bar {
    display: flex;
  }
}

.mobile-price-group {
  display: flex;
  flex-direction: column;
}

.mobile-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mobile-amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--dark);
}

.mobile-cta-btn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

/* Modal Window */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(5px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 30px;
  box-shadow: var(--shadow-xl);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.open .modal-content {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: var(--dark);
}

.modal-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
}

.modal-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.modal-receipt-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 20px;
  font-size: 0.88rem;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--text-main);
}

.receipt-row.total-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--dark);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.modal-submit-btn {
  width: 100%;
  background: var(--accent);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.modal-submit-btn:hover {
  background: #059669;
}

/* Success View in Modal */
.success-view {
  display: none;
  text-align: center;
  padding: 20px 0;
}

.success-icon-bubble {
  width: 64px;
  height: 64px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
}

.success-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 8px;
}

.success-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}


/* ==============================================================================
   ДОДАТКОВІ СТИЛІ: НІШЕВИЙ ПЕРЕМИКАЧ, СПІНЕРИ, ПОМИЛКИ ТА ДЕМО-РЕЖИМ
   ============================================================================== */

/* Top Niche Switcher Bar */
.niche-bar {
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 16px;
  position: relative;
  z-index: 10;
}

.niche-selector-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.niche-label {
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
}

.niche-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.niche-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.niche-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

.niche-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.4);
}

/* Consent Checkbox */
.consent-group {
  margin-top: 14px;
  margin-bottom: 16px;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  cursor: pointer;
}

.consent-label input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}

.consent-label a {
  color: var(--primary);
  text-decoration: underline;
}

/* Modal Error Alert */
.modal-error-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  line-height: 1.4;
}

/* Submit Button Loading Spinner */
.modal-submit-btn.loading {
  background: #64748b !important;
  cursor: not-allowed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Demo Notice View */
.demo-notice-view {
  text-align: center;
  padding: 16px 0;
}

.demo-icon-bubble {
  width: 56px;
  height: 56px;
  background: #fef3c7;
  color: #d97706;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 14px;
}

.demo-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #b45309;
  margin-bottom: 8px;
}

.demo-desc {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 16px;
}

.demo-summary-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.85rem;
  text-align: left;
  line-height: 1.6;
  margin-bottom: 16px;
}

.demo-instruction-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 20px;
}
