/* AgriMarket - Custom Styles */

/* CSS Variables */
:root {
    --primary-green: #2d5a27;
    --secondary-green: #4a7c43;
    --accent-orange: #f39c12;
    --accent-yellow: #f1c40f;
    --text-dark: #1a1a1a;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Base Styles */
body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Header Styles */
.header-main {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--white);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.brand-logo img {
    height: 60px;
    width: auto;
}

.brand-logo:hover {
    color: var(--white);
}

/* Header toggler button alignment */
.header-main .navbar-toggler {
    border: none;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.header-main .navbar-toggler:hover {
    background: rgba(255,255,255,0.25);
}

.header-main .navbar-toggler:focus {
    box-shadow: none;
}

.header-main .navbar-toggler .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='rgba%28255, 255, 255, 0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Hide toggler on desktop (lg and above), show only on mobile */
@media (min-width: 992px) {
    .header-main .navbar-toggler {
        display: none !important;
    }
}

.search-form .input-group {
    background: var(--white);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.search-form input {
    border: none;
    padding: 12px 20px;
    border-radius: 50px 0 0 50px;
}

.search-form input:focus {
    box-shadow: none;
}

.btn-search {
    background: var(--accent-orange);
    border: none;
    padding: 0 25px;
    color: var(--white);
    border-radius: 0 50px 50px 0;
    transition: var(--transition);
}

.btn-search:hover {
    background: #e67e22;
}

.btn-outline-custom {
    border: 2px solid rgba(255,255,255,0.3);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 50px;
    transition: var(--transition);
}

.btn-outline-custom:hover {
    background: var(--white);
    color: var(--primary-green);
}

.cart-icon-wrapper {
    position: relative;
    cursor: pointer;
    padding: 8px 15px;
    background: rgba(255,255,255,0.15);
    border-radius: 50px;
    transition: var(--transition);
}

.cart-icon-wrapper:hover {
    background: rgba(255,255,255,0.25);
}

.cart-icon-wrapper i {
    font-size: 1.5rem;
    color: var(--white);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-orange);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Navigation */
.navbar-dark {
    background: var(--primary-green) !important;
}

.navbar-toggler {
    border: none;
    padding: 8px;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.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='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Desktop Navigation Styles */
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    padding: 12px 15px;
    transition: var(--transition);
    border-radius: 8px;
    margin: 2px 0;
    position: relative;
}

/* Subtle hover effect for desktop */
.navbar-dark .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-yellow);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.navbar-dark .navbar-nav .nav-link:hover::after,
.navbar-dark .navbar-nav .nav-link.active::after {
    width: 60%;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    background: rgba(255,255,255,0.1);
}

/* Desktop Dropdown */
.navbar-dark .navbar-nav .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius);
    background: var(--white);
    margin-top: 8px;
}

.navbar-dark .navbar-nav .dropdown-item {
    color: var(--text-dark);
    padding: 10px 16px;
    transition: all 0.2s ease;
}

.navbar-dark .navbar-nav .dropdown-item:hover {
    background: var(--primary-green);
    color: var(--white);
    padding-left: 20px;
}

/* Mobile Offcanvas Menu */
.mobile-menu-offcanvas {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    width: 300px !important;
    max-width: 85vw;
}

.mobile-menu-offcanvas .offcanvas-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-logo-mobile {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.mobile-menu-offcanvas .btn-close-white {
    filter: invert(1);
    opacity: 0.8;
}

.mobile-menu-offcanvas .btn-close-white:hover {
    opacity: 1;
}

.mobile-menu-offcanvas .offcanvas-body {
    padding: 20px;
    overflow-y: auto;
}

/* Mobile search form */
.search-form-mobile .input-group {
    background: rgba(255,255,255,0.15);
    border-radius: 50px;
    overflow: hidden;
}

.search-form-mobile input {
    background: transparent;
    border: none;
    color: var(--white);
    padding: 12px 16px;
}

.search-form-mobile input::placeholder {
    color: rgba(255,255,255,0.6);
}

.search-form-mobile input:focus {
    background: transparent;
    box-shadow: none;
    color: var(--white);
}

.search-form-mobile .btn-search {
    background: var(--accent-orange);
    border: none;
    padding: 0 16px;
    color: var(--white);
}

/* Mobile nav links */
.mobile-menu-offcanvas .nav-link {
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    padding: 14px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin: 4px 0;
    display: flex;
    align-items: center;
}

.mobile-menu-offcanvas .nav-link i {
    font-size: 1.1rem;
    width: 24px;
}

.mobile-menu-offcanvas .nav-link:hover,
.mobile-menu-offcanvas .nav-link.active {
    background: rgba(255,255,255,0.15);
    padding-left: 24px;
}

/* Mobile dropdown */
.mobile-menu-offcanvas .dropdown-menu {
    background: var(--white);
    border: none;
    border-radius: 8px;
    padding: 8px;
    margin-top: 4px;
    box-shadow: var(--shadow-md);
}

.mobile-menu-offcanvas .dropdown-item {
    color: var(--primary-green);
    border-radius: 6px;
    padding: 10px 16px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.mobile-menu-offcanvas .dropdown-item:hover {
    background: var(--primary-green);
    color: var(--white);
    padding-left: 20px;
}

/* Mobile action buttons */
.mobile-actions .btn-outline-light {
    border: 2px solid rgba(255,255,255,0.3);
    color: var(--white);
    padding: 12px 20px;
    border-radius: 50px;
    transition: var(--transition);
}

.mobile-actions .btn-outline-light:hover {
    background: var(--white);
    color: var(--primary-green);
}

/* Bootstrap Offcanvas styles */
.offcanvas {
    border: none !important;
}

.offcanvas-backdrop.show {
    opacity: 0.5;
}

/* Hero Section */
.hero-section {
    position: relative;
    background: url('https://media.istockphoto.com/id/1445093704/fr/photo/march%C3%A9-fermier-%C3%A0-mad%C3%A8re.webp?a=1&b=1&s=612x612&w=0&k=20&c=SXikHDXLAGzR5PrnBJ8IkQ6w4Lt5amDXm7EdRSNQfjs=') center/cover no-repeat;
    min-height: 550px;
    display: flex;
    align-items: center;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(45,90,39,0.88) 0%, rgba(45,90,39,0.55) 50%, rgba(45,90,39,0.75) 100%);
    animation: overlayPulse 10s ease-in-out infinite;
}

@keyframes overlayPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.92; }
}

.hero-content {
    color: var(--white);
    position: relative;
    z-index: 1;
}

.hero-content > * {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.3s; }
.hero-content > *:nth-child(3) { animation-delay: 0.5s; }
.hero-content > *:nth-child(4) { animation-delay: 0.7s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.15;
    font-weight: 800;
    text-shadow: 2px 2px 20px rgba(0,0,0,0.3);
}

.hero-content p.lead {
    font-size: 1.3rem;
    margin-bottom: 30px;
    font-weight: 500;
}

.hero-content .badge {
    animation: fadeInUp 0.8s ease forwards, bounce 2s ease-in-out infinite 1.5s !important;
    opacity: 0 !important;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.btn-warning {
    background: var(--accent-yellow);
    border: none;
    color: var(--text-dark);
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition);
}

.btn-warning:hover {
    background: #f39c12;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-light {
    border: 2px solid var(--white);
    color: var(--white);
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition);
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--primary-green);
}

/* Hero Stats */
.hero-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-card {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

.stat-card:hover {
    background: rgba(255,255,255,0.25);
    transform: translateX(-10px);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--accent-yellow);
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--white);
}

.stat-label {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

/* Features Section */
.features-section {
    margin-top: -50px;
    position: relative;
    z-index: 10;
}

.feature-box {
    background: var(--white);
    padding: 30px 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    height: 100%;
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.feature-icon i {
    font-size: 1.75rem;
    color: var(--white);
}

.feature-box h5 {
    color: var(--primary-green);
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Products Section */
.products-section {
    background: var(--white);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    position: relative;
    padding-left: 15px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-green), var(--secondary-green));
    border-radius: 5px;
}

.view-all {
    color: var(--primary-green);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.view-all:hover {
    color: var(--accent-orange);
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 5;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
}

.product-wishlist {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 5;
}

.btn-wishlist {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-wishlist i {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition);
}

.btn-wishlist:hover i,
.btn-wishlist.active i {
    color: #e74c3c;
}

.product-image {
    height: 220px;
    overflow: hidden;
    background: #f8f9fa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-details {
    padding: 20px;
}

.product-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 8px 0;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    display: flex;
    flex-direction: column;
}

.price-new {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-green);
}

.price-old {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.btn-add-cart {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add-cart:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.btn-add-cart.added {
    background: #27ae60;
}

/* Categories Section */
.categories-section {
    background: var(--bg-light);
}

.category-card {
    position: relative;
    height: 200px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: var(--transition);
}

.category-card:hover {
    transform: scale(1.03);
}

.category-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(45,90,39,0.9) 0%, rgba(45,90,39,0.3) 100%);
    transition: var(--transition);
}

.category-card:hover .category-overlay {
    background: linear-gradient(to top, rgba(45,90,39,0.95) 0%, rgba(45,90,39,0.5) 100%);
}

.category-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    color: var(--white);
    transition: var(--transition);
}

.category-content i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.category-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.category-content span {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Footer */
.footer-main {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-brand .brand-logo {
    margin-bottom: 15px;
}

.footer-brand p {
    color: rgba(255,255,255,0.7);
    line-height: 1.7;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-green);
    transform: translateY(-3px);
}

.footer-main h5 {
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--accent-yellow);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--white);
    padding-left: 5px;
}

.newsletter-form {
    display: flex;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 50px;
    outline: none;
}

.newsletter-form button {
    background: var(--primary-green);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background: var(--accent-orange);
}

.contact-info p {
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-info i {
    color: var(--accent-yellow);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    margin-top: 40px;
    text-align: center;
    color: rgba(255,255,255,0.5);
}

/* Cart Modal */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
}

.modal-header {
    background: var(--primary-green);
    color: var(--white);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

.cart-total {
    border-top: 1px solid #eee;
    padding-top: 15px;
}

/* Responsive */
@media (max-width: 991px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p.lead {
        font-size: 1.1rem;
    }
    
    .search-form {
        margin: 15px 0;
    }
    
    .navbar {
        position: relative;
    }
    
    .navbar-collapse {
        position: fixed;
        top: 60px;
        left: 0;
        width: 280px;
        height: calc(100vh - 60px);
        background: var(--primary-green);
        padding: 20px;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 9999;
        box-shadow: 4px 0 15px rgba(0,0,0,0.3);
    }
    
    .navbar-collapse.show {
        transform: translateX(0);
    }
    
    .navbar-nav {
        padding: 10px 0;
    }
    
    /* Overlay when menu is open */
    .navbar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .navbar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-stats {
        display: none;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .feature-box {
        padding: 20px 15px;
    }
}

@media (max-width: 576px) {
    .hero-section {
        min-height: 450px;
        background-attachment: scroll;
    }
    
    .hero-content h1 {
        font-size: 1.65rem;
    }
    
    .hero-content p.lead {
        font-size: 1rem;
    }
    
    .hero-content .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .product-image {
        height: 180px;
    }
    
    .brand-logo {
        font-size: 1.4rem;
    }
    
    .brand-logo img {
        height: 30px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
.product-card:nth-child(7) { animation-delay: 0.7s; }
.product-card:nth-child(8) { animation-delay: 0.8s; }

/* Cart Animation */
@keyframes cartBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.cart-bounce {
    animation: cartBounce 0.3s ease;
}

