/* Tire Filter Form — Styles */

/* =========================================================================
   متغیرهای رنگی — برای شخصی‌سازی فقط همین مقادیر رو تغییر بدید
   ========================================================================= */
.tf-wrapper {
    --tf-primary: #14b8a6;      /* رنگ اصلی: دکمه جستجو، قیمت، تب فعال */
    --tf-primary-rgb: 20, 184, 166; /* همون رنگ اصلی به‌فرم RGB (برای افکت شیشه‌ای) */
    --tf-primary-dark: #0f9c8c; /* رنگ اصلی هاور */
    --tf-accent: #ffc700;       /* رنگ تاکیدی: پس‌زمینه دکمه‌های نوع خودرو */
    --tf-bg: #ffffff;           /* پس‌زمینه کارت */
    --tf-bg-soft: #fafafa;      /* پس‌زمینه فیلدها */
    --tf-text: #1a1d29;         /* رنگ متن اصلی */
    --tf-muted: #6b7280;        /* رنگ متن کم‌رنگ (لیبل‌ها) */
    --tf-border: #e5e7eb;       /* رنگ خطوط و حاشیه‌ها */
    --tf-bg-image: none;        /* اختیاری: آدرس عکس پس‌زمینه، مثلاً url('...jpg') */

    max-width: 640px;
    margin: 32px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, "IRANSans", "Vazirmatn", sans-serif;
}

.tf-card {
    position: relative;
    background: var(--tf-bg);
    background-image: var(--tf-bg-image);
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(20, 20, 30, 0.08);
    border: 1px solid var(--tf-border);
    padding: 8px 28px 28px;
}

/* ---------- Tabs ---------- */
.tf-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--tf-border);
    margin: 0 -8px 24px;
}

.tf-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 18px 8px 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--tf-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s ease;
    font-family: inherit;
}

.tf-tab:hover {
    color: var(--tf-text);
}

.tf-tab.tf-tab-active {
    color: var(--tf-text);
    border-bottom-color: var(--tf-primary);
}

.tf-tab-panel {
    padding-top: 4px;
    min-height: 268px;
    display: flex;
    flex-direction: column;
}

.tf-tab-panel .tf-search-btn {
    margin-top: auto;
}

.tf-empty-note {
    color: var(--tf-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

/* ---------- Fields ---------- */
.tf-field {
    margin-bottom: 16px;
}

.tf-field label {
    display: block;
    font-size: 13px;
    color: var(--tf-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.tf-select {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 48px;
    line-height: 46px;
    padding: 0 40px 0 16px;
    margin: 0;
    border-radius: 12px;
    border: 1.5px solid var(--tf-border);
    background-color: var(--tf-bg-soft);
    font-size: 14px;
    font-family: inherit;
    color: var(--tf-text);
    text-align: right;
    direction: rtl;
    vertical-align: middle;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}

.tf-select:focus {
    outline: none;
    border-color: var(--tf-primary);
    background-color: var(--tf-bg);
}

.tf-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---------- Search button ---------- */
.tf-search-btn {
    width: 100%;
    margin-top: 8px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(var(--tf-primary-rgb), 0.92), rgba(var(--tf-primary-rgb), 0.75));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(var(--tf-primary-rgb), 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.tf-search-btn::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.tf-search-btn:hover {
    background: linear-gradient(135deg, rgba(var(--tf-primary-rgb), 1), rgba(var(--tf-primary-rgb), 0.85));
    box-shadow: 0 10px 26px rgba(var(--tf-primary-rgb), 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.tf-search-btn:active {
    transform: scale(0.98);
}

.tf-search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.tf-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tf-spin 0.7s linear infinite;
}

@keyframes tf-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Usage (vehicle type) grid ---------- */
.tf-usage-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.tf-vehicle-btn {
    background: #fff;
    border: 2px solid var(--tf-border);
    border-radius: 14px;
    padding: 18px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.tf-vehicle-btn:hover {
    border-color: var(--tf-accent);
}

.tf-vehicle-btn.tf-active {
    background: var(--tf-accent);
    border-color: var(--tf-accent);
}

.tf-vehicle-icon {
    width: 30px;
    height: 30px;
    display: inline-block;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.tf-icon-car {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1d29' stroke-width='1.8'%3E%3Cpath d='M5 17h14M5 17a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm14 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM3 17V11l2-5h10l4 5v6M3 11h16'/%3E%3C/svg%3E");
}

.tf-icon-truck {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1d29' stroke-width='1.8'%3E%3Cpath d='M2 8h11v9H2zM13 11h4l3 3v3h-7zM6 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM17 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4z'/%3E%3C/svg%3E");
}

.tf-icon-farm {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1d29' stroke-width='1.8'%3E%3Ccircle cx='7' cy='17' r='3'/%3E%3Ccircle cx='17' cy='17' r='2'/%3E%3Cpath d='M7 14V6h4l4 4h2v4M4 17h0'/%3E%3C/svg%3E");
}

.tf-vehicle-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--tf-text);
    text-align: center;
}

/* ---------- Results ---------- */
.tf-results {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.tf-product-card {
    display: block;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--tf-border);
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.tf-product-card:hover {
    box-shadow: 0 8px 24px rgba(20, 20, 30, 0.1);
    transform: translateY(-2px);
}

.tf-product-img img {
    width: 100%;
    height: auto;
    display: block;
}

.tf-product-info {
    padding: 12px 14px;
}

.tf-product-title {
    margin: 0 0 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tf-text);
    line-height: 1.4;
}

.tf-product-price {
    font-size: 13px;
    color: var(--tf-primary);
    font-weight: 700;
}

.tf-no-results,
.tf-error {
    text-align: center;
    color: var(--tf-muted);
    padding: 40px 0;
    grid-column: 1 / -1;
    font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .tf-card {
        padding: 8px 16px 20px;
    }
    .tf-tab {
        font-size: 12.5px;
        padding: 16px 4px 12px;
    }
    .tf-usage-grid {
        gap: 8px;
    }
    .tf-vehicle-btn {
        padding: 14px 4px;
    }
}
