/* ==========================================================================
   AGROMARKET GLOBAL STYLESHEET - style.css
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary-green: #2E7D32;
    --primary-light: #4CAF50;
    --secondary-orange: #FF9800;
    --accent-yellow: #FBC02D;
    --bg-white: #FFFFFF;
    --bg-light: #F5F5F5;
    --text-dark: #333333;
    --text-muted: #666666;
    --border-color: #E0E0E0;
    --success: #4CAF50;
    --error: #D32F2F;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --font-headings: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

[data-theme="dark"] {
    --bg-white: #121212;
    --bg-light: #1E1E1E;
    --text-dark: #E0E0E0;
    --text-muted: #A0A0A0;
    --border-color: #333333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    font-weight: 600;
    color: var(--text-dark);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-light);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: var(--radius-md);
}

/* Reusable UI Components */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: var(--font-headings);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-green);
    color: #fff;
}
.btn-primary:hover {
    background-color: #1B5E20;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary-orange);
    color: #fff;
}
.btn-secondary:hover {
    background-color: #E65100;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
}
.btn-outline:hover {
    background-color: var(--primary-green);
    color: #fff;
}

/* Navigation Layout */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-green);
}
.logo span { color: var(--secondary-orange); }

.search-bar-container {
    flex: 0 1 500px;
    display: flex;
    position: relative;
}

.search-bar-container input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.search-bar-container button {
    padding: 0 20px;
    background-color: var(--primary-green);
    color: white;
    border: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-menu {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-link {
    font-weight: 500;
    position: relative;
    padding-bottom: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-orange);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.cart-icon-wrapper {
    position: relative;
    cursor: pointer;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: var(--secondary-orange);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 50%;
    font-weight: bold;
}

/* Global Product Card Pattern */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.product-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: var(--secondary-orange);
    color: white;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: var(--radius-sm);
    z-index: 2;
}

.wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--bg-white);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    z-index: 2;
    transition: var(--transition);
}

.wishlist-btn:hover {
    color: var(--error);
}

.product-img-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #f9f9f9;
}

.product-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-img-wrapper img {
    transform: scale(1.08);
}

.product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-cat {
    font-size: 0.8rem;
    color: var(--primary-green);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
}

.product-title {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-dark);
    height: 44px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.product-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-green);
}

.product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 15px 15px 15px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 2000;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Floating widgets */
.theme-toggle {
    cursor: pointer;
    font-size: 1.2rem;
}

.floating-chat {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-green);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 999;
}

.back-to-top {
    position: fixed;
    bottom: 95px;
    right: 30px;
    background-color: var(--secondary-orange);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Footer Section */
footer {
    background-color: #1B5E20;
    color: #f5f5f5;
    padding: 60px 0 20px 0;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: #fff;
    margin-bottom: 20px;
    position: relative;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 35px;
    height: 3px;
    background-color: var(--secondary-orange);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a:hover {
    color: var(--secondary-orange);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

/* Toast System */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
}

.toast {
    background-color: var(--bg-white);
    color: var(--text-dark);
    padding: 15px 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-bottom: 10px;
    border-left: 5px solid var(--primary-green);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease forwards;
}

.toast.error {
    border-left-color: var(--error);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}