/* ==========================================================================
   SOLARMART PRO ENGINEERING CALCULATOR — DAYLIGHT STUDIO UX
   ========================================================================== */
.sm-pro-calc-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 14px 40px -10px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  padding: 28px 30px;
  margin: 24px 0 36px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  color: #0f172a;
  position: relative;
  overflow: hidden;
}
.sm-pro-calc-wrap::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, #f59e0b 0%, #ea580c 45%, #0284c7 100%);
}
.sm-calc-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
}
.sm-calc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.sm-calc-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
  line-height: 1.25;
}
.sm-calc-subtitle {
  font-size: 14px;
  color: #475569;
  margin: 0;
  max-width: 760px;
  line-height: 1.5;
}
.sm-calc-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.sm-preset-btn {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sm-preset-btn:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
  transform: translateY(-1px);
}
.sm-preset-btn.active {
  background: #fffbeb;
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.14);
}
.sm-preset-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
}
.sm-preset-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #334155;
}
.sm-preset-btn.active .sm-preset-tag {
  background: #f59e0b;
  color: #ffffff;
}
.sm-preset-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

/* Main 2-column grid */
.sm-calc-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 26px;
  align-items: start;
}
.sm-calc-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
}
.sm-sec-label {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #334155;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sm-sec-label span.sm-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  margin-right: 8px;
}

/* Appliance Matrix */
.sm-appliances-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.sm-app-chip {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.15s ease;
  user-select: none;
}
.sm-app-chip:hover {
  border-color: #94a3b8;
}
.sm-app-chip.active {
  background: #f0f9ff;
  border-color: #0284c7;
}
.sm-app-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sm-app-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  flex-shrink: 0;
  background: #fff;
}
.sm-app-chip.active .sm-app-check {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}
.sm-app-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-app-watts {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.sm-app-chip.active .sm-app-watts {
  background: #e0f2fe;
  color: #0369a1;
}

/* Sliders & Controls */
.sm-control-group {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.sm-control-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.sm-control-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}
.sm-control-val {
  font-size: 15px;
  font-weight: 800;
  color: #0284c7;
  background: #f0f9ff;
  padding: 3px 10px;
  border-radius: 8px;
  border: 1px solid #bae6fd;
}
.sm-range-input {
  width: 100%;
  accent-color: #0284c7;
  height: 6px;
  cursor: pointer;
}
.sm-range-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

/* Segmented buttons */
.sm-seg-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.sm-seg-row.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.sm-seg-btn {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.sm-seg-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* Solar PV Subpanel */
.sm-pv-box {
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
  border: 1.5px solid #fcd34d;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 12px;
}
.sm-pv-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.sm-pv-stat {
  background: #ffffff;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}
.sm-pv-stat-val {
  font-size: 14px;
  font-weight: 800;
  color: #b45309;
}
.sm-pv-stat-lbl {
  font-size: 10.5px;
  color: #64748b;
  margin-top: 2px;
}

/* Monthly Generation Chart */
.sm-month-chart {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 5px;
  align-items: end;
  height: 76px;
  margin-top: 14px;
  padding: 10px 8px 4px 8px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
}
.sm-m-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.sm-m-bar {
  width: 100%;
  background: linear-gradient(180deg, #f59e0b 0%, #fbbf24 100%);
  border-radius: 4px 4px 0 0;
  transition: height 0.25s ease;
  min-height: 4px;
}
.sm-m-lbl {
  font-size: 9.5px;
  font-weight: 700;
  color: #64748b;
  margin-top: 4px;
}

/* Right Column: Engineering Blueprint & Bundle Result */
.sm-result-card {
  background: #ffffff;
  border: 2px solid #0f172a;
  border-radius: 16px;
  padding: 20px;
  position: relative;
}
.sm-blueprint-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.sm-kpi-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  padding: 11px 12px;
}
.sm-kpi-lbl {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}
.sm-kpi-val {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 3px;
}
.sm-kpi-sub {
  font-size: 11px;
  color: #0284c7;
  font-weight: 600;
  margin-top: 2px;
}

/* Engineering Wiring & Safety Spec Strip */
.sm-wiring-strip {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 11px;
  padding: 11px 14px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 14px;
  font-size: 12px;
}
.sm-wire-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #bae6fd;
  padding-bottom: 4px;
}
.sm-wire-item span:first-child {
  color: #475569;
}
.sm-wire-item strong {
  color: #0369a1;
  font-weight: 700;
}

/* Recommended Bundle Items */
.sm-bundle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.sm-bundle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
}
.sm-bi-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.sm-bi-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px;
  flex-shrink: 0;
}
.sm-bi-role {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: #0284c7;
  letter-spacing: 0.03em;
}
.sm-bi-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  display: block;
  line-height: 1.3;
  margin: 2px 0;
}
.sm-bi-title:hover {
  color: #0284c7;
  text-decoration: underline;
}
.sm-bi-meta {
  font-size: 11.5px;
  color: #64748b;
}
.sm-bi-right {
  text-align: right;
  flex-shrink: 0;
}
.sm-bi-qty-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 2px 6px;
  margin-bottom: 4px;
}
.sm-qty-btn {
  background: none;
  border: none;
  font-weight: 800;
  font-size: 13px;
  color: #0f172a;
  cursor: pointer;
  padding: 0 4px;
}
.sm-qty-num {
  font-size: 12px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}
.sm-bi-price {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  display: block;
}

/* Total & CTA Footer */
.sm-total-bar {
  background: #0f172a;
  color: #ffffff;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.sm-total-lbl {
  font-size: 12px;
  color: #94a3b8;
  display: block;
}
.sm-total-val {
  font-size: 22px;
  font-weight: 800;
  color: #fbbf24;
}
.sm-cta-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}
.sm-btn-buy-bundle {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  border: none;
  border-radius: 11px;
  padding: 13px 18px;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.25);
  transition: all 0.2s ease;
}
.sm-btn-buy-bundle:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(234, 88, 12, 0.35);
}
.sm-btn-chat-spec {
  background: #f8fafc;
  color: #0f172a;
  border: 1.5px solid #cbd5e1;
  border-radius: 11px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}
.sm-btn-chat-spec:hover {
  background: #f1f5f9;
  border-color: #0f172a;
}

/* Floating Quick-Open Pill on Category & Product Pages */
.sm-floating-calc-trigger {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9990;
  background: #0f172a;
  color: #ffffff !important;
  border: 2px solid #f59e0b;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none !important;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.28);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sm-floating-calc-trigger:hover {
  background: #1e293b;
  transform: translateY(-2px);
}

/* Modal Overlay for Inner Pages */
.sm-calc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(4px);
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.sm-calc-modal-backdrop.open {
  display: flex;
}
.sm-calc-modal-dialog {
  width: 100%;
  max-width: 1220px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  border-radius: 20px;
}
.sm-calc-modal-dialog .sm-pro-calc-wrap {
  margin: 0;
}
.sm-calc-modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 20;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sm-calc-modal-close:hover {
  background: #e2e8f0;
}

@media (max-width: 991px) {
  .sm-calc-presets {
    grid-template-columns: repeat(2, 1fr);
  }
  .sm-calc-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 576px) {
  .sm-pro-calc-wrap {
    padding: 18px 14px;
  }
  .sm-calc-presets,
  .sm-appliances-grid,
  .sm-wiring-strip {
    grid-template-columns: 1fr;
  }
  .sm-pv-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .sm-blueprint-kpis {
    grid-template-columns: 1fr;
  }
  .sm-floating-calc-trigger {
    bottom: 78px;
    left: 12px;
    padding: 8px 14px;
    font-size: 12px;
  }
}
