/* Reeves Gondola Builder CSS - Refactor Phase 2
   Focused CSS modules are imported in cascade order.
   Legacy backup: assets/css/legacy/builder.pre-css-refactor.backup.css */

@import url('./builder/builder-tokens.css');
@import url('./builder/builder-shell-core.css');
@import url('./builder/builder-cards-core.css');
@import url('./builder/builder-visualization-core.css');
@import url('./builder/builder-quote-core.css');
@import url('./builder/builder-responsive.css');
@import url('./builder/builder-layout-modern.css');
@import url('./builder/builder-shell-fixed.css');
@import url('./builder/builder-visualization-sticky.css');
@import url('./builder/builder-visualization-sticky-refine.css');
@import url('./builder/builder-header-fixed.css');
@import url('./builder/builder-framework.css');
@import url('./builder/builder-quote.css');
@import url('./builder/builder-edit-mode.css');
@import url('./builder/builder-contact-sticky.css');
@import url('./builder/builder-contact-panel.css');
@import url('./builder/builder-contact-alert.css');
@import url('./builder/builder-help-popover.css');
@import url('./builder/builder-theme-dark-red.css');
@import url('./builder/builder-red-band.css');
@import url('./builder/builder-header-compact.css');
@import url('./builder/builder-sidebar-branding.css');
@import url('./builder/builder-visualization-assets.css');
@import url('./builder/builder-visualization-containment.css');
@import url('./builder/builder-visualization-final.css');

/* Step workflow fixes */
body.step-1-active #nextBtn {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.top-step.disabled,
.side-step.disabled {
  opacity: 0.42 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Step 1 layout cleanup */
body.step-1-active .builder-content-panel .content-panel-actions {
  display: none !important;
}

body.step-1-active .builder-content-panel .step[data-step="0"] {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

body.step-1-active .builder-content-panel .step[data-step="0"] h2 {
  margin-top: 0 !important;
}

/* Step 5 fixed contact panel / scrollable quote review */
@media (min-width:1101px){
  body.quote-step-active .builder-main-grid{
    align-items:start!important;
  }

  body.quote-step-active .builder-content-column{
    min-height:0!important;
    overflow:visible!important;
  }

  body.quote-step-active .quote-dashboard,
  body.quote-step-active .quote-workspace{
    min-height:0!important;
    overflow:visible!important;
  }

  body.quote-step-active .quote-review-layout{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 380px!important;
    gap:18px!important;
    align-items:start!important;
    height:calc(100vh - var(--fixed-header-offset, 168px) - 26px)!important;
    min-height:0!important;
    overflow:hidden!important;
  }

  body.quote-step-active .quote-review-left{
    min-height:0!important;
    max-height:100%!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    padding-right:10px!important;
    overscroll-behavior:contain!important;
  }

  body.quote-step-active .quote-review-right{
    align-self:start!important;
    position:sticky!important;
    top:0!important;
    height:max-content!important;
    max-height:100%!important;
    overflow:visible!important;
    z-index:20!important;
  }

  body.quote-step-active .quote-review-right .contact-card-modern{
    position:static!important;
    top:auto!important;
    margin-top:0!important;
    max-height:calc(100vh - var(--fixed-header-offset, 168px) - 32px)!important;
    overflow-y:auto!important;
  }
}


/* Step 5 layout correction:
   - No visible internal scrollbar in the quote/content panel.
   - Contact form sits directly under the fixed step navigation.
   - Quote review uses normal page scrolling like Steps 2/3/4 behavior.
*/
@media (min-width:1101px){
  body.quote-step-active .builder-main-grid{
    align-items:start!important;
    overflow:visible!important;
  }

  body.quote-step-active .builder-content-column,
  body.quote-step-active .quote-dashboard,
  body.quote-step-active .quote-workspace,
  body.quote-step-active .quote-review-layout,
  body.quote-step-active .quote-review-left{
    height:auto!important;
    max-height:none!important;
    min-height:0!important;
    overflow:visible!important;
  }

  body.quote-step-active .quote-review-layout{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 380px!important;
    gap:18px!important;
    align-items:start!important;
  }

  body.quote-step-active .quote-review-left{
    padding-right:0!important;
    overflow-y:visible!important;
    overflow-x:visible!important;
  }

  body.quote-step-active .quote-review-right{
    align-self:start!important;
    position:sticky!important;
    top:calc(var(--fixed-header-offset, 168px) + 0px)!important;
    height:max-content!important;
    max-height:none!important;
    overflow:visible!important;
    z-index:80!important;
  }

  body.quote-step-active .quote-review-right .contact-card-modern{
    position:static!important;
    top:auto!important;
    margin-top:0!important;
    max-height:none!important;
    overflow:visible!important;
  }
}


/* Step 5 final fixed form panel alignment
   Matches Steps 2-4 behavior: the right panel starts immediately below
   the fixed step navigation and stays fixed while page content scrolls. */
@media (min-width:1101px){
  body.quote-step-active .builder-workspace{
    padding-top:190px!important;
  }

  body.quote-step-active .builder-main-grid{
    position:relative!important;
    display:block!important;
    overflow:visible!important;
  }

  body.quote-step-active .builder-content-column{
    display:block!important;
    width:calc(100% - 410px)!important;
    max-width:calc(100% - 410px)!important;
    overflow:visible!important;
    min-height:0!important;
  }

  body.quote-step-active .quote-dashboard,
  body.quote-step-active .quote-workspace,
  body.quote-step-active .quote-review-layout,
  body.quote-step-active .quote-review-left{
    display:block!important;
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    min-height:0!important;
  }

  body.quote-step-active .quote-review-left{
    padding-right:0!important;
  }

  body.quote-step-active .quote-review-right{
    position:fixed!important;
    top:190px!important;
    right:28px!important;
    width:380px!important;
    height:auto!important;
    max-height:calc(100vh - 214px)!important;
    overflow:visible!important;
    z-index:210!important;
    margin:0!important;
    padding:0!important;
  }

  body.sidebar-collapsed.quote-step-active .quote-review-right{
    right:28px!important;
  }

  body.quote-step-active .quote-review-right .contact-card-modern{
    position:static!important;
    top:auto!important;
    margin:0!important;
    max-height:calc(100vh - 214px)!important;
    overflow-y:auto!important;
  }

  body.quote-step-active .quote-review-intro{
    margin-top:0!important;
    padding-top:0!important;
  }
}

@media (max-width:1100px){
  body.quote-step-active .builder-content-column{
    width:100%!important;
    max-width:100%!important;
  }
  body.quote-step-active .quote-review-right{
    position:static!important;
    width:auto!important;
    max-height:none!important;
  }
}

/* Cleanup: remove visualization legend and tax display */
.visual-card .legend,
.legend {
  display: none !important;
}

/* Remove colored section bars beneath visualization */
.section-bar,
.visual-section-bar,
.measurement-bar,
.length-color-bar {
  display: none !important;
}

/* Step 5 current run action swap */
.current-run-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.current-run-actions button{
  width:100%;
}

/* Step 5 current run button location */
.current-run-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.current-run-actions button{
  width:100%;
}
.quote-total-card #createNewRunBtn{
  display:none!important;
}

/* Step 5 current run button swap */
.current-run-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.current-run-actions button{
  width:100%;
}
.quote-total-card #createNewRunBtn{
  display:none!important;
}

/* Step 5 runtime button relocation guard */
.current-run-card .current-run-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.current-run-card .current-run-actions button{
  width:100%;
}
.quote-total-card > #createNewRunBtn,
.quote-total-card #createNewRunBtn{
  display:none!important;
}

/* Current Run Items four-column table + edit/save button states */
.current-run-actions #saveRunChangesBtn,
.current-run-actions #createNewRunBtn,
.current-run-actions #addCurrentRunBtn{
  width:100%;
}
#parts td.num,
#parts th.num{
  text-align:right;
  white-space:nowrap;
}

/* 20260518-step5-buttons-items-v2: force fresh Step 5 button/items behavior */
.current-run-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.current-run-actions button{
  width:100%;
}
.quote-total-card #createNewRunBtn,
.quote-total-card #saveRunChangesBtn{
  display:none!important;
}
#parts td.num,
#parts th.num,
.quote-run-parts-table td.num,
.quote-run-parts-table th.num{
  text-align:right;
  white-space:nowrap;
}

/* 20260518-fresh-start-add-run-v6: fresh start must show Add This Run To Quote */
.current-run-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.current-run-actions button{
  width:100%;
}
.quote-total-card #createNewRunBtn,
.quote-total-card #saveRunChangesBtn{
  display:none!important;
}

/* 20260519-step5-run-detail-overrun-v1: Step 5 run details and overrun warning */
.quote-run-detail-lines{
  display:flex;
  flex-wrap:wrap;
  gap:4px 10px;
  margin-top:4px;
  color:#475569;
  font-size:12px;
  line-height:1.35;
}
.quote-run-detail-lines span{
  display:inline-flex;
  align-items:center;
}
.quote-run-detail-lines span:not(:last-child)::after{
  content:"•";
  margin-left:10px;
  color:#dc2626;
  font-weight:900;
}
.quote-run-warning{
  display:block;
  margin-top:7px;
  padding:7px 9px;
  border:1px solid #f59e0b;
  border-left:4px solid #f59e0b;
  border-radius:8px;
  background:#fffbeb;
  color:#92400e;
  font-size:12px;
  font-weight:800;
  line-height:1.35;
}



/* 20260519-endcap-overrun-recalc-v2: tighter Step 3 endcap overrun warning/recalculate */
.endcap-overrun-warning{
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  margin:8px 0 0;
  padding:8px 10px;
  border:1px solid #f59e0b;
  border-left:4px solid #f59e0b;
  border-radius:10px;
  background:#fffbeb;
  color:#78350f;
  box-shadow:0 4px 10px rgba(146,64,14,.05);
  overflow:hidden;
}
.endcap-overrun-copy{
  display:block;
  margin:0 0 7px;
  font-size:11px;
  line-height:1.25;
}
.endcap-overrun-copy strong{
  display:inline;
  color:#92400e;
}
.endcap-overrun-copy span{
  display:inline;
}
.endcap-overrun-actions{
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  align-items:center;
  width:100%;
}
.endcap-recalc-btn,
.endcap-proceed-btn{
  min-height:30px;
  padding:0 10px;
  border:0;
  border-radius:8px;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:0;
  cursor:pointer;
  white-space:nowrap;
}
.endcap-recalc-btn{
  width:100%;
  min-width:0;
  background:#dc2626;
  color:#fff;
}
.endcap-proceed-btn{
  background:#111827;
  color:#fff;
}
.endcap-recalc-btn:hover{
  background:#b91c1c;
}
.endcap-proceed-btn:hover{
  background:#374151;
}
@media(max-width:760px){
  .endcap-overrun-actions{
    grid-template-columns:1fr;
  }
  .endcap-proceed-btn{
    width:100%;
  }
}

/* 20260519-endcap-warning-buttons-v3: refined warning button alignment */
.endcap-overrun-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  width:100%!important;
}
.endcap-recalc-btn,
.endcap-proceed-btn{
  width:auto!important;
  min-height:30px!important;
  padding:0 14px!important;
  font-size:11px!important;
  font-weight:700!important;
  letter-spacing:0!important;
  white-space:nowrap!important;
}
.endcap-recalc-btn{
  flex:0 0 auto!important;
  justify-self:start!important;
}
.endcap-proceed-btn{
  flex:0 0 auto!important;
  margin-left:auto!important;
}
@media(max-width:760px){
  .endcap-overrun-actions{
    align-items:stretch!important;
  }
}

/* 20260520-height-admin-overrun-combined-v1: Step 3 endcap overrun warning + height-admin patch */
.endcap-overrun-warning{
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  margin:8px 0 0;
  padding:8px 10px;
  border:1px solid #f59e0b;
  border-left:4px solid #f59e0b;
  border-radius:10px;
  background:#fffbeb;
  color:#78350f;
  box-shadow:0 4px 10px rgba(146,64,14,.05);
  overflow:hidden;
}
.endcap-overrun-copy{
  display:block;
  margin:0 0 7px;
  font-size:11px;
  line-height:1.25;
}
.endcap-overrun-copy strong{
  color:#92400e;
}
.endcap-overrun-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  width:100%;
}
.endcap-recalc-btn,
.endcap-proceed-btn{
  width:auto;
  min-height:30px;
  padding:0 14px;
  border:0;
  border-radius:8px;
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0;
  cursor:pointer;
  white-space:nowrap;
}
.endcap-recalc-btn{
  background:#dc2626;
  color:#fff;
}
.endcap-proceed-btn{
  margin-left:auto;
  background:#111827;
  color:#fff;
}
.endcap-recalc-btn:hover{background:#b91c1c;}
.endcap-proceed-btn:hover{background:#374151;}

/* 20260520-recalc-admin-surcharge-fix-v2: recalc/admin/endcap shelf fixes */
.endcap-overrun-warning.is-recalculated{
  border-color:#22c55e;
  border-left-color:#16a34a;
  background:#f0fdf4;
  color:#14532d;
}
.quote-run-warning{
  display:block;
  margin-top:7px;
  padding:7px 9px;
  border:1px solid #f59e0b;
  border-left:4px solid #f59e0b;
  border-radius:8px;
  background:#fffbeb;
  color:#92400e;
  font-size:12px;
  font-weight:800;
  line-height:1.35;
}
