/* ===================================================================
   4TOCHKI-STYLE HORIZONTAL FILTER WIDGET
   =================================================================== */

.ft-filter-widget {
    position: relative;
    width: 100%;
    margin: 0 0 20px 0;
    font-family: inherit;
    box-sizing: border-box;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.08));
}

/* Header bar with angled tabs */
.ft-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0f4c9c;
    background: linear-gradient(90deg, #0b3877 0%, #17549f 60%, #1f64b8 100%);
    height: 42px;
    padding: 0 16px;
    border-radius: 4px 4px 0 0;
    position: relative;
    user-select: none;
}

.ft-header-left {
    display: flex;
    align-items: center;
    height: 100%;
}

.ft-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 0 20px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    transition: background-color 0.15s ease;
    text-decoration: none;
}

.ft-tab.active {
    background: #002d66;
    color: #ffffff;
}

.ft-tab.active::after {
    content: '';
    position: absolute;
    right: -14px;
    top: 0;
    width: 0;
    height: 0;
    border-top: 42px solid #002d66;
    border-right: 14px solid transparent;
    z-index: 2;
}

.ft-tab-tyre-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    background: url('/static/images/icons/tyre_icon.png') no-repeat center;
    background-size: contain;
}
/* Fallback tyre icon using CSS if image missing */
.ft-tab-tyre-icon:empty {
    border: 3px solid #fff;
    border-radius: 50%;
    box-sizing: border-box;
    position: relative;
}
.ft-tab-tyre-icon:empty::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    top: 5px;
    left: 5px;
}

.ft-header-link {
    color: #e2eeff;
    font-size: 14px;
    font-weight: 600;
    margin-left: 24px;
    text-decoration: none;
    transition: color 0.15s;
}
.ft-header-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.ft-help-link {
    color: #6fb0fc;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.ft-help-link:hover {
    color: #ffffff;
}

/* Filter Body / Panel */
.ft-body {
    background: #edf5fe;
    background: linear-gradient(180deg, #f0f7ff 0%, #e6f1fd 100%);
    border: 1px solid #c2dbf7;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 14px 18px 16px;
}

.ft-panel {
    display: none;
}
.ft-panel.active {
    display: block;
}

.ft-form {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 16px;
}

/* Column 1: Mode switch (по параметрам / по авто) */
.ft-mode-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 130px;
    padding-right: 12px;
    border-right: 1px solid #d2e4f7;
}

.ft-mode-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #295584;
    cursor: pointer;
    user-select: none;
}
.ft-mode-label input[type="radio"] {
    margin: 0;
    accent-color: #0b5fc2;
    cursor: pointer;
}
.ft-mode-label span {
    border-bottom: 1px dashed transparent;
}
.ft-mode-label:hover span {
    border-bottom-color: #295584;
}
.ft-mode-label.ft-mode-active {
    font-weight: 700;
    color: #0d447a;
}
.ft-mode-label:not(.ft-mode-active) {
    color: #628ab4;
}

/* Column 2: Size dropdowns (205 / 55 R 16) */
.ft-size-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ft-size-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ft-size-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid #7eaadb;
    border-radius: 50%;
    color: #2b6197;
    font-size: 12px;
    font-weight: 700;
    cursor: help;
    background: #fff;
    margin-right: 4px;
}

.ft-select {
    height: 34px;
    min-width: 78px;
    background: #ffffff;
    border: 1px solid #b7cde6;
    border-radius: 4px;
    padding: 0 8px;
    color: #222;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
    transition: border-color 0.15s;
}
.ft-select:focus {
    border-color: #0077d7;
    box-shadow: 0 0 0 2px rgba(0,119,215,0.2);
}

.ft-slash {
    font-size: 16px;
    font-weight: 700;
    color: #5579a3;
    padding: 0 2px;
}
.ft-r-letter {
    font-size: 15px;
    font-weight: 700;
    color: #5579a3;
    padding: 0 2px;
}

/* Column 3: Checkboxes in 2 columns */
.ft-options-col {
    flex: 1;
    min-width: 240px;
    padding: 0 12px;
}

.ft-options-grid {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 6px 18px;
    align-items: center;
}

.ft-check-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 13px !important;
    color: #1e3a5a !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    user-select: none !important;
    white-space: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    line-height: 1.3 !important;
    position: relative !important;
}
.ft-check-item::before,
.ft-check-item::after {
    display: none !important;
    content: none !important;
}

.ft-check-item input[type="checkbox"],
.ft-check-item input[type="radio"] {
    position: static !important;
    left: auto !important;
    top: auto !important;
    opacity: 1 !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    accent-color: #0066cc !important;
    pointer-events: auto !important;
    appearance: auto !important;
    -webkit-appearance: auto !important;
    z-index: 2 !important;
    display: inline-block !important;
}

.ft-ico {
    display: inline-block;
    font-size: 14px;
    line-height: 1;
}

/* Studded popup box under winter checkbox */
.ft-winter-wrap {
    position: relative;
}
.ft-studded-popup {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #ffffff;
    border: 1px solid #c2dbf7;
    border-radius: 4px;
    padding: 4px 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 30;
    white-space: nowrap;
    display: none;
}
.ft-studded-popup.is-visible {
    display: block;
}

/* Column 4: Action buttons (Find + Reset) */
.ft-actions-col {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Orange slanted button like 4tochki */
.ft-btn-submit {
    height: 38px;
    padding: 0 28px;
    background: #ff8500;
    background: linear-gradient(180deg, #ff941a 0%, #f07400 100%);
    border: 0;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(240, 116, 0, 0.35);
    transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
    /* Slanted parallelogram shape */
    transform: skewX(-14deg);
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ft-btn-submit span {
    transform: skewX(14deg); /* Unskew text */
    letter-spacing: 0.5px;
}
.ft-btn-submit:hover {
    filter: brightness(1.06);
    box-shadow: 0 3px 8px rgba(240, 116, 0, 0.45);
}
.ft-btn-submit:active {
    transform: skewX(-14deg) translateY(1px);
}

/* Reset button with cross */
.ft-btn-reset {
    height: 38px;
    width: 38px;
    background: #cddff4;
    border: 0;
    color: #4b6e94;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transform: skewX(-14deg);
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.ft-btn-reset:hover {
    background: #b5d1f1;
    color: #1a426f;
}

/* Wheels adjustments */
.ft-wheels-size-col .ft-select {
    min-width: 90px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .ft-form {
        flex-wrap: wrap;
        gap: 12px;
    }
    .ft-actions-col {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .ft-header {
        height: auto;
        padding: 8px 10px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .ft-tab {
        padding: 6px 12px;
        font-size: 13px;
    }
    .ft-tab.active::after {
        display: none;
    }
    .ft-header-link {
        margin-left: 10px;
        font-size: 12px;
    }
    .ft-mode-col {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #d2e4f7;
        padding-bottom: 8px;
        flex-direction: row;
        gap: 16px;
    }
    .ft-size-row {
        flex-wrap: wrap;
    }
    .ft-options-grid {
        grid-template-columns: 1fr;
    }
    .ft-actions-col {
        justify-content: stretch;
    }
    .ft-btn-submit {
        flex: 1;
    }
}

/* ===================================================================
   4TOCHKI SIDEBAR CARD STYLING
   =================================================================== */

.ft-side-card {
    background: #edf5fe;
    background: linear-gradient(180deg, #f0f7ff 0%, #e6f1fd 100%);
    border: 1px solid #c2dbf7;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.ft-side-header {
    background: linear-gradient(90deg, #0b3877 0%, #17549f 100%);
    padding: 10px 14px;
    display: flex;
    align-items: center;
}

.ft-side-header-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ft-side-body {
    padding: 14px;
}

.ft-side-section {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #d4e4f7;
}
.ft-side-section:last-of-type {
    border-bottom: none;
    margin-bottom: 10px;
    padding-bottom: 0;
}

.ft-side-subtitle {
    font-size: 13px;
    font-weight: 700;
    color: #174a80;
    margin-bottom: 8px;
}

.ft-side-field {
    margin-bottom: 8px;
}
.ft-side-field:last-child {
    margin-bottom: 0;
}
.ft-side-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #5579a3;
    margin-bottom: 3px;
}

.ft-side-input,
.ft-side-select {
    width: 100%;
    height: 32px;
    background: #ffffff;
    border: 1px solid #b7cde6;
    border-radius: 4px;
    padding: 0 8px;
    color: #222;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.ft-side-input:focus,
.ft-side-select:focus {
    border-color: #0077d7;
    box-shadow: 0 0 0 2px rgba(0,119,215,0.2);
}

.ft-side-checks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ft-side-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ft-price-input {
    flex: 1;
    min-width: 0;
}
.ft-dash {
    color: #6d93bc;
    font-weight: 700;
}

.ft-side-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}
.ft-side-submit {
    flex: 1;
    height: 36px;
    font-size: 14px;
}
.ft-side-reset {
    height: 36px;
    width: 36px;
    font-size: 15px;
}

