/* Mr. Organic - Ground-up UI theme */
:root {
    --forest-900: #1b2d1f;
    --forest-700: #2f4a34;
    --moss-500: #4f7b5a;
    --moss-300: #87a88d;
    --clay-500: #c7744a;
    --sun-400: #f2b657;
    --cream-100: #f7f1e6;
    --sand-200: #efe4d2;
    --stone-500: #6b6a63;
    --ink-900: #1c1b18;
    --white: #ffffff;
    --shadow-soft: 0 18px 40px rgba(27, 34, 28, 0.12);
    --shadow-card: 0 22px 45px rgba(30, 35, 32, 0.14);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Manrope", "Helvetica Neue", sans-serif;
    color: var(--ink-900);
    background: radial-gradient(circle at top, #fff7ea 0%, #f7efe1 40%, #efe4d2 100%);
    min-height: 100vh;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3, h4, h5 {
    font-family: "Fraunces", "Georgia", serif;
    margin: 0 0 0.75rem;
}

p {
    margin: 0 0 1rem;
    color: var(--stone-500);
}

/* Navigation */
.site-nav {
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid #e3d8c5;
    backdrop-filter: blur(12px);
}

.site-nav .navbar-toggler {
    border-color: #d9d0c4;
}

.site-nav .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%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.brand-mark {
    font-family: "Fraunces", "Georgia", serif;
    font-size: 1.45rem;
    letter-spacing: 0.02em;
}

.brand-mark span {
    color: var(--clay-500);
    margin-right: 2px;
}

.site-nav .nav-link {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    color: var(--forest-900) !important;
}

.site-nav .nav-link:hover {
    color: var(--clay-500) !important;
}

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 8px 20px rgba(30, 35, 32, 0.12);
    color: var(--forest-900);
}

.icon-btn:hover {
    color: var(--clay-500);
}

#badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--clay-500);
    color: var(--white);
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Buttons */
.btn-primary {
    background: var(--forest-900);
    border-color: var(--forest-900);
    border-radius: 999px;
    padding: 0.8rem 1.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.btn-primary:hover {
    background: var(--forest-700);
    border-color: var(--forest-700);
}

.btn-outline-light {
    border-radius: 999px;
    border-width: 2px;
}

.btn-ghost {
    background: transparent;
    border: 1px solid #d4c7b2;
    color: var(--forest-900);
    border-radius: 999px;
    padding: 0.7rem 1.4rem;
    font-weight: 600;
}

.form-control,
.form-select {
    border-radius: 12px;
    border-color: #e0d3c1;
    padding: 0.65rem 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--moss-300);
    box-shadow: 0 0 0 0.2rem rgba(135, 168, 141, 0.25);
}

/* Hero */
.hero {
    position: relative;
    padding: 6rem 0 4rem;
    background: linear-gradient(135deg, #1f2d20 0%, #2c3f2c 55%, #172218 100%);
    color: var(--white);
    overflow: hidden;
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    opacity: 0.35;
    filter: blur(0.5px);
}

.hero::before {
    width: 360px;
    height: 360px;
    background: #f4c17a;
    top: -120px;
    right: 5%;
}

.hero::after {
    width: 240px;
    height: 240px;
    background: #7bb089;
    bottom: -80px;
    left: 6%;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #f1d7b6;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: clamp(2.5rem, 3.5vw, 3.6rem);
    line-height: 1.05;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: #eadfcf;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.75rem 0;
}

.hero-search {
    display: grid;
    grid-template-columns: 1.2fr 1fr auto;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 0.8rem;
    backdrop-filter: blur(8px);
}

.search-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.9rem;
    color: var(--forest-900);
}

.search-field input,
.search-field select {
    border: none;
    outline: none;
    width: 100%;
    font-weight: 600;
    background: transparent;
    color: var(--forest-900);
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.metric-card {
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--white);
}

.metric-label {
    font-size: 0.85rem;
    color: #eadfcf;
}

.hero-visual {
    position: relative;
    display: grid;
    gap: 1rem;
    align-content: start;
}

.hero-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.hero-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.hero-card-body {
    padding: 1rem 1.2rem 1.3rem;
}

.hero-card-body h3 {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
}

.hero-badge {
    position: absolute;
    bottom: -12px;
    right: 20px;
    background: var(--sun-400);
    color: #3b2f1f;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.75rem;
    box-shadow: var(--shadow-soft);
}

.reveal-up {
    animation: fadeUp 0.8s ease forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.section {
    padding: 4.5rem 0;
}

.section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-kicker {
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--clay-500);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.link-arrow {
    font-weight: 600;
    color: var(--forest-900);
}

.link-arrow i {
    margin-left: 0.4rem;
}

/* Category tiles */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.category-tile {
    position: relative;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    min-height: 220px;
    color: var(--white);
    background-image: linear-gradient(135deg, rgba(24, 32, 24, 0.65), rgba(24, 32, 24, 0.25)), var(--card-bg);
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-tile:hover {
    transform: translateY(-6px);
    box-shadow: 0 26px 50px rgba(24, 32, 24, 0.2);
}

.category-tile h3 {
    margin: 0;
    font-size: 1.5rem;
}

.category-tile span {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Feature cards */
.feature-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    box-shadow: var(--shadow-soft);
    height: 100%;
}

.feature-card i {
    font-size: 1.6rem;
    color: var(--clay-500);
    margin-bottom: 0.8rem;
}

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.6rem;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-media {
    position: relative;
}

.product-media img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--forest-900);
    font-weight: 700;
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
}

.product-body {
    padding: 1.2rem 1.3rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    height: 100%;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--moss-500);
    font-weight: 700;
}

.rating i {
    color: var(--sun-400);
    font-size: 0.85rem;
}

.product-title {
    font-size: 1.2rem;
    margin: 0;
}

.product-desc {
    color: var(--stone-500);
    font-size: 0.92rem;
}

.product-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.product-price {
    font-weight: 700;
    color: var(--forest-900);
}

.quick-add {
    border-radius: 999px;
    font-weight: 600;
}

/* Page hero */
.page-hero {
    padding: 5rem 0 3.5rem;
    color: var(--white);
    background-image: linear-gradient(135deg, rgba(27, 40, 28, 0.8), rgba(27, 40, 28, 0.5)), var(--hero-bg);
    background-size: cover;
    background-position: center;
}

.page-hero h1 {
    font-size: clamp(2.2rem, 3vw, 3.2rem);
}

.page-hero p {
    color: #e9dfcf;
    max-width: 560px;
}

/* Story section */
.story-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
}

.story-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

/* Newsletter */
.newsletter {
    background: var(--forest-900);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.newsletter p {
    color: #e6dac8;
}

.newsletter input {
    border: none;
    border-radius: 999px;
    padding: 0.8rem 1.1rem;
}

/* Footer */
.site-footer {
    background: #141712;
    color: #d9d0c4;
    padding: 3rem 0 1.5rem;
}

.site-footer h5 {
    color: var(--white);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-bottom: 1rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
    padding-top: 1rem;
    font-size: 0.85rem;
    color: #c5bbaa;
}

/* Product detail */
.product-detail {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-card);
}

.product-detail img {
    border-radius: var(--radius-lg);
    height: 100%;
    object-fit: cover;
}

/* Modals */
.modal-content {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-card);
}

.modal-header {
    background: var(--forest-900);
    color: var(--white);
    border: none;
}

.modal-footer {
    border: none;
}

/* Utilities */
.text-soft {
    color: var(--stone-500);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--sand-200);
    color: var(--forest-900);
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (max-width: 991px) {
    .hero {
        padding: 5rem 0 3rem;
    }

    .hero-search {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        margin-top: 2rem;
    }
}

@media (max-width: 767px) {
    .section {
        padding: 3.5rem 0;
    }

    .hero-title {
        font-size: 2.4rem;
    }

    .product-media img {
        height: 190px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
    .about-owner-image {
        width: 100%;
        max-width: 360px;
        height: auto;
    }

    /* Responsive Category Grid */
    .category-grid {
        /* height: auto; is default, no change needed */
        gap: 15px; /* Slightly smaller gap for mobile */
    }
    .category-card {
       /* height: 200px; removed to rely on aspect-ratio */
    }
    .category-card h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 60px 10px;
    }
    .hero-section h1 {
        font-size: 2rem;
    }
    .card-title {
        font-size: 1.1rem;
    }
    .card-text {
        font-size: 0.9rem;
    }
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.9rem;
    }

    .product-grid {
        grid-template-columns: 1fr; /* 1 column on phones */
        gap: 15px;
    }

    /* Keep the 2x2 grid on smaller phones but with smaller text */
    .category-grid {
        grid-template-columns: 1fr 1fr;
    }
    .category-card h3 {
        font-size: 1.2rem;
    }
}

/* New Search/Filter Bar Styles */
.search-filter-section {
    box-shadow: 0 4px 8px -4px rgba(0,0,0,0.1);
    z-index: 1020; /* Below navbar but above content */
}

/* Responsive Navbar Adjustments */
@media (max-width: 991px) {
    .navbar-nav {
        padding-top: 10px;
    }
    .navbar .d-flex {
        padding-top: 10px;
        justify-content: center;
    }
    .search-filter-section {
        top: 73px; /* Adjust sticky top position for expanded navbar */
    }
}