/*
Theme Name: TractorDuniya
Theme URI: https://tractorduniya.in/
Author: Your Name
Description: Custom lead-generation theme for tractors, dealers and implements. No plugins used — all functionality (custom post types, meta boxes, AJAX filters, compare tool, lead forms) is hand-coded.
Version: 1.0.0
Text Domain: tj2
*/

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #222;
    background: #f7f7f7;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    background: #1c5d2e;
    color: #fff;
    padding: 14px 0;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.site-header .logo { font-size: 22px; font-weight: 700; color: #fff; }
.main-nav ul, .mega-menu { display: flex; list-style: none; gap: 22px; }
.main-nav a { color: #fff; font-weight: 500; }
.main-nav a:hover { color: #ffd66b; }

/* Mega menu */
.mega-menu { position: relative; }
.mega-menu > li { position: relative; padding: 10px 0; }
.mega-menu > li > a { color: #fff; font-weight: 600; font-size: 14px; }
.mega-menu > li > a:hover { color: #ffd66b; }
.mega-menu .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    color: #222;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 480px;
    gap: 30px;
    z-index: 50;
}
.mega-menu .has-dropdown:hover .dropdown { display: flex; }
.dropdown-col { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.dropdown-col h4 { font-size: 12px; text-transform: uppercase; color: #999; margin-bottom: 4px; }
.dropdown-col a { color: #222; font-size: 14px; padding: 3px 0; }
.dropdown-col a:hover { color: #1c5d2e; }

@media (max-width: 900px) {
    .mega-menu { flex-direction: column; }
    .mega-menu .dropdown { position: static; box-shadow: none; min-width: auto; }
}

/* ==========================================================================
   Filter bar
   ========================================================================== */
.filter-bar {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: -40px auto 30px;
    position: relative;
    z-index: 5;
    max-width: 1200px;
}
.filter-bar select, .filter-bar input { padding: 10px; border: 1px solid #ddd; border-radius: 6px; min-width: 160px; }
.filter-bar button { background: #1c5d2e; color: #fff; border: none; padding: 10px 22px; border-radius: 6px; cursor: pointer; }

/* ==========================================================================
   Cards
   ========================================================================== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; margin: 30px 0; }
.tractor-card, .dealer-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform .15s ease;
}
.tractor-card:hover, .dealer-card:hover { transform: translateY(-4px); }
.tractor-card img, .dealer-card img { height: 180px; object-fit: cover; width: 100%; }
.tractor-card .card-body, .dealer-card .card-body { padding: 14px 16px; }
.tractor-card h3 { font-size: 17px; margin-bottom: 6px; }
.tractor-card .meta { font-size: 13px; color: #666; margin-bottom: 10px; }
.tractor-card .price { font-weight: 700; color: #1c5d2e; margin-bottom: 10px; }
.card-actions { display: flex; gap: 8px; }
.btn { display: inline-block; padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; }
.btn-primary { background: #1c5d2e; color: #fff; }
.btn-outline { background: transparent; border: 1px solid #1c5d2e; color: #1c5d2e; }

/* ==========================================================================
   News cards
   ========================================================================== */
.news-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.news-card img { height: 170px; object-fit: cover; width: 100%; }
.news-card .card-body { padding: 14px 16px; }
.news-card h3 { font-size: 16px; margin: 6px 0; }
.news-tag { display: inline-block; background: #ffe9c2; color: #8a5a00; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; }

/* ==========================================================================
   Single tractor page
   ========================================================================== */
.single-tractor-header { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin: 30px 0; }
.spec-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.spec-table th, .spec-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #eee; }
.spec-table th { background: #f0f4f0; width: 40%; }

/* ==========================================================================
   Lead form
   ========================================================================== */
.lead-form { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.lead-form input, .lead-form textarea { width: 100%; padding: 10px; margin-bottom: 12px; border: 1px solid #ddd; border-radius: 6px; }
.lead-form button { width: 100%; padding: 12px; background: #ffb100; border: none; border-radius: 6px; font-weight: 700; cursor: pointer; }

/* ==========================================================================
   Compare table
   ========================================================================== */
.compare-table { width: 100%; border-collapse: collapse; background: #fff; }
.compare-table th, .compare-table td { border: 1px solid #eee; padding: 12px; text-align: center; }
.compare-table th { background: #1c5d2e; color: #fff; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: #14401f; color: #cfe3d3; padding: 40px 0; margin-top: 60px; font-size: 14px; }
.site-footer a { color: #fff; }

@media (max-width: 768px) {
    .single-tractor-header { grid-template-columns: 1fr; }
    .main-nav { display: none; }
}
