/* Phase 1: shared Estimate architecture around the preserved Interior estimator. */

.shared-estimate-page {
  --estimate-bg: #050b10;
  --estimate-panel: #08131d;
  --estimate-panel-2: #0b1924;
  --estimate-border: #294052;
  --estimate-text: #f3f7fb;
  --estimate-muted: #9fb1c2;
  min-height: 100%;
  background: var(--estimate-bg);
  color: var(--estimate-text);
  padding: 16px 20px 28px;
}

.estimate-page-header {
  min-height: 76px;
  display: grid;
  grid-template-columns: auto minmax(210px, 1fr) minmax(220px, 1.2fr) auto;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #08131d 0%, #0b1721 100%);
  border: 1px solid var(--estimate-border);
  border-radius: 12px;
}

.estimate-page-header .btn,
.estimate-shared-summary .btn {
  min-height: 42px;
  font-size: 14px;
  font-weight: 750;
}

.estimate-page-brand,
.estimate-page-customer,
.estimate-page-state {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.estimate-page-brand > i,
.estimate-summary-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  color: #ff8a00;
  background: rgba(245, 130, 22, .08);
  border: 1px solid #f58216;
  border-radius: 12px;
  box-shadow: 0 0 18px rgba(245, 130, 22, .08);
}

.estimate-page-brand > i svg,
.estimate-summary-icon svg { width: 23px; height: 23px; }
.estimate-page-brand small,
.estimate-page-customer small,
.estimate-page-state small,
.estimate-scope-hero small,
.estimate-service-card > div > small,
.estimate-shared-summary small {
  display: block;
  color: var(--estimate-muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .02em;
  text-transform: none;
}
.estimate-page-brand h2 { margin: 2px 0 0; font-size: 22px; line-height: 1.1; }
.estimate-page-customer,
.estimate-page-state { display: grid; gap: 2px; padding-left: 16px; border-left: 1px solid #263b4b; }
.estimate-page-customer strong,
.estimate-page-state strong { font-size: 15px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.estimate-page-customer em { color: #a9bac9; font-size: 13px; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.estimate-workflow {
  margin: 12px 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  background: #07111a;
  border: 1px solid var(--estimate-border);
  border-radius: 12px;
}
.estimate-workflow button {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #9eb1c1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 750;
}
.estimate-workflow button:hover { color: #fff; border-color: #40556a; background: #0b1823; }
.estimate-workflow button.active { color: #fff; background: #111b25; border-color: #f58216; box-shadow: inset 3px 0 0 #f58216; }
.estimate-workflow button.complete { color: #43dc91; }
.estimate-workflow button > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
}
.estimate-workflow button > i svg { width: 18px; height: 18px; }

.estimate-shared-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: 14px;
  align-items: start;
}
.estimate-shared-layout > main { min-width: 0; }
.estimate-build-scope,
.shared-estimate-page .painting-packages-workspace,
.shared-estimate-page .painting-checkout-workspace,
.shared-estimate-page .painting-review-workspace {
  padding: 18px;
  background: #07121b;
  border: 1px solid var(--estimate-border);
  border-radius: 12px;
}

.estimate-scope-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #091923, #07131c);
  border: 1px solid #294455;
  border-left: 4px solid #f58216;
  border-radius: 10px;
}
.estimate-scope-hero h2 { margin: 4px 0 6px; color: #fff; font-size: 25px; line-height: 1.15; }
.estimate-scope-hero p { margin: 0; color: #a9bac8; font-size: 14px; line-height: 1.45; }
.estimate-scope-total { flex: 0 0 210px; padding-left: 20px; border-left: 1px solid #2c4252; }
.estimate-scope-total span { display: block; color: #a9bac8; font-size: 12px; font-weight: 750; }
.estimate-scope-total strong { display: block; margin: 2px 0; color: #ff8a00; font-size: 28px; }
.estimate-scope-total small { color: #b9c7d2; font-size: 12px; }

.estimate-service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.estimate-service-card {
  --service: #f58216;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 16px;
  padding: 16px;
  background: #08131d;
  border: 1px solid #2b4050;
  border-top: 3px solid var(--service);
  border-radius: 11px;
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
}
.estimate-service-card.cyan { --service: #22d3ee; }
.estimate-service-card.purple { --service: #a970ff; }
.estimate-service-card.is-available { opacity: .88; }
.estimate-service-card:hover { border-color: var(--service); transform: translateY(-1px); }
.estimate-service-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.estimate-service-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--service);
  background: color-mix(in srgb, var(--service) 8%, transparent);
  border: 1px solid var(--service);
  border-radius: 50%;
  box-shadow: 0 0 18px color-mix(in srgb, var(--service) 8%, transparent);
}
.estimate-service-icon svg { width: 24px; height: 24px; }
.estimate-service-status { display: inline-flex; align-items: center; gap: 6px; color: #afbdc9; font-size: 12px; font-weight: 750; }
.estimate-service-status.complete { color: #43dc91; }
.estimate-service-status.in-progress { color: #f6c64b; }
.estimate-service-status svg { width: 16px; height: 16px; }
.estimate-service-card h3 { margin: 5px 0 8px; color: #fff; font-size: 21px; }
.estimate-service-card p { margin: 0; min-height: 60px; color: #a9bac8; font-size: 14px; line-height: 1.45; }
.estimate-service-card > section { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 12px; border-top: 1px solid #253a49; }
.estimate-service-card > section span { min-width: 0; }
.estimate-service-card > section small { display: block; color: #8fa3b4; font-size: 11px; }
.estimate-service-card > section strong { display: block; margin-top: 3px; color: #fff; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.estimate-service-card > button {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  color: #fff;
  background: color-mix(in srgb, var(--service) 12%, #0d1822);
  border: 1px solid var(--service);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}
.estimate-service-card > button:hover { background: var(--service); color: #071018; }
.estimate-service-card > button svg { width: 18px; height: 18px; }

.estimate-scope-footer {
  margin-top: 14px;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 10px 9px 16px;
  background: #08151e;
  border: 1px solid #294052;
  border-radius: 9px;
}
.estimate-scope-footer > span { display: flex; align-items: center; gap: 8px; color: #43dc91; font-size: 13px; font-weight: 700; }
.estimate-scope-footer .primary { min-height: 42px; font-size: 14px; font-weight: 800; }

.estimate-shared-summary {
  position: sticky;
  top: 12px;
  overflow: hidden;
  background: #07131c;
  border: 1px solid #2b4252;
  border-radius: 12px;
}
.estimate-shared-summary > header { display: flex; align-items: center; gap: 11px; padding: 14px; border-bottom: 1px solid #2a4050; }
.estimate-shared-summary h3 { margin: 3px 0 2px; max-width: 175px; color: #fff; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.estimate-shared-summary em { color: #43dc91; font-size: 12px; font-style: normal; }
.estimate-summary-total { padding: 15px; border-bottom: 1px solid #2a4050; border-left: 3px solid #f58216; }
.estimate-summary-total span { display: block; color: #a6b6c3; font-size: 12px; font-weight: 750; }
.estimate-summary-total strong { display: block; margin: 2px 0; color: #ff8a00; font-size: 27px; }
.estimate-summary-services { padding: 13px 15px; border-bottom: 1px solid #2a4050; }
.estimate-summary-services h4 { margin: 0 0 8px; color: #dce6ed; font-size: 13px; }
.estimate-summary-services > div { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 8px; opacity: .58; border-top: 1px solid #1f3342; }
.estimate-summary-services > div.included { opacity: 1; }
.estimate-summary-services > div > span { display: grid; grid-template-columns: 8px 1fr; align-items: center; column-gap: 7px; color: #dce5eb; font-size: 13px; }
.estimate-summary-services > div i { width: 8px; height: 8px; border-radius: 50%; }
.estimate-summary-services > div small { grid-column: 2; font-size: 10px; }
.estimate-summary-services > div strong { color: #fff; font-size: 13px; }
.estimate-summary-deposit { min-height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; color: #c4d0d9; font-size: 13px; }
.estimate-summary-deposit strong { color: #fff; font-size: 16px; }
.estimate-shared-summary > footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; background: #081018; border-top: 1px solid #2a4050; }

/* Shared-level packages, payment, and review keep the same approved foundation. */
.shared-estimate-page .painting-packages-workspace,
.shared-estimate-page .painting-checkout-workspace,
.shared-estimate-page .painting-review-workspace { max-width: none; min-height: 0; }
.shared-estimate-page .painting-packages-hero small,
.shared-estimate-page .painting-checkout-workspace header small,
.shared-estimate-page .painting-review-workspace header small { text-transform: none; }

/* The service module keeps the approved estimator and changes only its outer shell. */
.estimate-service-module { min-height: 100%; background: #050b10; }
.estimate-service-module .pe-layout { height: auto !important; min-height: 100%; overflow: visible !important; }
.estimate-service-module .pe-main { overflow: visible !important; }
.estimate-service-module .painting-project-builder,
.estimate-service-module .painting-module-builder,
.estimate-service-module .painting-module-shell { height: auto !important; max-height: none !important; min-height: 0 !important; overflow: visible !important; }
.estimate-service-module .painting-module-title { grid-template-columns: auto minmax(220px, 1fr); align-items: start; }
.estimate-service-module .painting-module-title > i { color: #f58216; border-color: #f58216; background: rgba(245,130,22,.08); }
.estimate-service-module .estimate-module-shell.exterior .painting-module-title > i { color: #22d3ee; border-color: #22d3ee; background: rgba(34,211,238,.08); }
.estimate-service-module .estimate-module-shell.cabinets .painting-module-title > i { color: #a970ff; border-color: #a970ff; background: rgba(169,112,255,.08); }
.estimate-service-module .painting-module-actions { grid-column: 1 / -1; display: grid; grid-template-columns: .8fr 1fr 1.5fr; gap: 8px; width: 100%; }
.estimate-service-module .painting-module-actions .btn,
.estimate-service-module .painting-module-actions .primary { min-height: 44px; font-size: 13px; font-weight: 800; }
.estimate-service-module .painting-customer-context { font-size: 13px; }
.estimate-service-module .painting-pricing-workspace {
  height: auto !important;
  min-height: 1050px !important;
  align-items: start !important;
  overflow: visible !important;
}
.estimate-service-module .painting-pricing-workspace > .paint-center {
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: visible !important;
}
.estimate-service-module .painting-pricing-workspace > .paint-rooms {
  height: auto !important;
  min-height: 720px !important;
  overflow: visible !important;
}
.estimate-service-module .painting-reference-room { min-height: 0 !important; }

@media (max-width: 1180px) {
  .estimate-page-header { grid-template-columns: auto 1fr 1fr; }
  .estimate-page-state { display: none; }
  .estimate-shared-layout { grid-template-columns: minmax(0, 1fr); }
  .estimate-shared-summary { position: static; }
  .estimate-service-grid { grid-template-columns: 1fr; }
  .estimate-service-card p { min-height: 0; }
}

@media (max-width: 760px) {
  .shared-estimate-page { padding: 10px; }
  .estimate-page-header { grid-template-columns: 1fr; }
  .estimate-page-customer { border-left: 0; border-top: 1px solid #263b4b; padding: 10px 0 0; }
  .estimate-workflow { grid-template-columns: 1fr 1fr; }
  .estimate-workflow button > i { display: none; }
  .estimate-scope-hero { align-items: flex-start; flex-direction: column; }
  .estimate-scope-total { width: 100%; padding: 12px 0 0; border-left: 0; border-top: 1px solid #2c4252; }
  .estimate-scope-footer { align-items: stretch; flex-direction: column; }
  .estimate-service-module .painting-module-actions { grid-template-columns: 1fr; }
}
