/* Main Container */
.elevator-tool-container {
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-family: 'Segoe UI', sans-serif;
    color: #333;
}

/* Header & Tabs */
.elevator-header {
    background: #0073aa;
    color: #fff;
    padding: 20px 20px 0;
    border-radius: 8px 8px 0 0;
}

.elevator-header h2 {
    margin: 0 0 20px;
    color: #fff;
    text-transform: uppercase;
}

.elevator-tabs {
    display: flex;
    gap: 5px;
}

.tab-link {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 12px 20px;
    color: #fff;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-link.active {
    background: #fff;
    color: #0073aa;
}

.tab-pane {
    display: none;
    padding: 30px;
}

.tab-pane.active {
    display: block;
}

/* --- COMPONENTS TAB STYLES --- */
.components-wrapper {
    margin-top: 20px;
    border: 1px dashed #f39c12;
    /* Orange dashed border from reference */
    padding: 20px;
    background: #fffdf9;
    /* Very light warm background */
    border-radius: 5px;
}

/* Tab Navigation */
.comp-tabs-nav {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0px;
}

.comp-tab-link {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-bottom: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    font-weight: 600;
    color: #666;
    transition: all 0.2s;
    font-size: 14px;
    position: relative;
    top: 1px;
    /* Overlap border */
}

.comp-tab-link:hover {
    background: #f0f0f0;
    color: #333;
}

.comp-tab-link.active {
    background: #fff;
    color: #d35400;
    /* Darker Orange */
    border-color: #ddd;
    border-top: 3px solid #f39c12;
    /* Orange Top Highlight */
    border-bottom: 1px solid #fff;
    /* Hide bottom border */
    box-shadow: 0 -2px 3px rgba(0, 0, 0, 0.02);
}

/* Tab Content */
.comp-tab-pane {
    animation: fadeIn 0.3s ease-in-out;
    padding-top: 5px;
}

/* Tables */
.comp-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.comp-table th {
    background: #f2f2f2;
    /* Neutral Grey Header */
    color: #333;
    padding: 12px 15px;
    text-align: center;
    border: 1px solid #ddd;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.comp-table td {
    padding: 10px 15px;
    border: 1px solid #ddd;
    vertical-align: middle;
    color: #444;
    font-size: 0.95rem;
}

/* Zebra striping */
.comp-table tr:nth-child(even) {
    background-color: #fff;
}

.comp-table tr:nth-child(odd) {
    background-color: #fcfcfc;
}

.comp-table tr:hover {
    background-color: #fff8e1;
    /* Light Orange Tint on Hover */
}

/* Input Styles */
.comp-qty {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    width: 70px;
    font-weight: 600;
    color: #333;
    transition: all 0.2s;
}

.comp-qty:focus {
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.2);
    outline: none;
}

/* Prices */
.comp-price-col,
.comp-total-col {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
}

.comp-total {
    font-weight: 700;
    color: #e74c3c;
    /* Red for totals/money */
}

#comp-selected-list .comp-table th {
    background: #fdfdfd;
    color: #d35400;
    /* Orange Text for "Selected" Header */
    border-bottom: 2px solid #f39c12;
}

/* Hide default title in pane since tabs handle it */
.comp-cat-title {
    display: none;
}

/* Forms */
.section-block {
    margin-bottom: 30px;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 6px;
    background: #fff;
}

.highlight-block {
    background: #f8fcfd;
    border: 1px solid #b8e6f5;
}

.section-title {
    color: #0073aa;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-row.two-cols>* {
    flex: 1;
}

.form-row.three-cols>* {
    flex: 1;
}

.form-row.four-cols>* {
    flex: 1;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    gap: 15px;
}

.form-control {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-sep {
    font-weight: bold;
    color: #888;
}

/* Radio Cards (Image Selectors) */
.radio-cards {
    display: flex;
    gap: 15px;
}

.radio-card {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
}

.radio-card .card-content {
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    transition: all 0.2s;
    background: #fff;
}

.radio-card.selected .card-content {
    border-color: #0073aa;
    background: #eef7fb;
    color: #0073aa;
    font-weight: bold;
}

.card-image-placeholder {
    height: 60px;
    background: #eee;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
}

.card-image-placeholder .dashicons {
    font-size: 30px;
    width: 30px;
    height: 30px;
}

/* Preview Box (New) */
.elevator-preview-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

/* Config Mode Toggle (New) */
.config-mode-group {
    background: #f0f7ff;
    padding: 15px;
    border: 1px solid #cce5ff;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.config-mode-group label {
    font-weight: bold;
    color: #0073aa;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.config-mode-group input[type="radio"] {
    width: 20px;
    height: 20px;
}

/* Upgrade List Refinements */
.upgrade-group-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #444;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.upgrade-list {
    display: grid;
    gap: 15px;
    padding-bottom: 15px;
}

.upgrade-list.two-cols {
    grid-template-columns: 1fr 1fr;
}

.upgrade-item {
    background: #fdfdfd;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.upgrade-item.checkbox-item {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.upgrade-item label {
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.upgrade-item select,
.upgrade-item input[type="text"],
.upgrade-item input[type="number"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.item-price {
    font-size: 0.85rem;
    color: #e02b20;
    font-weight: 600;
    float: right;
}

.load-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.load-btn {
    padding: 5px 12px;
    border: 1px solid #ccc;
    background: #f9f9f9;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
}

.load-btn:hover {
    background: #e0e0e0;
}

.load-btn.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    font-weight: bold;
}

/* Elevator Type Visual Tabs */
.type-tab-card {
    background: #fff;
    position: relative;
    /* For checkmark */
    transition: all 0.2s ease-in-out;
}

.type-tab-card:hover {
    border-color: #0073aa !important;
    background: #f9f9fc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.type-tab-card.selected {
    border: 2px solid #0073aa !important;
    background: #eef7fb !important;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.2);
}

.type-tab-card.selected strong {
    color: #0073aa !important;
}

/* Checkmark Badge */
.type-tab-card.selected::after {
    content: "\f147";
    /* Dashicon yes */
    font-family: "dashicons";
    position: absolute;
    top: -10px;
    right: -10px;
    background: #0073aa;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .form-row.three-cols {
        flex-wrap: wrap;
    }

    .form-row.three-cols .form-group {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }

    .elevator-type-tabs {
        flexDirection: column;
    }
}

/* Responsive */
@media (max-width: 768px) {

    .form-row,
    .elevator-preview-container {
        flex-direction: column;
    }

    .upgrade-list.two-cols {
        grid-template-columns: 1fr;
    }

    .config-mode-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .elevator-tabs {
        flex-wrap: wrap;
    }

    .tab-link {
        flex: 1 1 45%;
        text-align: center;
        border-radius: 4px;
        margin-bottom: 5px;
    }
}

/* --- PRICING TABLE STYLES --- */
.pricing-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    border: 1px solid #eee;
}

.pricing-table tr {
    border-bottom: 1px solid #eee;
}

.pricing-table tr:last-child {
    border-bottom: none;
}

.pricing-table td {
    padding: 10px 15px;
    font-size: 0.95rem;
    color: #333;
}

.pricing-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: #444;
}

.pricing-table .total-row {
    background-color: #f9f9f9;
    font-weight: 700;
    border-top: 2px solid #ddd;
}

.pricing-table .total-row td {
    font-size: 1.1rem;
    color: #d32f2f;
}

.pricing-table .discount-row td {
    color: #27ae60;
}

.pricing-table .vat-row td {
    color: #e67e22;
}

#calculation-results h4 {
    margin-bottom: 20px;
    color: #0073aa;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    display: inline-block;
}

.hidden {
    display: none !important;
}

/* --- INITIAL STATE & CONTAINER STYLES --- */
.price-summary {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 15px;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
    color: #333;
}

.price-row:last-child {
    border-bottom: none;
}

.price-row span.amount {
    font-weight: 600;
    color: #444;
}

.price-row.total span.amount {
    color: #d32f2f;
    font-size: 1.2rem;
}

.price-row.discount span.amount {
    color: #27ae60;
}

.vat-option {
    padding-top: 20px;
}

.static-note {
    text-align: center;
}

.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 15px;
}

/* Cargo Specs Tabs (New) */
.cargo-fixed-specs {
    margin-bottom: 20px;
    padding: 15px;
    background: #fffcf5;
    border: 1px dashed #f0c36d;
    border-radius: 5px;
}

.cargo-specs-title {
    color: #d35400;
    font-weight: 600;
    margin-bottom: 10px;
}

.cargo-spec-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 10px;
}

.cargo-spec-tab,
.cargo-note-tab {
    padding: 8px 15px;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    font-weight: 600;
    color: #555;
    background: #eee;
    margin-right: 2px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    transition: background 0.2s, color 0.2s;
    font-size: 0.9em;
}

.cargo-spec-tab:hover,
.cargo-note-tab:hover {
    background: #f9f9f9;
}

.cargo-spec-tab.active,
.cargo-note-tab.active {
    background: #fffcf5;
    border-color: #f0c36d;
    border-bottom-color: #fffcf5;
    color: #d35400;
}

.cargo-spec-content,
.cargo-note-content {
    display: none;
    padding: 10px;
}

.cargo-spec-content.active,
.cargo-note-content.active {
    display: block;
}

.spec-list {
    list-style: square;
    margin-left: 20px;
    font-size: 0.9em;
    color: #333;
}

.spec-list li {
    margin-bottom: 5px;
}

/* Cargo Price Summary (Renamed to avoid conflict) */
.cargo-price-summary {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 15px;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cargo-price-summary .price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
    color: #333;
}

.cargo-price-summary .price-row:last-child {
    border-bottom: none;
}

.cargo-price-summary .price-row span.amount {
    font-weight: 600;
    color: #444;
}

.cargo-price-summary .price-row.total span.amount {
    color: #d32f2f;
    font-size: 1.2rem;
}

/* --- MAINTENANCE TAB STYLES --- */
.maintenance-container {
    max-width: 100%;
    margin: 0 auto;
}

.maint-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    border: 2px solid #ccc;
    font-size: 0.9rem;
}

.maint-table th,
.maint-table td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: center;
    vertical-align: middle;
}

.maint-head-purple th {
    background: #4a142c !important;
    color: #fff !important;
    text-transform: uppercase;
    font-size: 1.2rem;
    padding: 15px !important;
}

.maint-head-blue th {
    background: #005a8c !important;
    color: #fff !important;
    font-size: 0.8rem;
    padding: 8px !important;
    text-transform: uppercase;
}

.maint-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.maint-table tbody td.text-left {
    text-align: left;
    padding-left: 15px;
}

.maint-notes h4 {
    border-bottom: 1px solid #d35400;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.maint-notes ul li {
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Side-by-Side Summary Layout */
.comp-summary-wrapper {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: 3px solid #f39c12;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.comp-summary-left {
    flex: 2;
}

.comp-summary-right {
    flex: 1;
    border-left: 1px dashed #ddd;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .comp-summary-wrapper {
        flex-direction: column;
    }

    .comp-summary-right {
        border-left: none;
        border-top: 1px dashed #ddd;
        padding-left: 0;
        padding-top: 20px;
    }
}

/* --- IMAGE SELECTION & PREVIEWS --- */
.image-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.image-preview-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: #fdfdfd;
    text-align: center;
}

.image-preview-card h5 {
    margin: 0 0 10px;
    color: #2c3e50;
    font-size: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.img-preview-container {
    height: 200px;
    background: #eee;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px dashed transparent;
    transition: all 0.3s;
}

.img-preview-container:hover {
    border-color: #0073aa;
}

.img-preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.img-preview-container .placeholder-text {
    color: #999;
    font-size: 0.9rem;
}

.img-source-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-upload-img {
    background: #0073aa;
    color: #fff !important;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-reset-img {
    background: #e74c3c;
    color: #fff !important;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.hidden-file-input {
    display: none;
}