.bcw-calc {
    max-width: 400px;
    margin: 2rem auto;
    padding: 48px 28px;
    background: rgba(241, 241, 241, 0.85);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    font-family: inherit;
    font-size: 16px;
    color: var(--e-global-color-secondary, #1A1A1A);
    text-align: center;
    box-sizing: border-box;
}

/* Header */
.bcw-calc-header {
    margin-bottom: 24px;
}

.bcw-calc .bcw-calc-divider {
    display: block;
    width: 35%;
    border-block-start: var(--divider-border-width, 3px) var(--divider-border-style, solid) #A25C39;
    border-radius: 2px;
    margin: 0 auto 16px;
}

.bcw-calc .bcw-calc-title {
    font-family: var(--e-global-typography-primary-font-family, 'Roboto'), sans-serif;
    font-weight: var(--e-global-typography-primary-font-weight, 600);
    font-size: 32px;
    color: var(--e-global-color-52d42c4, #280C01);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0;
    padding: 0;
    line-height: 1.3;
}

/* Input rows */
.bcw-calc-inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.bcw-calc-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bcw-calc-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--e-global-color-52d42c4, #280C01);
    text-align: center;
}

/* Input fields */
.bcw-calc .bcw-calc-field {
    width: 100%;
    box-sizing: border-box;
    padding: 11.25px;
    font-size: 18px;
    font-family: inherit;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: var(--e-global-color-74edf40, #FFFFFF);
    color: var(--e-global-color-secondary, #1A1A1A);
    text-align: left;
    outline: none;
    box-shadow: none;
    min-width: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bcw-calc .bcw-calc-field::placeholder {
    color: var(--e-global-color-text, #7A7A7A);
    opacity: 1;
}

.bcw-calc .bcw-calc-field:focus {
    border-color: #A25C39;
    box-shadow: 0 0 0 3px rgba(162, 92, 57, 0.15);
}

/* Material select — hidden (cards used instead) */
.bcw-calc select.bcw-calc-field {
    display: none;
}

/* Quantity window display — overlaid at drum center */
.bcw-calc-qty-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 100%;
    border: 3px solid ;
    border-color:var(--e-global-color-accent, #D6AA77) ;
    border-radius: 4px;
    background: #d6eeff;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(162, 92, 57, 0.25);
}

.bcw-calc-qty-window-display {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--e-global-color-52d42c4, #280C01);
    font-family: inherit;
    letter-spacing: -0.02em;
    z-index: 1;
    background: transparent;
}

/* Quantity drum */
.bcw-calc-qty-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bcw-calc-qty-arrow {
    display: none;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 8px !important;
    background: var(--e-global-color-accent, #D6AA77);
    color: var(--e-global-color-secondary, #1A1A1A);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    user-select: none;
}

.bcw-calc-qty-arrow:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bcw-calc-qty-arrow:active {
    transform: translateY(0);
    opacity: 0.8;
}

/* Show on all screen sizes */
.bcw-calc-qty-arrow.bcw-show-always {
    display: flex;
}

/* Show only on desktop (≥480px) */
@media (min-width: 480px) {
    .bcw-calc-qty-arrow.bcw-show-desktop {
        display: flex;
    }
}

/* Show only on mobile (<480px) */
.bcw-calc-qty-arrow.bcw-show-mobile {
    display: flex;
}
@media (min-width: 480px) {
    .bcw-calc-qty-arrow.bcw-show-mobile {
        display: none;
    }
}

.bcw-calc-qty-drum {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 60px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
}

.bcw-calc-qty-tape {
    position: absolute;
    inset: 0;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    box-sizing: content-box;
    cursor: grab;
}

.bcw-calc-qty-tape::-webkit-scrollbar {
    display: none;
}

.bcw-calc-qty-item {
    width: 52px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--e-global-color-52d42c4, #280C01);
    font-family: inherit;
    letter-spacing: -0.02em;
    scroll-snap-align: center;
    cursor: inherit;
    user-select: none;
}


/* Material selection cards */
.bcw-calc-cards {
    display: flex;
    gap: 12px;
}

.bcw-calc-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    border: none;
    border-radius: 8px !important;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s, transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.bcw-calc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


.bcw-calc-card.active {
    background: rgba(214, 170, 119, 0.15);
    border: 3px solid;
    border-color: var(--e-global-color-accent, #D6AA77);
}

.bcw-calc-card-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* Button */
.bcw-calc .bcw-calc-submit,
.bcw-calc .bcw-calc-send {
    width: 100%;
    padding: 15px;
    margin-top: 12px;
    font-family: var(--e-global-typography-primary-font-family, 'Roboto'), sans-serif;
    font-size: 15px;
    font-weight: var(--e-global-typography-primary-font-weight, 600);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    background: var(--e-global-color-accent, #D6AA77);
    color: var(--e-global-color-secondary, #1A1A1A);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}

.bcw-calc .bcw-calc-submit:hover,
.bcw-calc .bcw-calc-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bcw-calc .bcw-calc-submit:active,
.bcw-calc .bcw-calc-send:active {
    transform: translateY(0);
    opacity: 0.8;
}

.bcw-calc .bcw-calc-send:disabled {
    cursor: default;
    opacity: 0.6;
}

.bcw-calc .bcw-calc-send:disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Stage: stack all three panels so they share the same height */
.bcw-calc-stage {
    display: grid;
}

.bcw-calc-stage > * {
    grid-column: 1;
    grid-row: 1;
}

.bcw-calc-hidden {
    visibility: hidden;
    pointer-events: none;
}

/* Estimate form */
.bcw-calc .bcw-calc-form-field {
    width: 100%;
    padding: 11.25px;
    font-size: 18px;
    font-family: inherit;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #d6eeff;
    color: var(--e-global-color-secondary, #1A1A1A);
    text-align: left;
    outline: none;
    box-shadow: none;
    box-sizing: border-box;
    margin-bottom: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bcw-calc .bcw-calc-form-field:focus {
    border-color: #A25C39;
    box-shadow: 0 0 0 3px rgba(162, 92, 57, 0.15);
    background: #d6eeff;
}

.bcw-calc .bcw-calc-form-field:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #d6eeff inset !important;
    box-shadow: 0 0 0 1000px #d6eeff inset !important;
}

.bcw-calc .bcw-calc-form-field::placeholder {
    color: var(--e-global-color-text, #7A7A7A);
    opacity: 1;
}

.bcw-calc .bcw-calc-send {
    margin-top: 10px;
}

.bcw-calc-form-msg {
    margin-top: 12px;
    font-size: 15px;
    min-height: 20px;
}

.bcw-calc-form-msg.error {
    color: #c62828;
}

/* Submit result */
.bcw-calc-result {
    padding: 20px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    align-self: center;
}

.bcw-calc-result.success {
    color: #2e7d32;
    font-size: 20px;
}

.bcw-calc-result.success::before {
    content: "✓";
    display: block;
    width: 56px;
    height: 56px;
    line-height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #2e7d32;
    color: #fff;
    font-size: 28px;
    text-align: center;
}

.bcw-calc-result.error {
    color: #c62828;
}

/* Form title */
.bcw-calc-form-title {
    font-family: var(--e-global-typography-primary-font-family, 'Roboto'), sans-serif;
    font-size: 18px;
    font-weight: normal;
    color: var(--e-global-color-52d42c4, #280C01);
    margin: 0 0 16px;
    padding: 0;
}

/* =====================================================
   Sidebar (desktop left panel)
   ===================================================== */

/* Hidden by default — mobile shows only the widget */
.bcw-calc-sidebar {
    display: none;
    text-align: left;
}

.bcw-calc-widget {
    min-width: 0;
}

.bcw-calc-sidebar-sub-heading {
    font-family: var(--e-global-typography-primary-font-family, 'Roboto'), sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--e-global-color-52d42c4, #280C01);
    line-height: 1.3;
    margin: 8px 0 2px;
    padding: 0;
}

.bcw-calc-sidebar-heading {
    font-family: var(--e-global-typography-primary-font-family, 'Roboto'), sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--e-global-color-52d42c4, #280C01);
    line-height: 1.3;
    margin: 0 0 4px;
    padding: 0;
}

.bcw-calc-sidebar-text {
    font-size: 16px;
    color: var(--e-global-color-secondary, #1A1A1A);
    line-height: 1.6;
    margin: 0 0 4px;
}

.bcw-calc-sidebar-spacer {
    height: 8px;
}

.bcw-calc-sidebar-text a {
    color: #A25C39;
    text-decoration: none;
}

.bcw-calc-sidebar-text a:hover {
    text-decoration: underline;
}

/* Desktop two-column layout — 2× calc width, 1:1 split */
@media (min-width: 1024px) {
    .bcw-calc.bcw-calc--no-sidebar {
        max-width: 400px;
        display: block;
    }

    .bcw-calc.bcw-calc--no-sidebar .bcw-calc-widget {
        border-radius: 12px;
    }

    .bcw-calc {
        max-width: 920px;
        display: flex;
        align-items: stretch;
        gap: 0;
        text-align: left;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }

    .bcw-calc-sidebar {
        display: flex;
        flex-direction: column;
        flex: 1;
        box-sizing: border-box;
        background: #F1F1F1D9;
        border-radius: 12px 0 0 12px;
        padding: 16px;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    }

    .bcw-calc-sidebar-body {
        flex: 1;
        background: rgba(255, 255, 255, 0.85);
        border-radius: 8px;
        padding: 32px 28px;
    }

    .bcw-calc-widget {
        flex: 1;
        box-sizing: border-box;
        text-align: center;
        background: rgba(241, 241, 241, 0.85);
        border-radius: 0 12px 12px 0;
        padding: 48px 28px;
        box-shadow: 6px 6px 24px rgba(0, 0, 0, 0.08);
    }
}

/* Responsive */
@media (max-width: 400px) {
    .bcw-calc-cards {
        gap: 8px;
    }

    .bcw-calc-card {
        padding: 12px 4px;
    }

    .bcw-calc-card svg {
        width: 50px;
        height: 63px;
    }
}
