/* Compare Page Styles */
.compare-container {
    max-width: 1280px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: white;
}

.compare-header {
    text-align: left;
    margin-bottom: 2rem;
}

.compare-header h1 {
    font-size: 1.75rem;
    color: var(--text-main);
    font-weight: 700;
}

/* Redesigned Compare Table */
.compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.compare-table th,
.compare-table td {
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
    text-align: left;
    vertical-align: top;
    background: #fff;
}

/* Sticky Header Row */
.compare-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-bottom: 2px solid var(--primary);
}

/* Specification Column Headers */
.compare-table th:first-child,
.compare-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 11;
    background: #f8fafc;
    width: 180px;
    min-width: 180px;
    font-weight: 600;
    color: var(--primary);
    border-right: 2px solid #e2e8f0;
}

@media (max-width: 768px) {
    .compare-table {
        min-width: 700px;
    }

    .compare-table th:first-child,
    .compare-table td:first-child {
        width: 130px;
        min-width: 130px;
        font-size: 0.85rem;
    }
}

/* Ensure corner stays on top */
.compare-table thead th:first-child {
    z-index: 20;
    background: #f1f5f9;
}

/* Model Column Header Styling */
.model-header {
    text-align: center;
    vertical-align: bottom !important;
    padding: 1rem !important;
    min-width: 250px;
}

.model-img {
    width: 150px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 0.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.model-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block;
    text-decoration: none;
}

.model-title:hover {
    text-decoration: underline;
}

.model-price {
    font-size: 1.1rem;
    color: var(--secondary);
    font-weight: 700;
    display: block;
    margin-bottom: 0.8rem;
}

.remove-btn {
    font-size: 0.85rem;
    color: #ef4444;
    background: #fff;
    border: 1px solid #ef4444;
    padding: 0.4rem 1rem;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-btn:hover {
    background: #ef4444;
    color: white;
}

.add-placeholder {
    text-align: center;
    padding: 1.5rem !important;
    vertical-align: middle !important;
    background: #f9fafb !important;
}

.btn-add-tractor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    border: 2px dashed #cbd5e1;
    color: #cbd5e1;
    font-size: 2rem;
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.add-placeholder p {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
}

.btn-add-tractor:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #eff6ff;
    transform: scale(1.05);
}

.section-row {
    background: #f1f5f9 !important;
    font-weight: 800;
    color: var(--text-main);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    padding: 0.75rem 1rem !important;
    border-bottom: 2px solid #e2e8f0;
}

/* Modal Styles specific to Compare Page overrides */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    padding: 1.5rem;
}

.modal-content {
    background: #fff;
    padding: 1.5rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* FORCE OVERRIDE components.css for specific modal looks if needed */
.modal-header {
    background: #fff !important;
    color: var(--primary) !important;
    padding: 0 0 0.75rem 0 !important;
    display: block !important;
    text-align: center;
    border-bottom: none !important;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--primary) !important;
    font-weight: 800;
    font-family: var(--font-display);
    margin-bottom: 0.25rem;
}

.modal-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* Close Modal Button */
.close-modal {
    position: absolute !important;
    top: 0.75rem !important;
    right: 0.75rem !important;
    background: #f1f5f9 !important;
    border: none !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    z-index: 10;
}

.close-modal:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.375rem;
    margin-left: 0.25rem;
    text-align: left;
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    color: var(--text-main);
    background: #f8fafc;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.125rem;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(24, 79, 159, 0.1);
}

.btn-modal-submit {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.btn-modal-submit:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-modal-submit:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(5px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}