:root {
    --primary-red: #e73c3e;
    --primary-blue: #007bff;
    --primary-green: #28a745;
    --dark-bg: #1a1a1a;
    --light-bg: #f4f6f8;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-main);
    background-color: var(--light-bg);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-img {
    height: 60px;
    width: auto;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #ffffff 0%, #e8f5e9 100%);
    padding: 60px 0;
    text-align: center;
    border-bottom: 4px solid var(--primary-green);
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--dark-bg);
    font-weight: 800;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 14px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.status-message {
    margin-top: 15px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-green);
    min-height: 24px;
}

/* Results Section */
.results-section {
    padding: 50px 0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.results-header h3 {
    font-size: 2rem;
    color: var(--dark-bg);
    border-left: 5px solid var(--primary-red);
    padding-left: 15px;
}

#cityFilter {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    background-color: white;
    color: var(--text-main);
    font-weight: 600;
}

.producers-grid {
    display: grid;
    /* Strict 3-column layout on large screens */
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    padding: 50px;
}

/* Producer Card */
.producer-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0;
    /* Removing padding to let image flush */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;

    /* Animation defaults */
    opacity: 0;
    transform: scale(0.8);
    animation: scaleUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.producer-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.card-image-container {
    height: 200px;
    background-color: #eee;
    overflow: hidden;
    position: relative;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.producer-card:hover .card-image {
    transform: scale(1.1);
}

.card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.producer-name {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--dark-bg);
}

.producer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.producer-type {
    background-color: var(--primary-green);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.producer-distance {
    font-weight: 700;
    color: var(--primary-red);
}

.producer-address {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
    flex-grow: 1;
}

.producer-links {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.card-link {
    text-decoration: none;
    font-size: 0.95rem;
    padding: 10px 0;
    font-weight: 700;
    flex: 1;
    text-align: center;
    border-radius: 8px;
    transition: all 0.2s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.link-map {
    background-color: var(--primary-blue);
    color: white;
}

.link-map:hover {
    background-color: #0056b3;
}

.link-website {
    background-color: transparent;
    border: 2px solid #ddd;
    color: var(--text-muted);
}

.link-website:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.link-call {
    background-color: var(--primary-red);
    color: white;
}

.link-call:hover {
    background-color: #c0392b;
}


/* Footer */
.footer {
    background-color: var(--dark-bg);
    color: white;
    padding: 40px 0;
    margin-top: 80px;
    text-align: center;
}

/* Animations */
@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 992px) {
    .producers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .producers-grid {
        grid-template-columns: 1fr;
    }

    .hero-content h2 {
        font-size: 2rem;
    }
}