/* Step 2 — consistent corner radius on fields, selects, and buttons */
[data-section="2"] {
    --fc-step2-radius: 8px;
}

[data-section="2"] .form-control,
[data-section="2"] select.form-control {
    border-radius: var(--fc-step2-radius) !important;
}

[data-section="2"] .select2-container--bootstrap-5 .select2-selection {
    border-radius: var(--fc-step2-radius) !important;
}

[data-section="2"] .select2-container--bootstrap-5.select2-container--open .select2-selection,
[data-section="2"] .select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-radius: var(--fc-step2-radius) !important;
}

[data-section="2"] .select2-container--bootstrap-5 .select2-dropdown {
    border-radius: var(--fc-step2-radius) !important;
    overflow: hidden;
}

[data-section="2"] .fencing-mb-input {
    border-radius: var(--fc-step2-radius) !important;
    overflow: hidden;
}

[data-section="2"] .fc-max-fence-height-input {
    border: 0;
    background: transparent;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

[data-section="2"] .fencing-measurement-box--height-only .fencing-mb-input {
    width: 100%;
}

[data-section="2"] .fencing-qty-minus {
    border-radius: var(--fc-step2-radius) 0 0 var(--fc-step2-radius) !important;
}

[data-section="2"] .fencing-qty-plus {
    border-radius: 0 var(--fc-step2-radius) var(--fc-step2-radius) 0 !important;
}

[data-section="2"] .btn-fc-calculate,
[data-section="2"] .fencing-measurement-box .btn {
    border-radius: var(--fc-step2-radius) !important;
}

[data-section="2"] .fc-select-2,
[data-section="2"] .fc-select {
    border-radius: var(--fc-step2-radius) !important;
}

[data-section="2"] .alert.alert-gray {
    border-radius: var(--fc-step2-radius) !important;
}

/* Step 2 — searchable Select2 dropdowns (slat gap, size, fence height) */
[data-section="2"] .select2-container--bootstrap-5 {
    width: 100% !important;
}

.select2-container--bootstrap-5 .select2-selection,
.select2-container--bootstrap-5 .select2-dropdown {
    border-color: var(--fc-dark-gray) !important;
}

.select2-container--bootstrap-5 .select2-dropdown .select2-results__options:not(.select2-results__options--nested) {
    max-height: 16rem !important;
}


[data-section="2"] .fc-step2-field--disabled .select2-container {
    pointer-events: none;
    opacity: 0.65;
}

/* Step 2 — Slat / Slat Infill / Barr: Fence Height + Gate ONLY or Number of Panels (two columns) */
[data-section="2"] .fc-step2-slat-height-row .fc-step2-gate-only .fc-select-2 {
    width: 100%;
}

/* Step 2 — space between last field / gate-only row and Overall Length */
[data-section="2"] .fencing-section--step2 .fc-step2-spacer-before-overall {
    margin-bottom: 0.5rem;
}

[data-section="2"] .fc-step2-slat-height-row.fc-step2-row--single:not(.d-none) {
    margin-bottom: 1rem;
}

[data-section="2"] .fc-step2-slat-height-row .fc-step2-gate-only,
[data-section="2"] .fc-step2-slat-height-row .fc-input-container {
    margin-bottom: 0;
}

/* Gate Options — Add/Remove Gate: field border/size match Gate Height */
.fencing-modal-area--gate .custom-gate {
    --fc-gate-field-radius: 8px;
}

.fencing-modal-area--gate .custom-gate .fencing-mb-input {
    border: 1px solid var(--fc-dark-gray);
    border-radius: var(--fc-gate-field-radius);
    width: 100%;
    display: grid;
    align-items: center;
}

.fencing-modal-area--gate .custom-gate .fencing-measurement-box--height-only .fencing-mb-input,
.fencing-modal-area--gate .custom-gate .fc-gate-modal-custom-width-section .fencing-mb-input {
    width: 100%;
}

.fencing-modal-area--gate .custom-gate .fencing-mb-input input {
    border: 0;
    background: transparent;
    outline: none;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    font-size: 1rem !important;
    font-weight: 500;
}

.fencing-modal-area--gate .custom-gate .fencing-mb-input span {
    font-size: 0.8125rem;
    color: var(--fc-granite-gray);
    font-weight: 400;
}

.fencing-modal-area--gate .custom-gate .fencing-qty-btn {
    height: auto;
    min-height: 2.25rem;
    padding: 0.35rem 0.65rem;
}

.fencing-modal-area--gate .custom-gate .fencing-qty-minus {
    border-radius: var(--fc-gate-field-radius) 0 0 var(--fc-gate-field-radius) !important;
    border-right: 1px solid var(--fc-dark-gray);
}

.fencing-modal-area--gate .custom-gate .fencing-qty-plus {
    border-radius: 0 var(--fc-gate-field-radius) var(--fc-gate-field-radius) 0 !important;
    border-left: 1px solid var(--fc-dark-gray);
}

.fencing-modal-area--gate .custom-gate .fc-select-2.fc-gate-modal-field,
.fencing-modal-area--gate .custom-gate .fc-gate-modal-gate-only-col .fc-select-2 {
    border: 1px solid var(--fc-dark-gray) !important;
    border-radius: var(--fc-gate-field-radius) !important;
    min-height: calc(2.25rem + 2px);
    padding: 0.35rem 0.65rem 0.35rem 42px !important;
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.fencing-modal-area--gate .custom-gate .fc-gate-modal-gate-only-height-row {
    align-items: flex-end;
}

.fencing-modal-area--gate .custom-gate .fc-gate-modal-gate-only-height-row .fc-input-container,
.fencing-modal-area--gate .custom-gate .fc-gate-modal-gate-only-col {
    margin-bottom: 0;
}

.fencing-modal-area--gate .custom-gate .fc-gate-modal-gate-only-col .fc-select-2:not(.fc-selected),
.fencing-modal-area--gate .custom-gate .fc-gate-modal-field:not(.fc-selected) {
    border-color: var(--fc-dark-gray) !important;
}

.fencing-modal-area--gate .custom-gate .fc-gate-modal-gate-only-col .fc-select-2:not(.fc-selected)::after,
.fencing-modal-area--gate .custom-gate .fc-gate-modal-field:not(.fc-selected)::after {
    border-color: var(--fc-dark-gray);
}

.fencing-modal-area--gate .custom-gate .fc-gate-modal-calculate-row {
    display: flex;
    align-items: stretch;
    width: 100%;
    position: relative;
}

.fencing-modal-area--gate .custom-gate .fc-gate-modal-calculate-row .fencing-mb-input {
    flex: 1 1 auto;
    min-width: 0;
}

.fencing-modal-area--gate .custom-gate .fc-gate-modal-calculate-row .btn {
    border-radius: var(--fc-gate-field-radius) !important;
    margin-top: 0;
    align-self: stretch;
    white-space: nowrap;
}

.fencing-modal-area--gate .custom-gate .alert.alert-gray {
    border-radius: var(--fc-gate-field-radius);
}

@media (max-width: 480px) {
    .fencing-modal-area--gate .custom-gate .fc-gate-modal-calculate-row {
        display: block;
    }

    .fencing-modal-area--gate .custom-gate .fc-gate-modal-calculate-row .btn {
        width: 100%;
        margin-top: 8px;
    }
}

.fc-cart-items .fc-edit-item {
    border: 1px solid var(--fc-princeton-orange);
    background: var(--fc-princeton-orange);
    color: var(--fc-white);
}

.btn-fc-outline-danger {
    background: var(--fc-white);
}

.fencing-section--step1 .btn-delete-fence {
    padding: 0;
}

.fc-label-group .fc-form-control {
    width: 100%;
    background: var(--fc-white);
}

.fc-card-body {
    position: relative;
}

.fc-card-body .fc-loader-container {
    height: 100%;
}

.fc-section-loader-overlay {
    position: absolute;
    background: var(--fc-overlay-dark);
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
}

.project-details--editable:hover {
    cursor: pointer;
    background: var(--fc-whisper);
}

.fc-result {
    position: relative;
}

.cp_no-post--left:before,
.cp_no-post--left .fc-div-c-p,
.cp_no-post--left .fc-start-c-p,
.cp_no-post--right:after,
.cp_no-post--right .fc-div-c-p:nth-child(2),
.cp_no-post--right .fc-end-c-p {
    color: var(--fc-red);
    z-index: 1;
}


.fencing-panel-spacing-number.opt-2 span {
    bottom: -5px;
}

[data-group="b"] .panel-post:not(.panel-no-post).opt-2 {
    margin-bottom: 25px;
}

.qty-edited {
    position: absolute;
    left: -10px;
    top: 5px;
    font-size: 12px;
    background: var(--fc-white);
    padding: 5px;
    border-radius: 100%;
    border: 1px solid var(--fc-gainsboro);
    color: var(--fc-gray-chateau);
}

.fc-form-group {
    position: relative;
}

.btn-orange {
    border-bottom: 3px solid var(--fc-fiery-orange) !important;
}

.btn-outline-secondary {
    border-bottom: 3px solid var(--fc-trout) !important;
}

.btn-danger,
.btn-outline-danger {
    border-bottom: 3px solid var(--fc-bright-maroon) !important;
}

.btn-fc-outline-default {
    border-bottom: 3px solid var(--fc-matterhorn) !important;
}

.btn-dark {
    border-bottom: 3px solid var(--fc-black) !important;
}

/* Slat Gate ONLY + STD: Overall Length is computed and read-only */
.fc-measurement-locked-gate-only .fencing-mb-input {
    background-color: #f3f3f3;
    border-color: #d4d4d4;
}

.fc-measurement-locked-gate-only .measurement-box-number {
    background-color: #f3f3f3;
    color: #6c757d;
    cursor: not-allowed;
}

.fc-measurement-locked-gate-only .fencing-mb-input span {
    color: #9aa0a6;
}

.fc-measurement-locked-gate-only .fencing-qty-btn {
    color: #9aa0a6;
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

/* Main Slat: Add Gate / Gate Options until Step 2 Gate ONLY is selected */
#btn-gate.fc-slat-gate-requires-gate-only,
.fencing-btn-modal[data-key="gate"].fc-slat-gate-requires-gate-only {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

#btn-gate.fc-slat-gate-requires-gate-only span,
.fencing-btn-modal[data-key="gate"].fc-slat-gate-requires-gate-only span {
    color: #9aa0a6;
}

@media print {
    .btn-fc {
        display: none !important;
    }
}
