:root {
    --primary-color: #a83535;
    --primary-hover: #9f3c1e;
    --secondary-color: #203950;
    --secondary-hover: #203950;
    --bg-color: #f7f9fa;
    --card-border: #e0e0e0;
    --text-main: #333;
    --text-muted: #777;
    --accent-blue: #ade8f9;
    --accent-green: #2a8e25;
    --error-red: #a83535;
}

#sizing-tool {
    margin-top: 4rem;
}

/* Header & Progress */
.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}
.header h1 {
    color: #000000;
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    display: inline-block;
}
.header strong {
    font-weight: 900;
}
.progress-bar {
    height: 20px;
    background: #e0e0e0;
    width: 100%;
    border-radius: 50px;
    position: relative;
}
.progress-fill {
    height: 100%;
    background: var(--accent-blue);
    width: 33%;
    border-radius: 50px;
    transition: width 0.3s ease;
    position: relative;
}
.progress-fill::after {
    content: '';
    background-image: url(./images/icon-canoe-man.png);
    background-size: contain;
    background-repeat: no-repeat;
    width: 50px;
    height: 20px;
    position: absolute;
    top: 0;
    right: 5px;

}
.step-indicator {
    position: absolute;
    right: 0;
    top: 25px;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: bold;
}

/* Cards */
.card {
    border: 2px solid var(--card-border);
    border-radius: 10px;
    padding: 10px 20px;
    transition: all 0.2s ease;
    position: relative;
    background: #fff;
    box-sizing: border-box;
    box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2);
    opacity: 0.75;
}
.card:hover {
    opacity: 1;
}
.card.selected {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 1px var(--accent-green);
    opacity: 1;
}

/* Steps */
.step { display: none; animation: fadeIn 0.4s ease; }
.step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.step-title {
    text-align: center;
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: 30px;
    font-weight: 700;
}

.step-card {
    max-width: 800px;
    margin: 0 auto 20px auto;
    display: flex;
    gap: 20px;
    opacity: 1;
}

.step-card.card-wider {
    max-width: 1000px;
}

.step-card label,
.step-card .label {
    flex: 1;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: left;
}

@media (min-width:768px) {
    .step-card label,
    .step-card .label {
        white-space: nowrap;
    }
}

/* One column on mobile -- !important is needed because several step-cards set
   their own min-width inline (e.g. 400px on the label column), which would
   otherwise force the label and input side by side on a narrow screen. */
@media (max-width: 767px) {
    .step-card {
        flex-direction: column;
    }
    .step-card > div {
        width: 100%;
        min-width: 0 !important;
    }
}

.step-card .washer-info ul {
    list-style: none;
    font-size: 0.875rem;
}

.step-card .washer-info ul li {
    border-top: 1px solid #ccc;
    padding: 5px 0;
}

.step-heading {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Card Grid */
.cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
    text-align: center;
    cursor: pointer;
}
.card-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    width: calc(33% - 20px);
}
.cards-grid.pipe-toggle {
    justify-content: flex-start;
}
.cards-grid.cards-large.pipe-toggle {
    justify-content: center;
}
.card-grid.card-wider {
    min-width: 200px;
}
.card-grid:hover {
    border-color: #bbb;
}
/* One card per row on mobile -- !important is needed because many cards set
   their own min-width inline (150px-350px depending on the card), which
   would otherwise force 2+ cramped cards per row on narrow screens. */
@media (max-width: 767px) {
    .card-grid {
        width: 100% !important;
        min-width: 0 !important;
    }
}
.card-grid .icon {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
}
.card-grid .label {
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 10px;
    display: block;
    width: 100%;
}
.card-grid .card-image {
    max-width: 120px;
}
.card-top-selection {
    padding: 20px 20px 10px 20px;
}
.grid-2 .card {
    width: calc(50% - 20px);
}
.grid-3 .card {
    width: calc(33.33% - 20px);
}
.grid-4 .card {
    width: calc(25% - 20px);
}
.grid-5 .card {
    width: calc(20% - 20px);
}
.grid-5 .card-grid .label {
    font-size: 1rem;
}
.badge {
    background: var(--accent-green);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 8px;
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 4px;
    white-space: nowrap;
}
.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}
.input-wrapper input[type="number"] {
    width: 120px;
    padding: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    border: 2px solid #ccc;
    border-radius: 4px;
    text-align: center;
    color: var(--primary-color);
}
.input-wrapper input[type="number"]::placeholder {
  color: rgba(0,0,0,0.2);
  opacity: 1;
}
.input-wrapper input[type="number"]:not(:placeholder-shown) {
  border-color: var(--accent-green);
}
.input-wrapper.field-missing input[type="number"] {
  border-color: var(--error-red);
  box-shadow: 0 0 0 1px var(--error-red);
}
.cards-grid.field-missing {
  outline: 2px solid var(--error-red);
  outline-offset: 6px;
  border-radius: 12px;
}
.unit { color: var(--primary-color); font-weight: 600; }
.helper-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
}
.helper-text hr {
    border-bottom: 1px solid #ccc;
}
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--primary-color);
    margin-top: 10px;
}

/* Pipe Size Toggle */
.pipe-toggle { display: flex; gap: 15px; }
.pipe-circle {
    width: 80px; height: 80px;
    border: 2px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    color: var(--primary-color);
    transition: 0.2s;
}
.pipe-circle.selected {
    border-color: var(--primary-color);
    background: #fff5f5;
}

/* Results Screen */
.results-container {
    margin-bottom: 30px;
}
.results-container .sizing-tool-calc-table {
    margin-left: 0;
}
.results-container .generate-pdf-container {
    text-align: center;
}
.recommendation-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}
.recommendation-card {
    opacity: 1;
}
@media(min-width:786px) {
    .recommendation-col-1 {
        width: calc(55% - 30px);
    }
    .recommendation-col-2 {
        width: 45%;
    }
}
.recommendation-container .sizing-tool-recommendation {
    border: 0;
    padding: 10px 0;
}
.recommendation-container .sizing-tool-calc-table {
    min-width: unset;
    width: 100%;
}

/* Only the two-column product card markup (components/sizing-tool) uses this
   flex layout. The acid-style card (components/sizing-tool-recommendation,
   reused for chemical point-of-use) renders a <section> with no columns, and
   turning it into a flex container collapses its image's aspect-ratio box. */
.recommendation-container div.sizing-tool-recommendation {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.recommendation-container .sizing-tool-recommendation .hdg-6 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.sizing-tool-col-1 {
    width: 100%;
}

@media(min-width:786px) {
    .sizing-tool-col-1 {
        width: calc(55% - 20px);
    }
    .sizing-tool-col-2 {
        width: 45%;
    }
}

.recommendation-container .sizing-tool-recommendation .sizing-tool-recommendation__image {
    aspect-ratio: 1 / 1;
}

.recommendation-container .sizing-tool-recommendation .sizing-tool-recommendation__image .fit-image {
    overflow: hidden;
    aspect-ratio: 3 / 2;
}

/* .recommendation-container .sizing-tool-recommendation .sizing-tool-recommendation__image .fit-image img {
    object-fit: cover;
} */

#sizing-tool-result.is-oil-category .fit-image img {
    transform: scale(1.5);
}

/* Chemical Waste Tanks - Point-of-Use (standard + ADA) results */
.chemical-poc-results {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}
.chemical-poc-col {
    flex: 1;
    min-width: 260px;
}
@media (min-width: 570px) {
    .chemical-poc-col:first-child {
        border-right: 1px solid var(--card-border);
        padding-right: 30px;
    }
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 20px;
    gap: 10px;
}
.btn-lg {
    font-size: 1.5rem !important;
}
.btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}
.btn.btn-primary.btn-back,
.btn.btn-primary.btn-next {
    min-width: 155px;
}
/* Step 3's Next button reads "Generate Result" on desktop, shortened to just
   "Generate" on mobile so it doesn't crowd out the Back button. */
.btn-text-short {
    display: none;
}
@media (max-width: 767px) {
    .btn-text-full {
        display: none;
    }
    .btn-text-short {
        display: inline;
    }
}
.btn.btn-primary.btn-back:hover,
.btn.btn-primary.btn-next:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}
.btn.btn-primary.btn-next:after {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin: 2px 0 0 8px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3e%3cpath fill='%23fcfcfc' d='M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
}
.btn.btn-primary.btn-next:disabled:after {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3e%3cpath fill='%23777777' d='M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z'/%3e%3c/svg%3e");
}
.btn.btn-primary.btn-back:before {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background-repeat: no-repeat;
    margin: 2px 8px 0 0;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3e%3cpath fill='%23fcfcfc' d='M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
}
.btn.btn-primary.btn-back:disabled:before {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3e%3cpath fill='%23777777' d='M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z'/%3e%3c/svg%3e");
}
.btn.btn-primary.btn-back:focus { background: var(--secondary-color); }
.btn.btn-primary { background: var(--secondary-color); color: white; border: 1px solid var(--secondary-color); }
.btn.btn-primary:hover { color: #fff; background: var(--secondary-color); }
.btn.btn-primary:disabled { background: transparent; cursor: not-allowed; color: var(--text-muted); border: 1px solid var(--text-muted); }
.btn.btn-primary:disabled:hover { background: transparent; cursor: not-allowed; }
.btn.btn-primary.btn-back:disabled { color: var(--text-muted); border: 1px solid var(--text-muted); }
/* Looks disabled without actually being disabled, so step 3's Next button
   stays clickable and can register the click that triggers field-missing
   highlighting -- a truly disabled button never fires a click event at all. */
.btn.btn-primary.btn-look-disabled,
.btn.btn-primary.btn-look-disabled:hover { background: transparent; cursor: pointer; color: var(--text-muted); border: 1px solid var(--text-muted); }
.btn.btn-primary.btn-next.btn-look-disabled:after {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3e%3cpath fill='%23777777' d='M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z'/%3e%3c/svg%3e");
}
.btn.btn-outline { background: transparent; border: 1px solid var(--text-main); color: var(--text-main); }

.hidden { display: none !important; }

/* SVG Loader Styling */
.loader-wrap {
    text-align: center;
    /* Roughly matches a recommendation card's typical height, so swapping a
       card out for the spinner (and back again) doesn't itself shrink and
       regrow the page while a new recommendation loads. */
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loader-svg {
    width: 64px;
    height: 64px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

.loader-track {
    stroke: #334155;
}

.loader-spinner {
    stroke: #cccccc;
    stroke-linecap: round;
    stroke-dasharray: 90 150; 
}

/* Keyframes for smooth continuous rotation */
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@media (min-width: 1330px) {
    .container.container-narrow {
        max-width: 1000px;
    }
    .container.container-wider {
        max-width: 1320px;
    }
}

@media (min-width: 1024px) {
    #sizing-tool {
        margin-top: -1.5rem;
    }
}