/* ========================================
   Agro Market - Main Stylesheet
   Based on Green Leaf Design
   ======================================== */

/* === CSS Variables === */
:root {
    --primary: #28a745;
    --primary-dark: #1a5e1f;
    --primary-light: #34ce57;
    --primary-lighter: #e8f5e9;
    --accent: #4caf50;
    --text-dark: #1b1b1b;
    --text-body: #555;
    --text-muted: #888;
    --bg-light: #f9fafb;
    --bg-green-light: #f0faf1;
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s ease;
}

/* === Base === */
body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--white);
    color: var(--text-dark);
    line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
}

a {
    transition: var(--transition);
}

/* === Navbar === */
.navbar {
    background: var(--white) !important;
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-dark) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    color: var(--primary);
    font-size: 1.3rem;
}

.navbar-nav .nav-link {
    color: var(--text-dark) !important;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--primary) !important;
    background: var(--primary-lighter);
    transform: none;
}

.navbar-nav .nav-link.active {
    color: var(--primary) !important;
}

.navbar-nav .nav-link i {
    margin-right: 0.25rem;
    font-size: 0.85rem;
}

.navbar .btn-signup {
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
    padding: 0.4rem 1.5rem;
    border-radius: 50px;
    background: transparent;
    transition: var(--transition);
}

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

.navbar-toggler {
    border: 2px solid var(--primary);
    padding: 0.25rem 0.5rem;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2328a745' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* User dropdown */
.navbar .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    padding: 0.5rem;
}

.navbar .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.navbar .dropdown-item:hover {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

/* === Hero Section === */
.hero-section {
    background: linear-gradient(135deg, var(--white) 0%, var(--bg-green-light) 100%);
    color: var(--text-dark);
    padding: 5rem 0 4rem;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><circle cx="100" cy="100" r="100" fill="%2328a74510"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 0;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.hero-section h1 .text-green {
    color: var(--primary);
}

.hero-section p.lead {
    color: var(--text-body);
    font-size: 1.15rem;
    max-width: 500px;
}

.hero-section .hero-stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 2.5rem;
}

.hero-section .hero-stats .stat-item h3 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0;
}

.hero-section .hero-stats .stat-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Page hero for inner pages */
.page-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 3rem 0;
    margin-bottom: 2rem;
    text-align: center;
}

.page-hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-hero p {
    opacity: 0.9;
    font-size: 1.05rem;
}

/* === Buttons === */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

.btn-success {
    background-color: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
}

.btn-success:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

.btn-outline-success {
    color: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-success:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}

.btn-hero {
    background-color: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.85rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.05rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-hero:hover {
    background-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40,167,69,0.35);
}

.btn-hero-outline {
    background: transparent;
    color: var(--text-dark);
    border: 2px solid var(--text-dark);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
}

.btn-hero-outline:hover {
    background: var(--text-dark);
    color: var(--white);
    transform: translateY(-2px);
}

/* === Features Section === */
.features-section {
    background: var(--bg-green-light);
    padding: 4rem 0;
}

.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.feature-card .feature-icon {
    width: 70px;
    height: 70px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem;
    box-shadow: var(--shadow-sm);
}

.feature-card .feature-icon i {
    font-size: 1.8rem;
    color: var(--primary);
}

.feature-card h5 {
    font-weight: 700;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* === Section Titles === */
.section-title {
    color: var(--text-dark);
    font-weight: 800;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.section-title .text-green {
    color: var(--primary);
}

.section-subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

/* === Product Cards === */
.product-card {
    border: 1px solid #eee;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    background: var(--white);
    margin-bottom: 1.5rem;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.card {
    border: 1px solid #eee;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

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

.card-img-top {
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8f5e9 100%);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-dark);
}

.price-tag {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.25rem;
}

.stock-badge {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.bg-success {
    background-color: var(--primary) !important;
    font-weight: 600;
    border-radius: 50px;
    padding: 0.35rem 0.75rem;
}

/* Rating stars */
.rating {
    color: #f5a623;
    font-size: 0.85rem;
}

/* === Featured/Highlight Section === */
.highlight-section {
    padding: 5rem 0;
    background: var(--white);
}

.highlight-section img {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.highlight-section h2 {
    font-size: 2.2rem;
    font-weight: 800;
}

.highlight-section h2 .text-green {
    color: var(--primary);
}

/* === Testimonials Section === */
.testimonials-section {
    background: var(--primary);
    padding: 4rem 0;
    color: var(--white);
}

.testimonials-section h2 {
    color: var(--white);
    text-align: center;
    margin-bottom: 3rem;
}

.testimonial-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-dark);
    height: 100%;
}

.testimonial-card .avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    object-fit: cover;
    margin-bottom: 0.75rem;
}

.testimonial-card .avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-lighter);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.testimonial-card h6 {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.testimonial-card .stars {
    color: #f5a623;
    margin-bottom: 0.75rem;
}

.testimonial-card p {
    font-size: 0.9rem;
    color: var(--text-body);
    font-style: italic;
}

/* === Search & Filter Section === */
.search-section {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.search-section .form-control {
    border-radius: 50px;
    padding: 0.65rem 1.25rem;
    border: 2px solid #e0e0e0;
    font-size: 0.95rem;
}

.search-section .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(40,167,69,0.1);
}

.search-section .btn {
    border-radius: 50px;
    padding: 0.65rem 1.5rem;
}

.filter-btn {
    border-radius: 50px !important;
    padding: 0.35rem 1rem !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
}

/* === Form Styling === */
.form-control {
    border: 2px solid #e8e8e8;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(40,167,69,0.1);
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

/* === Auth Pages === */
.auth-card {
    border: none !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius-xl) !important;
    overflow: hidden;
}

.auth-card .card-body {
    padding: 2.5rem !important;
}

.auth-card .auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card .auth-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-lighter);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.auth-card .auth-icon i {
    font-size: 2rem;
    color: var(--primary);
}

/* === Detail Pages === */
.detail-image {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.detail-image img {
    width: 100%;
    height: auto;
}

.detail-info .info-card {
    border: none;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
}

.detail-info .info-card .table td {
    padding: 0.6rem 0;
    border: none;
    vertical-align: middle;
}

.detail-info .info-card .table td:first-child {
    color: var(--text-muted);
    font-weight: 500;
    width: 40%;
}

.product-description {
    line-height: 1.8;
    color: var(--text-body);
}

.product-description img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 10px 0;
}

/* === Pagination === */
.pagination-green .page-link {
    color: var(--primary);
    background-color: var(--white);
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm) !important;
    margin: 0 3px;
    font-weight: 600;
    transition: var(--transition);
}

.pagination-green .page-link:hover {
    color: var(--white);
    background-color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40,167,69,0.3);
}

.pagination-green .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.pagination-green .page-item.disabled .page-link {
    color: #ccc;
    background-color: var(--white);
    border-color: #e0e0e0;
}

/* === Footer === */
.footer {
    background: var(--primary-dark);
    color: var(--white);
    padding: 4rem 0 1.5rem;
    margin-top: 0;
}

.footer h5 {
    color: var(--white);
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.15rem;
}

.footer p, .footer li {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--white);
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 0.6rem;
}

.footer .social-links a {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    margin-right: 0.5rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

.footer .social-links a:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.footer .subscribe-form {
    display: flex;
    gap: 0;
}

.footer .subscribe-form input {
    border: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    padding: 0.6rem 1rem;
    flex: 1;
    font-size: 0.9rem;
}

.footer .subscribe-form button {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.6rem 1.2rem;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: var(--transition);
}

.footer .subscribe-form button:hover {
    background: var(--primary-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 1.5rem;
    margin-top: 2.5rem;
}

.footer-bottom p {
    margin-bottom: 0;
    font-size: 0.85rem;
}

/* === Alert Styling === */
.alert-success {
    background-color: var(--primary-lighter);
    border-color: var(--primary);
    color: var(--primary-dark);
    border-radius: var(--radius-md);
}

/* === Leaflet Map Overrides === */
.leaflet-container {
    height: 400px;
    width: 100%;
    border-radius: var(--radius-md);
    z-index: 1;
}

.location-picker-map {
    height: 300px;
    width: 100%;
    border-radius: var(--radius-md);
    margin-top: 10px;
}

.leaflet-popup-content-wrapper {
    border-radius: var(--radius-sm);
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0 2.5rem;
        text-align: center;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p.lead {
        max-width: 100%;
    }

    .hero-section .hero-stats {
        justify-content: center;
        gap: 1.5rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .page-hero {
        padding: 2rem 0;
    }

    .page-hero h1 {
        font-size: 1.8rem;
    }

    .footer {
        padding: 3rem 0 1rem;
        text-align: center;
    }

    .footer .social-links {
        justify-content: center;
    }
}

/* === Utility Classes === */
.bg-green-light {
    background-color: var(--bg-green-light);
}

.text-green {
    color: var(--primary) !important;
}

.rounded-xl {
    border-radius: var(--radius-xl) !important;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Google Fonts import fallback */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
