/* mix-product.css - Upgraded Styles */

:root {
    --green: #2c5530;
    --light-green: #A5D6A7;
    --accent: #4caf50;
    --bg-light: #f8f9f4;
    --text-dark: #333;
    --text-light: #666;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

body.dark-mode {
    --bg-light: #121212;
    --text-dark: #e0e0e0;
    --text-light: #bbb;
    --card-bg: #1e1e1e;
    --card-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
    --card-hover-shadow: 0 12px 24px rgba(255, 255, 255, 0.1);
}

/* * {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Roboto', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
} */

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9f4;
    transition: background-color 0.3s, color 0.3s;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* जब JS active करेगा */
body.page-loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Motion preference respect */
@media (prefers-reduced-motion: reduce) {
    body {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Dark Mode Styles */
body.dark-mode {
    background: #121212;
    color: #e0e0e0;
}

/* ===== HEADER & NAVBAR ===== */
header {
    width: 100%;
}

nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: white;
    color: black;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 20px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    font: 0.9em sans-serif;
    transition: background-color 0.3s, color 0.3s;
    background: linear-gradient(135deg, #A5D6A7, #E8F5E9);
    position: relative;
    z-index: 10;
    /* 👈 nav top par rahe */
}

body.dark-mode nav {
    background: #1e1e1e;
    color: #e0e0e0;
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.1);
}

/* ===== DESKTOP VIEW (Navbar fixed top) ===== */
@media (min-width: 769px) {
    nav {
        top: 0;
        left: 0;
        z-index: 1000;
    }
}

.logo {
    height: 47px;
    margin-right: 10px;
}

/* 🔎 Search box */
.search-box {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 10px 0;
    min-width: 180px;
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-box input {
    width: 100%;
    max-width: 400px;
    padding: 10px 12px;
    border: 1px solid #064E3B;
    border-radius: 20px;
    font-size: 16px;
    outline: none;
    background: white;
    color: black;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body.dark-mode .search-box input {
    background: #2d2d2d;
    color: #e0e0e0;
    border-color: #ffff;
}

#searchBtn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: #064E3B;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

body.dark-mode #searchBtn {
    color: white;
}

#searchBtn:hover {
    background: #1e3a21;
}

/* 🔎 Suggestions dropdown */
#suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode #suggestions {
    background: #2d2d2d;
    color: #e0e0e0;
    box-shadow: 0 4px 6px rgba(255, 255, 255, 0.1);
}

/* ✅ Navbar Links */
.menu {
    align-items: center;
    padding: 0;
    margin: 0;
    flex-wrap: nowrap;
    gap: 10px;
}

.menu a {
    position: relative;
    text-decoration: none;
    color: #064E3B;
    transition: color 0.3s;
}

body.dark-mode .menu a {
    color: #e0e0e0;
}

.menu a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 2px;
    background: #4caf50;
    transition: width 0.3s;
}

.menu a:hover {
    color: #4caf50;
}

.menu a:hover::after {
    width: 100%;
}

/* Dropdown */
.dropdown {
    position: relative;
    margin: 0;
    line-height: 1.2;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    list-style: none;
    min-width: 100px;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    transition: max-height 0.4s ease, background-color 0.3s;
}

body.dark-mode .dropdown-menu {
    background: #2d2d2d;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.dropdown-menu li a {
    padding: 7px 20px;
    white-space: nowrap;
    font-size: 12px;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode .dropdown-menu li a {
    color: #e0e0e0;
}

.dropdown-menu li a:hover {
    background: #f0f0f0;
}

body.dark-mode .dropdown-menu li a:hover {
    background: #3d3d3d;
}

/* Arrow */
.arrow {
    font-size: 0.7rem;
    margin-left: 5px;
    transition: transform 0.3s;
}

.dropdown.open .arrow {
    transform: rotate(180deg);
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
    margin: 0;
}

nav ul li a {
    display: inline-block;
    padding: 10px 7px;
    color: black;
    text-decoration: none;
    position: relative;
    font-size: 0.95rem;
    font-weight: bold;
    transition: color 0.3s;
}

body.dark-mode nav ul li a {
    color: #e0e0e0;
}

/* nav icons */
.nav-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
}

/* Icons */
.nav-icons img {
    height: 22px;
    width: 22px;
    cursor: pointer;
    margin: 5px 10px;
    transition: filter 0.3s;
}

body.dark-mode .nav-icons img {
    filter: invert(1);
}

.nav-icons a {
    position: relative;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-icons a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 2px;
    background: #4caf50;
    transition: width 0.3s;
}

.nav-icons a:hover::after {
    width: 100%;
}

/* ✅ Responsive Layout for Small Screens */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .search-box {
        width: 100%;
        justify-content: center;
        margin: 0;
    }

    nav ul {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        padding: 0;
    }

    .nav-icons {
        justify-content: center;
        margin: 0;
    }
}

/* Container & Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 20px 40px;
    /* Top padding for fixed nav */
}

/* Header Section */
.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--green);
    margin-bottom: 10px;
}

.page-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Filter Section */
.filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: 30px;
    background: #f0f0f0;
    color: #555;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #e0e0e0;
}

.filter-btn.active {
    background: var(--green);
    color: white;
    box-shadow: 0 4px 10px rgba(44, 85, 48, 0.3);
}

body.dark-mode .filter-btn {
    background: #333;
    color: #ddd;
}

body.dark-mode .filter-btn.active {
    background: var(--accent);
    color: white;
}

.sort-options select {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: var(--card-bg);
    color: var(--text-dark);
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* Product Card */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-hover-shadow);
}

.img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    overflow: hidden;
    background: #f9f9f9;
}

.card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover img {
    transform: scale(1.08);
}

.type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.type-badge.plant {
    background: rgba(46, 204, 113, 0.9);
    color: white;
}

.type-badge.pot {
    background: rgba(230, 126, 34, 0.9);
    color: white;
}

.card .body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card .name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card .desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.price-row {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--green);
}

body.dark-mode .price {
    color: var(--light-green);
}

.view-btn {
    padding: 8px 16px;
    background: transparent;
    border: 2px solid var(--green);
    color: var(--green);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: var(--green);
    color: white;
}

body.dark-mode .view-btn {
    border-color: var(--light-green);
    color: var(--light-green);
}

body.dark-mode .view-btn:hover {
    background: var(--light-green);
    color: #121212;
}

/* Loading & No Results */
.loading,
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    font-size: 1.2rem;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding-top: 40px;
    }

    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-buttons {
        justify-content: center;
    }

    .sort-options select {
        width: 100%;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
}