/**
 * Project Calculator Pro V2
 * Concrete Block Wall Estimator
 */

/* =========================================================
   CALCULATOR CONTAINER
   ========================================================= */

.pcp-block-estimator {
    max-width: 850px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, Helvetica, sans-serif;
    box-sizing: border-box;
}

.pcp-block-estimator *,
.pcp-block-estimator *::before,
.pcp-block-estimator *::after {
    box-sizing: border-box;
}


/* =========================================================
   HEADINGS AND INSTRUCTIONS
   ========================================================= */

.pcp-block-estimator h2 {
    margin: 0 0 10px;
    color: #283655;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
}

.pcp-block-estimator .calc-instructions {
    margin: 8px 0 20px;
    color: #000;
    font-size: 16px;
    line-height: 1.5;
}

.pcp-block-estimator .pcp-section-title,
.pcp-block-estimator .pcp-subtitle {
    margin: 0 0 12px;
    color: #283655;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.pcp-block-estimator .bke-section-description {
    margin: 4px 0 0;
    color: #000;
    font-size: 14px;
    line-height: 1.45;
}


/* =========================================================
   MAIN SECTIONS
   ========================================================= */

.pcp-block-estimator .pcp-section,
.pcp-block-estimator .pcp-settings {
    margin: 20px 0;
    padding: 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
}

.pcp-block-estimator .pcp-section {
    margin-top: 15px;
}

.pcp-block-estimator .pcp-settings .pcp-subtitle {
    margin-top: 0;
}


/* =========================================================
   PANEL HEADERS
   ========================================================= */

.pcp-block-estimator .bke-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.pcp-block-estimator .bke-panel-heading > div {
    flex: 1;
    min-width: 0;
}

.pcp-block-estimator .bke-panel-heading .pcp-section-title {
    margin-bottom: 4px;
}


/* =========================================================
   FIELD GROUPS AND LABELS
   ========================================================= */

.pcp-block-estimator .pcp-group {
    margin-bottom: 15px;
}

.pcp-block-estimator .pcp-group:last-child {
    margin-bottom: 0;
}

.pcp-block-estimator label {
    display: block;
    margin: 0 0 5px;
    color: #000;
    font-size: 16px;
    font-weight: 700;
}

.pcp-block-estimator .bke-unit-label {
    font-size: 14px;
    font-weight: 400;
}

.pcp-block-estimator .pcp-field-note {
    margin: 6px 0 0;
    color: #000;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}


/* =========================================================
   INPUTS AND SELECTS
   ========================================================= */

.pcp-block-estimator input,
.pcp-block-estimator select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    background: #fff;
    color: #000;
    border: 1px solid #bbb;
    border-radius: 6px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
}

.pcp-block-estimator select {
    cursor: pointer;
}

.pcp-block-estimator input:focus,
.pcp-block-estimator select:focus {
    outline: none;
    border-color: #f26522;
    box-shadow: 0 0 0 2px rgba(242, 101, 34, 0.2);
}

.pcp-block-estimator input[aria-invalid="true"],
.pcp-block-estimator select[aria-invalid="true"] {
    border-color: #f26522;
    box-shadow: 0 0 0 2px rgba(242, 101, 34, 0.2);
}

.pcp-block-estimator .bke-unit-system,
.pcp-block-estimator .bke-opening-type {
    background: #283655;
    color: #fff;
}

.pcp-block-estimator .bke-unit-system option,
.pcp-block-estimator .bke-opening-type option {
    background: #fff;
    color: #000;
}


/* =========================================================
   WALL AND OPENING SECTIONS
   ========================================================= */

.pcp-block-estimator .bke-wall-sections,
.pcp-block-estimator .bke-opening-sections {
    display: grid;
    gap: 14px;
}

.pcp-block-estimator .bke-wall-section,
.pcp-block-estimator .bke-opening-section {
    padding: 15px;
    background: #f4f4f4;
    border: 1px solid #ddd;
    border-left: 4px solid #283655;
    border-radius: 8px;
}

.pcp-block-estimator .bke-opening-section {
    border-left-color: #f26522;
}

.pcp-block-estimator .bke-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pcp-block-estimator .bke-wall-heading,
.pcp-block-estimator .bke-opening-heading {
    margin: 0;
    color: #283655;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.3;
}


/* =========================================================
   WALL AND OPENING FIELD GRIDS
   ========================================================= */

.pcp-block-estimator .bke-wall-field-grid,
.pcp-block-estimator .bke-opening-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pcp-block-estimator .bke-wall-field-grid .pcp-group,
.pcp-block-estimator .bke-opening-field-grid .pcp-group {
    margin-bottom: 0;
}

.pcp-block-estimator .bke-name-group {
    grid-column: 1 / -1;
}


/* =========================================================
   EMPTY OPENING MESSAGE
   ========================================================= */

.pcp-block-estimator .bke-opening-empty-message {
    margin: 0;
    padding: 14px;
    background: #f4f4f4;
    color: #000;
    border: 1px dashed #bbb;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}

.pcp-block-estimator .bke-opening-empty-message[hidden] {
    display: none;
}


/* =========================================================
   SETTINGS AND COST GRIDS
   ========================================================= */

.pcp-block-estimator .bke-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.pcp-block-estimator .bke-cost-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.pcp-block-estimator .bke-settings-grid .pcp-group,
.pcp-block-estimator .bke-cost-grid .pcp-group {
    margin-bottom: 0;
}


/* =========================================================
   INPUT PREFIX AND SUFFIX FIELDS
   ========================================================= */

.pcp-block-estimator .bke-input-suffix-field,
.pcp-block-estimator .bke-money-field {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.pcp-block-estimator .bke-input-suffix-field input {
    flex: 1;
    min-width: 0;
    border-radius: 6px 0 0 6px;
}

.pcp-block-estimator .bke-input-suffix-field > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 54px;
    padding: 10px 12px;
    background: #283655;
    color: #fff;
    border: 1px solid #283655;
    border-radius: 0 6px 6px 0;
    font-size: 15px;
    font-weight: 700;
}

.pcp-block-estimator .bke-money-field > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    min-height: 46px;
    padding: 10px;
    background: #283655;
    color: #fff;
    border: 1px solid #283655;
    border-radius: 6px 0 0 6px;
    font-size: 16px;
    font-weight: 700;
}

.pcp-block-estimator .bke-money-field input {
    flex: 1;
    min-width: 0;
    border-radius: 0 6px 6px 0;
}


/* =========================================================
   DETAILS CHECKBOX
   ========================================================= */

.pcp-block-estimator .bke-checkbox-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 12px;
    background: #f4f4f4;
    color: #000;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.pcp-block-estimator .bke-checkbox-option:hover {
    background: #fff;
    border-color: #f26522;
}

.pcp-block-estimator .bke-checkbox-option:has(
    input[type="checkbox"]:checked
) {
    border-color: #283655;
}

.pcp-block-estimator
    .bke-checkbox-option
    input[type="checkbox"] {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    margin: 2px 0 0;
    padding: 0;
    accent-color: #f26522;
    cursor: pointer;
}

.pcp-block-estimator .bke-checkbox-option span {
    display: block;
    flex: 1;
    min-width: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.pcp-block-estimator .bke-checkbox-option small {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.pcp-block-estimator .pcp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 16px;
    background: #f26522;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.2;
    text-align: center;
    transition:
        background-color 0.2s ease,
        opacity 0.2s ease,
        transform 0.1s ease;
}

.pcp-block-estimator .pcp-btn:hover {
    background: #283655;
}

.pcp-block-estimator .pcp-btn:focus-visible {
    outline: 3px solid rgba(242, 101, 34, 0.3);
    outline-offset: 2px;
}

.pcp-block-estimator .pcp-btn:active {
    transform: translateY(1px);
}

.pcp-block-estimator .pcp-btn:disabled {
    background: #bbb;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}

.pcp-block-estimator .pcp-btn:disabled:hover {
    background: #bbb;
}


/* =========================================================
   ADD AND REMOVE BUTTONS
   ========================================================= */

.pcp-block-estimator .bke-add-button {
    flex: 0 0 auto;
    min-width: 130px;
    background: #283655;
}

.pcp-block-estimator .bke-add-button:hover {
    background: #f26522;
}

.pcp-block-estimator .bke-remove-button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 7px 11px;
    background: #fff;
    color: #283655;
    border: 1px solid #283655;
    border-radius: 6px;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 700;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.pcp-block-estimator .bke-remove-button:hover {
    background: #283655;
    color: #fff;
}

.pcp-block-estimator .bke-remove-button:focus-visible {
    outline: 3px solid rgba(242, 101, 34, 0.3);
    outline-offset: 2px;
}

.pcp-block-estimator .bke-remove-button:disabled {
    background: #eee;
    color: #888;
    border-color: #bbb;
    cursor: not-allowed;
}


/* =========================================================
   PRIMARY BUTTON ROW
   ========================================================= */

.pcp-block-estimator .pcp-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.pcp-block-estimator .pcp-button-row .pcp-btn {
    flex: 1 1 160px;
}

.pcp-block-estimator .bke-copy:not(:disabled) {
    background: #283655;
}

.pcp-block-estimator .bke-copy:not(:disabled):hover {
    background: #f26522;
}


/* =========================================================
   RESULT CONTAINER
   ========================================================= */

.pcp-block-estimator .pcp-result {
    margin-top: 20px;
    color: #000;
    font-size: 16px;
    line-height: 1.5;
}

.pcp-block-estimator .pcp-result:empty {
    display: none;
}

.pcp-block-estimator .pcp-result-success {
    display: block;
    padding: 16px;
    background: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 10px;
}

.pcp-block-estimator .pcp-result-success > h3 {
    margin: 0 0 16px;
    color: #283655;
    font-size: 21px;
    font-weight: 800;
}


/* =========================================================
   RESULT HIGHLIGHTS
   ========================================================= */

.pcp-block-estimator .bke-result-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.pcp-block-estimator .bke-result-highlight {
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-top: 4px solid #f26522;
    border-radius: 8px;
    text-align: center;
}

.pcp-block-estimator .bke-result-highlight span {
    display: block;
    margin-bottom: 6px;
    color: #283655;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.pcp-block-estimator .bke-result-highlight strong {
    display: block;
    color: #000;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
}


/* =========================================================
   RESULT SECTIONS
   ========================================================= */

.pcp-block-estimator .bke-result-section {
    margin-top: 16px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.pcp-block-estimator .bke-result-section:first-of-type {
    margin-top: 0;
}

.pcp-block-estimator .bke-result-section h4 {
    margin: 0 0 12px;
    padding-bottom: 9px;
    color: #283655;
    border-bottom: 1px solid #ddd;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.3;
}


/* =========================================================
   RESULT LISTS
   ========================================================= */

.pcp-block-estimator .bke-result-list {
    margin: 0;
    padding: 0;
}

.pcp-block-estimator .bke-result-item {
    display: grid;
    grid-template-columns:
        minmax(190px, 0.85fr)
        minmax(0, 1.5fr);
    gap: 16px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.pcp-block-estimator .bke-result-item:first-child {
    padding-top: 0;
}

.pcp-block-estimator .bke-result-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.pcp-block-estimator .bke-result-item dt {
    margin: 0;
    color: #283655;
    font-weight: 700;
    line-height: 1.45;
}

.pcp-block-estimator .bke-result-item dd {
    min-width: 0;
    margin: 0;
    color: #000;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.pcp-block-estimator .bke-result-item-emphasis {
    margin-top: 4px;
    padding: 12px;
    background: #f4f4f4;
    border-bottom: none;
    border-left: 4px solid #f26522;
    border-radius: 6px;
}

.pcp-block-estimator .bke-result-item-emphasis dt,
.pcp-block-estimator .bke-result-item-emphasis dd {
    font-weight: 800;
}


/* =========================================================
   DETAIL CARDS
   ========================================================= */

.pcp-block-estimator .bke-detail-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pcp-block-estimator .bke-detail-card {
    min-width: 0;
    padding: 13px;
    background: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.pcp-block-estimator .bke-detail-card h5 {
    margin: 0 0 10px;
    color: #283655;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.pcp-block-estimator .bke-detail-card dl {
    margin: 0;
}

.pcp-block-estimator .bke-detail-card .bke-result-item {
    display: block;
    padding: 8px 0;
}

.pcp-block-estimator .bke-detail-card .bke-result-item dt {
    margin-bottom: 3px;
    font-size: 13px;
}

.pcp-block-estimator .bke-detail-card .bke-result-item dd {
    font-size: 14px;
}

.pcp-block-estimator .bke-no-detail-items {
    margin: 0;
    color: #000;
    font-size: 14px;
}


/* =========================================================
   COST SECTION
   ========================================================= */

.pcp-block-estimator .bke-cost-section {
    border-top: 4px solid #283655;
}

.pcp-block-estimator .bke-cost-note {
    margin: 13px 0 0;
    padding: 10px 12px;
    background: #f4f4f4;
    border-left: 4px solid #f26522;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.45;
}


/* =========================================================
   RESULT NOTE
   ========================================================= */

.pcp-block-estimator .pcp-result-note {
    margin: 16px 0 0;
    padding-top: 13px;
    color: #000;
    border-top: 1px solid #ddd;
    font-size: 14px;
    line-height: 1.5;
}


/* =========================================================
   VALIDATION ERRORS
   ========================================================= */

.pcp-block-estimator .pcp-result-error {
    display: block;
    padding: 12px 15px;
    background: #f4f4f4;
    color: #000;
    border-left: 4px solid #f26522;
    border-radius: 6px;
    font-weight: 700;
}


/* =========================================================
   ASSUMPTIONS
   ========================================================= */

.pcp-block-estimator .bke-assumption-list {
    margin: 0;
}

.pcp-block-estimator .bke-assumption-list > div {
    display: grid;
    grid-template-columns:
        minmax(180px, 0.8fr)
        minmax(0, 1.2fr);
    gap: 15px;
    padding: 9px 0;
    border-bottom: 1px solid #ddd;
}

.pcp-block-estimator .bke-assumption-list > div:first-child {
    padding-top: 0;
}

.pcp-block-estimator .bke-assumption-list > div:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.pcp-block-estimator .bke-assumption-list dt {
    color: #283655;
    font-weight: 700;
}

.pcp-block-estimator .bke-assumption-list dd {
    margin: 0;
    color: #000;
}


/* =========================================================
   CALCULATOR NOTE
   ========================================================= */

.pcp-block-estimator .pcp-calculator-note {
    margin: 16px 0 0;
    padding: 12px 14px;
    background: #f4f4f4;
    color: #000;
    border-left: 4px solid #283655;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}


/* =========================================================
   SCREEN-READER-ONLY ELEMENTS
   ========================================================= */

.pcp-block-estimator .bke-screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}


/* =========================================================
   TABLET LAYOUT
   ========================================================= */

@media (max-width: 760px) {
    .pcp-block-estimator {
        padding: 15px;
    }

    .pcp-block-estimator .bke-settings-grid {
        grid-template-columns: 1fr;
    }

    .pcp-block-estimator .bke-result-highlights {
        grid-template-columns: 1fr;
    }

    .pcp-block-estimator .bke-detail-card-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   MOBILE LAYOUT
   ========================================================= */

@media (max-width: 600px) {
    .pcp-block-estimator h2 {
        font-size: 22px;
    }

    .pcp-block-estimator .pcp-section-title,
    .pcp-block-estimator .pcp-subtitle {
        font-size: 17px;
    }

    .pcp-block-estimator .bke-panel-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .pcp-block-estimator .bke-add-button {
        width: 100%;
    }

    .pcp-block-estimator .bke-section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .pcp-block-estimator .bke-remove-button {
        width: 100%;
    }

    .pcp-block-estimator .bke-wall-field-grid,
    .pcp-block-estimator .bke-opening-field-grid,
    .pcp-block-estimator .bke-cost-grid {
        grid-template-columns: 1fr;
    }

    .pcp-block-estimator .bke-name-group {
        grid-column: auto;
    }

    .pcp-block-estimator .pcp-button-row {
        gap: 10px;
    }

    .pcp-block-estimator .pcp-button-row .pcp-btn {
        flex-basis: calc(50% - 5px);
    }

    .pcp-block-estimator .bke-result-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .pcp-block-estimator .bke-result-item dt {
        font-size: 14px;
    }

    .pcp-block-estimator .bke-assumption-list > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}


/* =========================================================
   SMALL MOBILE LAYOUT
   ========================================================= */

@media (max-width: 420px) {
    .pcp-block-estimator {
        padding: 10px;
    }

    .pcp-block-estimator .pcp-section,
    .pcp-block-estimator .pcp-settings,
    .pcp-block-estimator .pcp-result-success {
        padding: 12px;
    }

    .pcp-block-estimator .bke-wall-section,
    .pcp-block-estimator .bke-opening-section,
    .pcp-block-estimator .bke-result-section {
        padding: 12px;
    }

    .pcp-block-estimator .pcp-button-row .pcp-btn {
        flex-basis: 100%;
    }

    .pcp-block-estimator .bke-result-highlight strong {
        font-size: 20px;
    }
}


/* =========================================================
   PRINT / PDF LAYOUT
   ========================================================= */

@media print {
    .pcp-block-estimator {
        max-width: 100%;
        padding: 0;
    }

    .pcp-block-estimator .pcp-button-row,
    .pcp-block-estimator .bke-add-button,
    .pcp-block-estimator .bke-remove-button,
    .pcp-block-estimator .bke-copy-output,
    .pcp-block-estimator .bke-status {
        display: none !important;
    }

    .pcp-block-estimator .pcp-section,
    .pcp-block-estimator .pcp-settings,
    .pcp-block-estimator .pcp-result,
    .pcp-block-estimator .pcp-calculator-note,
    .pcp-block-estimator .bke-result-section,
    .pcp-block-estimator .bke-detail-card,
    .pcp-block-estimator .bke-wall-section,
    .pcp-block-estimator .bke-opening-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .pcp-block-estimator .pcp-result-success,
    .pcp-block-estimator .bke-result-section,
    .pcp-block-estimator .bke-detail-card,
    .pcp-block-estimator .bke-wall-section,
    .pcp-block-estimator .bke-opening-section,
    .pcp-block-estimator .bke-result-highlight {
        background: #fff;
        box-shadow: none;
    }

    .pcp-block-estimator input,
    .pcp-block-estimator select {
        background: #fff;
        color: #000;
    }
}