/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    color: #111827;
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Cards */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: var(--space-md);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: var(--space-xs);
}

.card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

/* Inputs */
.form-group {
    margin-bottom: 0.35rem;
    /* Ultra Compact spacing */
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.15rem;
    /* Tighter label spacing */
    font-size: 0.85rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.4rem 0.6rem;
    /* Ultra Compact padding */
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    font-size: 0.9rem;
    /* Smaller font */
}

.form-input:focus {
    outline: 2px solid var(--primary);
    border-color: transparent;
}

/* Password Toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-input {
    padding-right: 2.5rem;
    /* Space for the button */
}

.btn-toggle-password {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-toggle-password:hover {
    color: var(--text-main);
}

/* Product Cards (Tractors) - used-tractor-card (was product-card) */
.used-tractor-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: left;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0.75rem;
    /* Standard Padding */
}

.used-tractor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.15);
}

.product-img {
    width: 100%;
    height: 140px;
    /* Standard Image Height */
    object-fit: cover;
    transition: transform 0.3s;
}

.product-info {
    padding: 0;
    /* Removing internal padding since container has padding */
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-grow: 1;
    /* Ensure content fills space */
}

.product-title {
    font-weight: 700;
    font-size: 0.85rem;
    /* Standard Font Size */
    margin-bottom: 0.2rem;
    color: #111827;
    line-height: 1.3;
    text-align: left;
}

.product-specs-pipe {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.product-location-row {
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 0.5rem;
}

.product-location-row i {
    color: var(--primary);
    font-size: 0.7rem;
}

.price-emi-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.product-price-main {
    font-size: 1.0rem;
    font-weight: 700;
    color: #111;
}

.product-emi {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
}

.bid-row {
    margin-bottom: 0.5rem;
    /* Reduced from 0.75rem */
    margin-top: -0.2rem;
    /* Pull closer to Price row */
    text-align: left;
    /* Explicitly left align */
}

.btn-offer-link {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.85rem;
    /* Increased from 0.75rem */
    font-weight: 700;
    cursor: pointer;
}

.btn-offer-link:hover {
    text-decoration: underline;
}

.full-width-btn {
    width: 100%;
    margin-top: auto;
    padding: 0.6rem !important;
    font-size: 0.85rem !important;
}

.product-emi a,
.emi-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.product-emi a:hover,
.emi-link:hover {
    text-decoration: underline;
}

.btn-check-price {
    width: 100%;
    background: #1e3a5f;
    /* Dark blue matching reference */
    color: white;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    /* Match used-card button */
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: auto;
}

.btn-check-price:hover {
    background: #152a45;
}

/* Section Tabs */
.section-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.tab-item {
    padding-bottom: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    font-size: 0.9rem;
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 700;
}

/* Sub Tabs */
.sub-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.6rem;
    border-bottom: 1px solid #eee;
    padding-top: 0.5rem;
}

.sub-tab-item {
    padding-bottom: 0.8rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.sub-tab-item.active {
    color: var(--secondary);
    /* Using the navy color for sub-tabs in image */
    border-bottom: 2px solid var(--secondary);
    font-weight: 600;
}

.sub-tab-item:hover:not(.active) {
    color: var(--text-main);
}


.btn-view-all {
    display: inline-block;
    background: white;
    border: 1px solid var(--secondary);
    color: var(--secondary);
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
}

.btn-view-all:hover {
    background: var(--secondary);
    color: white;
}

/* Brand Section */
.brand-item {
    text-align: center;
    border: 1px solid var(--border);
    padding: 0.7rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

.brand-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.brand-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .brand-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .brand-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}

/* New Tractor Card Refinement (was used-card) */
.new-tractor-card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    text-align: left;
    /* Changed to left */
    height: 100%;
    padding: 0.75rem;
    /* Standard Padding */
}

.new-tractor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Certified Badge - Generalized */
.badge-certified {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.new-tractor-card .wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--primary);
    background: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    z-index: 10;
}

.new-tractor-card .img-container {
    padding: 0;
    /* Remove padding */
    background: #fdfdfd;
    position: relative;
    text-align: center;
    margin-bottom: 0.5rem;
}

.new-tractor-card .product-img {
    height: 140px;
    /* Standard Image Height */
    object-fit: cover;
    width: 100%;
}

.new-tractor-card .view-360 {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    box-shadow: var(--shadow-sm);
}

.new-tractor-card .card-content {
    padding: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.new-tractor-card .card-title {
    font-size: 0.85rem;
    /* Standard Font Size */
    font-weight: 700;
    color: #111;
    margin-bottom: 0.25rem;
    /* Reduced */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.new-tractor-card .card-specs-row {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.new-tractor-card .price-emi-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.1rem;
}

.new-tractor-card .price-main {
    font-size: 0.95rem;
    /* Slightly smaller */
    font-weight: 700;
    color: #111;
}

.new-tractor-card .emi-info {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
}

.new-tractor-card .price-sub {
    font-size: 0.6rem;
    /* Smaller */
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-align: left;
}

.new-tractor-card .compare-row {
    margin-top: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #666;
}

.btn-book {
    width: 100%;
    background: white;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    margin-top: auto;
}

.btn-book:hover {
    background: var(--primary);
    color: white;
}

/* Global 5-Column Grid Layout */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Mobile: 2 cols */
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        /* Tablet: 3 cols */
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
        /* Desktop: 5 cols */
        gap: 1rem;
    }
}

/* Tools and Services Section */
.tools-services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .tools-services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .tools-services-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.5rem;
    }
}

.service-card {
    background: white;
    border: 1px solid #f3f4f6;
    border-radius: 4px;
    padding: 1rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.service-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.service-icon-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
}

.service-circle {
    position: absolute;
    width: 24px;
    height: 24px;
    background: #FFD2D2;
    border-radius: 50%;
    opacity: 0.6;
    z-index: 1;
    bottom: 5px;
    left: 5px;
}

.service-icon-wrapper svg {
    position: relative;
    z-index: 2;
    width: 32px;
    height: 32px;
    fill: none;
    stroke: #333;
    stroke-width: 1.5;
}

.service-card .service-name {
    font-size: 0.8rem;
    color: #888;
    font-weight: 500;
}

/* Favorites Heart Icon */
.btn-favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
    border: none;
    color: #cbd5e1;
    /* Default slate-300 */
    font-size: 1.1rem;
}

.btn-favorite:hover {
    transform: scale(1.1);
    color: #ef4444;
    /* Hover Red */
    background: #fff;
}

.btn-favorite.active {
    color: #ef4444;
    /* Active Red */
    fill: #ef4444;
}

/* --- Seller Detail Modal --- */
.modal-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 450px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
    margin: 10% auto;
    /* Fallback for flex centering issues */
}

.modal-header {
    background: #184F9F;
    /* Brand Blue */
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
}

.form-group-modal {
    margin-bottom: 1rem;
}

.form-group-modal label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #333;
    text-align: left;
}

.form-group-modal input {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
}

.form-group-modal input:focus {
    border-color: #184F9F;
}

.location-input-wrapper {
    position: relative;
}

.location-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

.location-input-wrapper input {
    padding-left: 2rem;
}

.btn-get-offer {
    width: 100%;
    background: #184F9F;
    color: white;
    border: none;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0.5rem;
}

.btn-get-offer:hover {
    background: #123d7d;
}

.modal-footer-text {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    margin-top: 1rem;
}

.modal-footer-text a {
    color: #184F9F;
    text-decoration: none;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Compare Widget */
.compare-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: translateY(150%);
    transition: transform 0.3s ease-out;
    z-index: 1000;
    border: 1px solid #e2e8f0;
}

.compare-widget.visible {
    transform: translateY(0);
}

.compare-count {
    font-weight: 600;
    color: var(--text-main);
}

.btn-compare {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.btn-compare:hover {
    background: var(--primary-dark);
}

/* Price Chip Styles for Make Offer Modal */
.price-chip {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.price-chip:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.price-chip.selected {
    background: #fff7ed;
    border-color: #ff7e25;
    color: #ff7e25;
    font-weight: 700;
    box-shadow: 0 0 0 1px #ff7e25 inset;
}