/* ============================================
CATALOG STYLES - Autopolka (COMPLETE FULL)
============================================ */
:root {
    --primary: #293241;
    --primary-hover: #e63900;
    --primary-light: #f0f0f0;
    --primary-border: #797979;
    --primary-shadow: rgba(255, 64, 0, 0.15);
    --secondary: #6c757d;
    --success: #28a745;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --border: #e0e0e0;
    --border-light: #f1f1f1;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --container-max: 1620px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #fff;
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.container { max-width: var(--container-max); margin: 0 auto; padding: 16px; }

/* ============================================
HEADER GRID (ГЛАВНАЯ)
============================================ */
.header-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.header-grid .brand-selector,
.header-grid .code-search-block {
    background: transparent url(/autopolka/desktop/images/osago_desktop2.png) center/cover no-repeat !important;
    border: 1px solid #e4e4e4;
    border-radius: 6px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.header-grid .brand-selector-title,
.header-grid .search-title {
    font-size: 28px;
    font-weight: 700;
    color: #FF4000;
    margin-bottom: 8px;
    line-height: 1.2;
}

.header-grid .brand-selector-subtitle,
.header-grid .search-subtitle {
    font-size: 16px !important;
    color: #666;
    margin-bottom: 20px;
    border-left: 3px solid #ff4000;
    padding-left: 12px;
    line-height: 1.4;
}

.brand-controls-row,
.search-controls-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: auto;
    flex-wrap: wrap;
}

.brand-type { display: flex; gap: 20px; }

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.radio-label input[type="radio"]:checked + span {
    color: var(--primary);
    font-weight: 700;
}

.brand-select-wrapper {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.brand-select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.brand-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-shadow);
}

.brand-select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 11px;
}

/* SEARCH DROPDOWN */
.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    width: 18px;
    height: 18px;
}

#globalEngineSearch {
    width: 100%;
    padding: 12px 36px 12px 40px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: #fafafa;
}

#globalEngineSearch:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-shadow);
    background: #fff;
}

#clearSearch {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #f0f0f0;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
}

#clearSearch:hover { background: #e0e0e0; }

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-height: 320px;
    overflow-y: auto;
    z-index: 999;
    display: none;
}

.search-dropdown.active { display: block; }

.sr-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.15s;
}

.sr-item:hover { background: #fafafa; }
.sr-item:last-child { border-bottom: none; }
.sr-code { font-weight: 700; color: var(--primary); }
.sr-meta { font-size: 13px; color: var(--text-secondary); margin-left: 8px; }
.sr-empty, .sr-error { padding: 16px; text-align: center; color: var(--text-muted); font-style: italic; }
.sr-error { background: #fff0f0; color: #c0392b; font-style: normal; font-size: 14px; }

.sr-no-match {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.sr-no-match-text { margin-bottom: 14px; }

.sr-no-match-btn {
    display: inline-block;
    padding: 10px 22px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.sr-no-match-btn:hover { background: var(--primary-hover); }

/* VIN BUTTON */
.btn-vin {
    padding: 12px 18px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px var(--primary-shadow);
}

.btn-vin:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--primary-shadow);
}

/* REQUEST SECTION */
@keyframes requestPulse {
    0% { box-shadow: var(--shadow); border-color: #e4e4e4; }
    15% { box-shadow: 0 0 16px rgba(255, 64, 0, 0.35); border-color: rgba(255, 64, 0, 0.5); }
    50% { box-shadow: 0 0 22px rgba(255, 64, 0, 0.45); border-color: rgba(255, 64, 0, 0.7); }
    75% { box-shadow: var(--shadow); border-color: #e4e4e4; }
    100% { box-shadow: var(--shadow); border-color: #e4e4e4; }
}

.request-section {
    background: transparent url(https://autopolka.ru/autopolka/desktop/images/osago_desktop1.png) center/cover no-repeat !important;
    border: 1px solid #e4e4e4;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 24px;
    animation: requestPulse 4s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.request-text { flex: 1; min-width: 280px; }

.request-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #555;
    text-shadow: 0 1px 3px rgba(255,255,255,0.8);
    line-height: 1.2;
}

.request-subtitle {
    font-size: 14px !important;
    color: #555;
    margin: 0;
    border-left: 2px solid #293241;
    padding-left: 10px;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

.btn-request {
    display: inline-block;
    padding: 10px 22px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    text-transform: none;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-request:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-shadow);
}

/* BRANDS SECTION */
.brands-section {
    background: var(--card-bg);
    border: 1px solid #e4e4e4;
    border-radius: 6px;
    position: relative;
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 32px;
}

.brands-section-title {
    font-size: 28px;
    font-weight: 700;
    color: #555;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--primary);
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: #f0f0f0;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    min-height: 48px;
}

.brand-link:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-shadow);
}

.brand-link:active { transform: translateY(0); }
.brand-link.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* TABS */
.tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    transition: opacity 0.2s;
    margin-bottom: 24px;
}

.tab {
    padding: 12px 24px;
    background: var(--primary-light);
    color: var(--primary);
    border: 2px solid var(--primary-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
    min-width: 120px;
}

.tab:active { transform: scale(0.98); }

.tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px var(--primary-shadow);
}

/* ALPHABET FILTER */
.alphabet-filter {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 8px;
    margin: 0 0 24px;
    padding: 12px 32px;
    background: var(--primary-light);
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.alpha-btn {
    min-width: 0;
    padding: 10px 0;
    background: rgba(255,255,255,0.6);
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.alpha-btn:hover {
    background: #fff;
    border-color: var(--primary);
    color: var(--primary);
}

.alpha-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.brand-link.hidden-by-alpha { display: none !important; }

/* ALPHABET INLINE (в brands-section) */
.alphabet-inline {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 20px !important;
}

.alphabet-inline .alpha-btn {
    background: #f0f0f0;
    border: 2px solid transparent;
}

.alphabet-inline .alpha-btn:hover {
    background: #fff;
    border-color: var(--primary);
}

.alphabet-inline .alpha-btn.active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

/* ============================================
PAGE HEADER (СТРАНИЦЫ МАРОК)
============================================ */
.page-header {
    background: var(--card-bg);
    border: 1px solid #e4e4e4;
    border-radius: 6px;
    position: relative;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);

}

.header-top {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 50%;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.home-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--primary-shadow);
}

.home-btn svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: #555;
    line-height: 1.2;
}

/* SEARCH SECTION (СТРАНИЦЫ МАРОК) */
.search-section {
    background: var(--card-bg);
    border: 1px solid #e4e4e4;
    border-radius: 6px;
    position: relative;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.search-label {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.search-form {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: all 0.2s ease;
    background: #fafafa;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-shadow);
    background: #fff;
}

.btn {
    padding: 14px 28px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-transform: none;
}

.btn:active { transform: scale(0.97); }

.btn-reset {
    background: var(--secondary) !important;
    font-size: 14px !important;
    padding: 12px 20px !important;
    border-radius: var(--radius-sm) !important;
    color: #fff; 
}

.btn-reset:hover { background: #d4d4d4 !important; color: #fff; }

.search-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    transition: opacity 0.2s;
}

.filter-tag {
    padding: 10px 18px;
    background: var(--primary-light);
    color: var(--primary);
    border: 2px solid var(--primary-border);
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tag:active { transform: scale(0.96); }

.filter-tag.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px var(--primary-shadow);
}

/* ============================================
ENGINE SECTIONS (СТРАНИЦЫ МАРОК)
============================================ */
.engine-section {
    background: var(--card-bg);
    border: 1px solid #e4e4e4;
    border-radius: 6px;
    position: relative;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
    scroll-margin-top: 120px;
    transition: all 0.3s ease;
}

.engine-section-header {
    background: #fafafa;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.engine-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.engine-section-header:has(.petrol-badge) .engine-section-title { color: #293241; }
.engine-section-header:has(.diesel-badge) .engine-section-title { color: #28a745; }

.engine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 20px;
}

.engine-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: #f0f0f0;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    min-height: 48px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    box-shadow: none;
}

.engine-item:active { transform: translateY(0);}

.engine-item:hover {
    background: var(--primary);
    color: #fff ;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-shadow);
}

.engine-item:hover .engine-code { color: #fff !important; }

.engine-code {
    line-height: 1.3;
    word-break: break-word;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: inherit;
}

.diesel-badge, .petrol-badge {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.diesel-badge { background: var(--success); color: #fff; }
.petrol-badge { background: var(--primary); color: #fff; }

.section-label {
    font-size: 22px;
    font-weight: 700;
    margin: 32px 0 20px;
    color: #555;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary);
    transition: opacity 0.3s ease;
}

/* ============================================
MODAL
============================================ */
.modal-overlay {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.65) !important;
    z-index: 1000 !important;
    backdrop-filter: blur(3px) !important;
    padding: 16px !important;
    align-items: center !important;
    justify-content: center !important;
    animation: fadeIn 0.25s ease !important;
}

.modal-overlay.active { display: flex !important; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--card-bg) !important;
    border: 1px solid #e4e4e4 !important;
    border-radius: 6px !important;
    position: relative !important;
    width: 100% !important;
    max-width: 640px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25) !important;
    animation: slideUp 0.25s ease !important;
    display: flex !important;
    flex-direction: column !important;
}

@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
    background: var(--primary) !important;
    color: #fff !important;
    padding: 18px 24px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
}

.modal-title { font-size: 18px !important; font-weight: 700 !important; color: #fff !important; }

.modal-close {
    background: rgba(255,255,255,0.2) !important;
    border: none !important;
    color: #fff !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    font-size: 24px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s !important;
}

.modal-close:active { background: rgba(255,255,255,0.4) !important; }

.modal-body {
    display: flex !important;
    gap: 24px !important;
    padding: 24px !important;
    flex: 1 !important;
    align-items: stretch !important;
}

.modal-info {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    min-width: 0 !important;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.info-row:last-child { border-bottom: none; }
.info-label { font-size: 15px; color: var(--text-secondary); font-weight: 500; }
.info-value { font-size: 17px; font-weight: 700; color: var(--text-primary); }

.info-value.code {
    font-family: monospace;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--primary-border);
}

.fuel-badge-modal {
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
}

.fuel-badge-modal.petrol { background: var(--primary-light); color: var(--primary); }
.fuel-badge-modal.diesel { background: #d4edda; color: var(--success); }

.modal-image {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fafafa !important;
    border-radius: var(--radius-sm) !important;
    padding: 16px !important;
    min-width: 0 !important;
}

.modal-image img {
    max-width: 240px !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1)) !important;
}

.modal-footer {
    padding: 20px 24px !important;
    border-top: 1px solid var(--border-light) !important;
    display: flex !important;
    justify-content: center !important;
    background: #fafafa !important;
}

.btn-modal {
    padding: 16px 36px !important;
    font-size: 15px !important;
    width: 100% !important;
    max-width: 280px !important;
    text-align: center !important;
    background: var(--primary) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
    text-transform: none !important;
}

.btn-modal:hover { transform: translateY(-1px) !important; }

/* VIN MODAL */
.vin-input-row {
    width: 100%;
    margin-bottom: 16px;
}

#vinInput {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: 'Courier New', Consolas, monospace;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-primary);
    background: #fafafa;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

#vinInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-shadow);
    background: #fff;
}

#vinInput::placeholder {
    color: #aaa;
    text-transform: none;
    letter-spacing: normal;
    font-family: -apple-system, sans-serif;
}

#vinDecodeBtn {
    width: 100%;
    padding: 14px 20px;
    margin-top: 4px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#vinDecodeBtn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-shadow);
}

#vinDecodeBtn:active { transform: translateY(0); }

#vinDecodeBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#vinDecodeBtn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#vinResult {
    margin-top: 16px;
    padding: 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
    text-align: center;
}

#vinResult .label {
    font-size: 14px;
    color: #166534;
    font-weight: 500;
}

#vinResult .code {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 700;
    color: #15803d;
    background: #dcfce7;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #bbf7d0;
}

#vinError {
    margin-top: 16px;
    padding: 16px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: var(--radius-sm);
    text-align: center;
    color: #7c2d12;
    font-size: 14px;
    line-height: 1.5;
}

#vinError strong {
    display: block;
    font-size: 15px;
    color: #9a3412;
    margin-bottom: 6px;
}

#vinError a {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    transition: background 0.2s;
}

#vinError a:hover {
    background: var(--primary-hover);
}

/* COUNTRY GROUPING */
.grouped-view { display: none; }

.country-section {
    margin-bottom: 28px;
    animation: fadeIn 0.3s ease;
}

.country-title {
    font-size: 18px;
    font-weight: 700;
    color: #ff4000;
    margin-bottom: 14px;
    padding-left: 12px;
    border-left: 3px solid var(--primary);
}

.country-section + .country-section {
    border-top: 1px solid #e8e8e8;
    padding-top: 20px;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 16px;
    font-style: italic;
}

/* ============================================
MOBILE ADAPTIVE
============================================ */
@media (max-width: 992px) {
    .header-grid { grid-template-columns: 1fr; }
    .header-grid .brand-selector,
    .header-grid .code-search-block { padding: 24px; }
    .brand-controls-row,
    .search-controls-row { flex-direction: column; align-items: stretch; gap: 12px; }
    .brand-type { justify-content: center; }
    .brand-select-wrapper { max-width: 100%; }
    .brands-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .request-section { flex-direction: column; align-items: flex-start; gap: 12px; }
    .btn-request { width: 100%; text-align: center; }
}

@media (max-width: 768px) {
    .container { padding: 12px; }
    .header-grid .brand-selector,
    .header-grid .code-search-block { padding: 20px; }
    .brand-selector-title,
    .search-title { font-size: 22px; }
    .brands-section { padding: 20px; margin-bottom: 20px; }
    .brands-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .brand-link { padding: 10px 12px; font-size: 13px; min-height: 44px; }
    .page-header { padding: 20px; margin-bottom: 20px; }
    .page-title { font-size: 24px; }
    .header-top { gap: 12px; margin-bottom: 20px; }
    .home-btn { width: 40px; height: 40px; }
    .home-btn svg { width: 20px; height: 20px; }
    .tab { min-width: auto; padding: 10px 16px; font-size: 14px; }
    .search-section { padding: 20px; margin-bottom: 20px; }
    .search-form { flex-direction: column; }
    .btn { width: 100%; padding: 16px; }
    .search-controls { flex-direction: column; align-items: stretch; }
    .filter-tags { justify-content: center; }
    .engine-grid { grid-template-columns: repeat(2, 1fr); }
    .engine-item { padding: 18px 12px; min-height: 64px; }
    .engine-code { font-size: 14px; }
    .engine-section-header { padding: 16px 18px; }
    .engine-section-title { font-size: 16px; }
    
    /* Модальные окна */
    .modal-overlay:not(#vinModalOverlay) {
        padding: 16px !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    #vinModalOverlay {
        padding: 20px 16px 16px 16px !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
    }
    #vinModalOverlay .modal {
        margin-top: 0 !important;
        border-radius: var(--radius) !important;
    }
    
    .modal-body { flex-direction: column-reverse !important; gap: 20px !important; padding: 20px !important; }
    .modal-image { order: -1 !important; min-height: 200px !important; padding: 16px !important; display: none !important; }
    .modal-footer { padding: 16px 20px 28px !important; }
    .btn-modal { max-width: 100% !important; }
}

@media (max-width: 380px) {
    .brands-grid { grid-template-columns: repeat(2, 1fr); }
    .engine-grid { grid-template-columns: 1fr; }
    .engine-section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .info-row { flex-direction: column; align-items: flex-start; gap: 6px; }
    .info-value { width: 100%; text-align: left; }
}

/* Утилиты */
.brands-section .tabs { margin-bottom: 24px; }
.brands-content-panel { animation: fadeIn 0.3s ease; }

/* === БЕЗОПАСНАЯ ВЕРСТКА МОДАЛКИ === */
.modal-footer {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 20px 24px !important;
}
#modalNotice {
    order: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: #fff7ed !important;
    border: 1px solid #fed7aa !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    text-align: center !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    color: #9a3412 !important;
    display: none !important;
}
#modalPriceBtn {
    order: 2 !important;
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 !important;
}










.modal-footer {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 20px 24px !important;
}
#modalNotice {
    order: 1 !important; 
    width: 100% !important;
    background: #fff7ed !important;
    border: 1px solid #fed7aa !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    text-align: center !important;
    font-size: 13px !important;
    color: #9a3412 !important;
    display: none !important;
}
#modalPriceBtn {
    order: 2 !important; 
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
}

.modal-footer{display:flex!important;flex-direction:column!important;align-items:center!important;gap:16px!important;padding:20px 24px!important}#modalNotice{order:1;width:100%;background:#fff7ed;border:1px solid #fed7aa;border-radius:8px;padding:12px 16px;text-align:center;font-size:13px;color:#9a3412;display:none}#modalPriceBtn{order:2;width:100%;max-width:320px;margin:0!important;text-align:center!important;display:flex!important;align-items:center!important;justify-content:center!important;text-decoration:none!important}

        @media (max-width: 768px) {
  .logo-line{
   display: none;
  }
  .header-cat-btn{
    margin-bottom: 20px !important;
  }
}

