/* Calculator Modal Styles */
.calc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.calc-modal-overlay.active {
    display: flex;
}

.calc-modal-content {
    background: #fff;
    width: 95%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 8px;
    position: relative;
    overflow-y: auto;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.calc-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #333;
}

/* Header Section */
.calc-header-block {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.calc-header-info h2 {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
}

.calc-header-info p {
    font-size: 14px;
    color: #666;
    margin: 5px 0 0 0;
}

.calc-toggles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toggle-group {
    display: flex;
    gap: 15px;
    border-top: 1px solid #eee;
    padding-top: 5px;
}

.toggle-group:first-child {
    border-top: none;
    padding-top: 0;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    /* Slightly smaller to match denseness */
    font-weight: 700;
    color: #444;
    /* Darker than green for non-active states usually, but keeping user preference */
    cursor: pointer;
}

.toggle-item input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #008060;
}

/* Sections */
.calc-section {
    margin-bottom: 25px;
}

.calc-section h4 {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
}

/* Quantity Input */
.inline-qty-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.qty-input-box {
    display: flex;
    align-items: center;
    gap: 15px;
}

.qty-input-box input {
    width: 160px !important;
    padding: 5px 10px;
    border: 2px solid #eee;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

/* Print Locations Grid */
.print-locations-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.1fr 1.1fr 0.7fr !important;
    gap: 5px !important;
}

.location-item {
    border: 2px solid #eee;
    padding: 4px !important;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.location-item.active {
    border: 2px solid #008060;
    background: #f9fdfc;
}

.location-item img {
    width: 100% !important;
    height: 180px !important;
    object-fit: contain !important;
    margin-bottom: 0 !important;
}

.location-item span {
    position: absolute !important;
    bottom: 5px !important;
    left: 0 !important;
    width: 100% !important;
    display: block !important;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.6) !important;
    padding: 2px 0 !important;
    z-index: 6;
}

.selection-box {
    position: absolute;
    bottom: 5px !important;
    left: 5px !important;
    width: 22px;
    height: 22px;
    border: 1px solid #333;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 7 !important;
    transition: all 0.2s;
}

/* Selection Indicator Style (Single Mode: Circular Radio) */
.print-locations-grid.single-mode .selection-box {
    border-radius: 50% !important;
}

.print-locations-grid.single-mode .location-item.active .selection-box {
    border-color: #008060 !important;
}

.print-locations-grid.single-mode .location-item.active .selection-box::before {
    content: '';
    width: 12px;
    height: 12px;
    background: #008060;
    border-radius: 50%;
    transform: none;
    position: static;
}

/* Selection Indicator Style (Multi Mode: Square Cross) */
.print-locations-grid.multi-mode .selection-box {
    border-radius: 2px !important;
}

.print-locations-grid.multi-mode .location-item.active .selection-box {
    border-color: #333 !important;
}

.print-locations-grid.multi-mode .location-item.active .selection-box::before,
.print-locations-grid.multi-mode .location-item.active .selection-box::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: #333;
    top: 50%;
    left: 0;
}

.print-locations-grid.multi-mode .location-item.active .selection-box::before {
    transform: translateY(-50%) rotate(45deg);
}

.print-locations-grid.multi-mode .location-item.active .selection-box::after {
    transform: translateY(-50%) rotate(-45deg);
}


/* Print Method Rows Layout */
.print-method-rows {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #eee;
}

.method-line {
    display: flex;
    align-items: center;
    padding: 1px 15px !important;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.method-line.active {
    background: #f9fdfc;
}

.method-line .toggle-item {
    flex: 0 0 200px;
    margin: 0;
}

.method-preview {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
    padding-left: 20px;
    border-left: 1px solid #eee;
}

.method-preview img {
    height: 32px;
    width: auto;
}

.method-preview .method-label {
    font-size: 14px !important;
    color: #666;
}

.method-preview .method-label small {
    font-size: 14px !important;
}

/* Comparison Results Box */
.calc-results-box {
    background: #f9fdfc;
    border: 1px solid #e0f2f1;
    border-radius: 8px;
    padding: 1px 20px !important;
    margin-top: 15px !important;
}

.calc-results-box h3 {
    color: #008060;
    font-size: 20px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1px !important;
    margin-top: 1px !important;
}

.result-method {
    margin-bottom: 1px !important;
    margin-top: 1px !important;
}

.result-method h5 {
    font-size: 16px;
    font-weight: 800;
    color: #cc7a00;
    margin-bottom: 1px !important;
    margin-top: 1px !important;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 1px 0 !important;
    border-bottom: 1px solid #e0f2f1;
}

.result-row.total {
    border-bottom: none;
    font-weight: 800;
    font-size: 18px;
    color: #008060;
    margin-top: 5px;
}

.result-label {
    font-size: 14px;
}

.result-val {
    font-size: 14px;
}

.result-val.price {
    font-size: 20px;
}


/* Multi-location extra complexity */
.multi-location-setup {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.location-column {
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.3s;
}

.location-column.active {
    opacity: 1;
    pointer-events: auto;
}

.location-column .column-title {
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 10px;
}

/* Footer Buttons */
.calc-footer {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn-contact,
.btn-manager {
    flex: 1;
    padding: 12px;
    background: #00843d;
    /* Green per user request */
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 16px;
}

.btn-contact:hover,
.btn-manager:hover {
    background: #00662f;
}

.btn-order {
    flex: 1;
    padding: 12px;
    background: #f08c00;
    /* Orange per user request */
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 16px;
}

.btn-order:hover {
    background: #d67a00;
}

/* Price Table Popup Link - Hidden ONLY inside the calculator modal */
.calc-modal-content .price-table-link-wrap {
    display: none !important;
}

.calc-modal-content .price-table-toggle {
    display: none;
}

.price-popup {
    display: none !important;
}

.price-popup-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    font-weight: bold;
}

.close-popup:hover {
    color: #000;
}

.table-scroll {
    overflow-x: auto;
    margin-top: 15px;
}

.simple-price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 600px;
}

.simple-price-table th,
.simple-price-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.simple-price-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.simple-price-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* ===== Multi-location Settings Grid ===== */
.multi-settings-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-top: 15px;
    border: 1px solid #ccc;
}

.settings-column {
    border-right: 1px solid #ccc;
    background: #f5f5f5;
    opacity: 0.5;
    transition: all 0.2s;
}

.settings-column:last-child {
    border-right: none;
}

.settings-column.active {
    background: #fff;
    opacity: 1;
}

.column-header {
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    padding: 10px 8px;
    border-bottom: 2px solid #333;
    color: #000;
    background: #f0f0f0;
}

.settings-column.active .column-header {
    background: #fff;
    border-bottom-color: #000;
}

.radio-settings-list {
    padding: 0;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    color: #999;
}

.radio-item:last-child {
    border-bottom: none;
}

.settings-column.active .radio-item {
    color: #333;
}

.radio-item input[type="radio"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: #333;
}