* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(rgba(200, 0, 0, 0.719), rgba(150, 0, 0, 0.85)), url('MF8S.jpg') center/cover no-repeat fixed;
    min-height: 100vh;
    padding-top: 60px; /* Space for fixed contacts bar */
    background-color: #c80000; /* Fallback red color */
}

/* Fixed Contacts Bar */
.contacts-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px 20px;
}

.contacts-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-label {
    font-weight: 600;
    color: #333;
}

.contact-link {
    color: #c80000;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: #a00000;
    text-decoration: underline;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 20px;
    padding: 10px 0;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin: 0;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
    color: white;
    font-size: 0.9em;
}

.breadcrumbs li:not(:last-child)::after {
    content: '›';
    margin-left: 10px;
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumbs a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.breadcrumbs a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.breadcrumbs li[aria-current="page"] {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Main Header */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 30px 30px 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.logo-section {
    flex-shrink: 0;
}

.mf-logo {
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

.header-text {
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.main-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #c80000;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.main-header h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #d32a2a;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1em;
    color: #333;
    opacity: 0.9;
}

/* Intro text block */
.intro-text {
    margin-top: 15px;
    margin-bottom: 10px;
    color: #333;
    font-size: 0.95em;
    line-height: 1.6;
}

.intro-text p {
    margin-bottom: 10px;
}

.intro-text strong {
    color: #c80000;
}

/* Bottom text */
.bottom-text {
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 0.2em;
    color: #333;
    opacity: 0.9;
}

/* Search Section */
.search-section {
    margin-top: 20px;
}

.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #c80000;
}

.search-btn {
    padding: 12px 25px;
    background: #c80000;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.search-btn:hover {
    background: #a00000;
    transform: translateY(-1px);
}

.search-btn:active {
    transform: translateY(0);
}

.clear-search-btn {
    padding: 12px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.clear-search-btn:hover {
    background: #5a6268;
}

.search-results {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9em;
    color: #333;
    display: none;
}

.search-results.show {
    display: block;
}

/* Loading Indicator */
.loading {
    text-align: center;
    color: white;
    padding: 40px;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    background: #ff4444;
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

/* Table Container */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(135deg, #c80000 0%, #a00000 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
}

.checkbox-col {
    width: 50px;
    text-align: center;
}

tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: #f5f5f5;
}

tbody tr:nth-child(even) {
    background-color: #fafafa;
}

tbody tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

td {
    padding: 12px 15px;
    font-size: 0.9em;
}

td:first-child {
    text-align: center;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #c80000;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 20px;
}

.close:hover,
.close:focus {
    color: #000;
}

.modal-content h2 {
    color: #c80000;
    margin-bottom: 20px;
    padding-right: 30px;
}

.modal-content h3 {
    color: #333;
    margin: 20px 0 10px 0;
    font-size: 1.1em;
}

/* Selected Items Section */
.selected-items-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #c80000;
}

.selected-items-table-container {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.selected-items-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9em;
}

.selected-items-table thead {
    background: #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.selected-items-table th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #c80000;
    font-size: 0.9em;
}

.selected-items-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e0e0e0;
}

.selected-items-table tbody tr:hover {
    background-color: #f9f9f9;
}

.selected-item-row {
    transition: background-color 0.2s ease;
}

.selected-summary-row {
    background: #f5f5f5;
    font-weight: 600;
}

.selected-summary-row td {
    border-top: 2px solid #c80000;
}

.selected-summary-row td:last-child {
    text-align: right;
}

.quantity-input {
    width: 80px;
    padding: 6px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
}

.quantity-input:focus {
    outline: none;
    border-color: #c80000;
}

.max-quantity-hint {
    display: block;
    font-size: 0.75em;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #c80000;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn-order {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, #c80000 0%, #a00000 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(200, 0, 0, 0.4);
}

.btn-order:active {
    transform: translateY(0);
}

.btn-cancel {
    flex: 1;
    padding: 14px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-cancel:hover {
    background: #5a6268;
}

.form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    display: none;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .contacts-content {
        flex-direction: column;
        gap: 10px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .main-header h1 {
        font-size: 2em;
    }

    .search-container {
        flex-direction: column;
    }

    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 600px;
    }

    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* Scrollbar Styling */
.selected-items-list::-webkit-scrollbar,
.table-container::-webkit-scrollbar {
    width: 8px;
}

.selected-items-list::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.selected-items-list::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.selected-items-list::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* SEO Content - Hidden visually but accessible to search engines */
.seo-content {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    /* Keep visibility visible for search engines, but position off-screen */
    visibility: visible;
    opacity: 0;
}

.seo-content .part-item {
    margin-bottom: 10px;
}

.seo-content .part-number {
    font-weight: 600;
}

/* Footer Styles */
.footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 20px;
    margin-top: 50px;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-text {
    color: #333;
    font-size: 1.1em;
    margin: 0;
}

.footer-logo-link {
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.footer-logo-link:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.intrac-logo {
    max-height: 150px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .footer {
        padding: 20px 15px;
    }
    
    .footer-text {
        font-size: 1em;
    }
    
    .intrac-logo {
        max-height: 150px;
    }
}
