:root {
    --green-dark: #1D5914;
    --green-main: #78A64B;
    --green-soft: #BDD9A0;
    --green-light: #E5F2D8;
    --gray-bg: #F2F2F2;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--gray-bg);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--green-dark);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Inputs */
input,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--green-soft);
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

input[type="radio"],
input[type="checkbox"] {
    width: auto;
}

input:focus,
select:focus {
    border-color: var(--green-main);
    box-shadow: 0 0 0 3px var(--green-light);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--green-dark);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
    text-align: center;
    text-decoration: none;
}

.btn:hover {
    background-color: #14400e;
}

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

/* Header */
header {
    background-color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
}

.nav-icons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cart-icon {
    position: relative;
    color: var(--green-dark);
    text-decoration: none;
    font-size: 1.5rem;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--green-main);
    color: white;
    font-size: 0.75rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* UI Enhancements */
#back-to-top {
    display: none;
    /* Controlled by JS */
    position: fixed;
    bottom: 80px;
    /* Above float cart */
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(29, 89, 20, 0.8);
    color: white;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    font-size: 1.2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#mobile-cart-float {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--green-dark);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    width: 90%;
    max-width: 300px;
    justify-content: space-between;
}

#mobile-cart-float .badge {
    background: var(--green-main);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: bold;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    justify-content: flex-start;
    /* Force start alignment */
}

.payment-option input {
    margin: 0;
    /* Remove potential default margins */
}

@media (min-width: 768px) {

    /* Desktop: Sticky Header */
    header {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    /* Desktop: Layout */
    .desktop-header-flex {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }

    .search-container {
        width: 300px;
    }

    /* Hide Mobile elements on Desktop */
    #back-to-top,
    #mobile-cart-float {
        display: none !important;
    }
}

@media (max-width: 767px) {

    /* Mobile: Ensure header is normal */
    header {
        position: relative;
    }

    /* Mobile: Unwrap the header so search can stick relative to Main */
    .desktop-header-flex {
        display: contents;
    }

    /* Since display: contents removes the div, the H1 and search-container become children of Main */

    .desktop-header-flex h1 {
        display: block;
        margin-bottom: 1rem;
    }

    /* Mobile: Sticky Search */
    .search-container {
        position: sticky;
        top: 10px;
        /* Space from top of viewport */
        z-index: 950;
        padding-bottom: 10px;
        /* Space below input */
        margin-bottom: 1rem;
        background-color: transparent;
        /* Or match bg if needed, but transparent looks ok if scrolling over blurred items? Better solid */
    }

    /* Input needs background to cover items scrolling under it */
    #search-input {
        width: 100%;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        background-color: var(--white);
    }
}