/* Everview Farms Nursery - Custom Styles
 * Brand Colors:
 * - Primary Green: #4B882E (primary)
 * - Light Green: #8EB95B (secondary green)
 * - Yellow/Gold: #F8D246 (accent)
 * - Orange: #E84C2C (highlight)
 * - Dark Red/Brown: #9A4436 (earth tone)
 */

:root {
    --color-primary: #4B882E;      /* Primary Green */
    --color-primary-dark: #3D6F25;
    --color-primary-light: #8EB95B; /* Light Green */
    --color-secondary: #F8D246;     /* Yellow/Gold */
    --color-secondary-dark: #D4B53A;
    --color-accent: #9A4436;        /* Dark Red/Brown */
    --color-accent-dark: #7A362B;
    --color-tertiary: #E84C2C;      /* Orange */
    --color-text: #2d3319;
    --color-text-light: #5a5a5a;
    --color-bg: #ffffff;
    --color-bg-light: #fdf9eb;      /* Light warm background */
    --color-border: #e5e0d8;
    --color-success: #4B882E;
    --color-error: #E84C2C;
    --color-warning: #F8D246;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Zain', sans-serif;
}

/* Header & Navigation */
.site-header {
    background-color: var(--color-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar {
    background-color: var(--color-primary);
    color: white;
    padding: 0;
    font-size: 0.875rem;
    height: 40px;
}

.top-bar .container {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.top-bar-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-bar-links a {
    color: white;
    text-decoration: none;
}

.top-bar-links a:hover {
    text-decoration: underline;
}

.shipping-bar {
    background-color: var(--color-secondary);
    color: var(--color-text);
    text-align: center;
    padding: 0.3rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.shipping-bar i {
    margin-right: 0.5rem;
}

.shipping-bar-link {
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;
}

.shipping-bar-link:hover {
    text-decoration: underline;
}

/* Header Search */
.header-search {
    position: absolute;
    right: 180px;
    top: 0;
    height: 100%;
    width: 0;
    overflow: hidden;
    transition: width 0.4s ease, opacity 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    opacity: 0;
}

.header-search.active {
    width: 350px;
    opacity: 1;
}

.header-search-wrapper {
    position: relative;
    width: 350px;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
}

.header-search-input {
    width: 100%;
    padding: 0.4rem 2.5rem 0.4rem 1rem;
    border: none;
    border-radius: 20px;
    font-size: 0.875rem;
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--color-text);
    outline: none;
    transition: box-shadow 0.2s, opacity 0.3s ease;
    height: 32px;
    opacity: 0;
}

.header-search.active .header-search-input {
    opacity: 1;
}

.header-search-input::placeholder {
    color: var(--color-text-light);
}

.header-search-input:focus {
    box-shadow: 0 0 0 2px var(--color-secondary);
}

.header-search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-light);
    cursor: pointer;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.header-search-icon:hover {
    color: var(--color-primary);
}

.header-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.header-search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--color-text);
    transition: background-color 0.15s;
    border-bottom: 1px solid var(--color-border);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--color-bg-light);
}

.search-result-image {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.search-result-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background-color: var(--color-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
    color: var(--color-text-light);
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-subtitle {
    font-size: 0.75rem;
    color: var(--color-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-type {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.search-result-type.plant {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.search-result-type.guide {
    background-color: #fef3cd;
    color: #856404;
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.search-loading {
    padding: 1rem;
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.search-result-item.active {
    background-color: var(--color-bg-light);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    margin: 0 auto;
    background-image: url('/assets/images/navbar-background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo .logo-icon {
    height: 140px;
    width: auto;
    margin-right: 0.5rem;
    margin-top: -65px;
    margin-bottom: -45px;
}

.logo .logo-text {
    height: 50px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--color-tertiary);
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
    left: 0;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--color-primary);
}

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

.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(75, 136, 46, 0.3);
}

.btn-secondary {
    background-color: var(--color-accent);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--color-accent-dark);
}

.btn-accent {
    background-color: var(--color-tertiary);
    color: white;
}

.btn-accent:hover {
    background-color: #d14426;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(232, 76, 44, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: white;
}

.btn-cart {
    background-color: var(--color-tertiary);
    color: white;
    border: none;
    font-weight: 600;
}

.btn-cart:hover {
    background-color: #d14426;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(232, 76, 44, 0.4);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(45, 51, 25, 0.6), rgba(45, 51, 25, 0.7)), url('/assets/images/fruit-nut-tree-orchard.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 6rem 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Grid */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.card-text {
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.card-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.card-zones {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.card-zones i {
    margin-right: 0.35rem;
}

.card-price {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Plant Card */
.plant-card {
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plant-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.plant-card:hover .btn {
    background-color: var(--color-primary-dark, #3D6F25);
}

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    background-color: var(--color-tertiary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-featured {
    background-color: var(--color-accent);
}

.badge-sale {
    background-color: var(--color-error);
}

.badge-sold-out {
    background-color: #6c757d;
}

/* Sold Out Card */
.plant-card.sold-out {
    opacity: 0.7;
}

.plant-card.sold-out .card-image,
.plant-card.sold-out > div:first-of-type:not(.badge) {
    filter: grayscale(50%);
}

/* Footer */
.site-footer {
    background-color: var(--color-accent);
    color: white;
    padding: 3rem 2rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--color-tertiary);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--color-tertiary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.footer-bottom .shipping-disclaimer {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    position: relative;
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.shipping-disclaimer.highlight {
    animation: disclaimerHighlight 2s ease-out;
}

@keyframes disclaimerHighlight {
    0% {
        background-color: var(--color-secondary);
        color: var(--color-text);
    }
    20% {
        background-color: var(--color-secondary);
        color: var(--color-text);
    }
    100% {
        background-color: transparent;
        color: rgba(255, 255, 255, 0.6);
    }
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(75, 136, 46, 0.1);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Cart Icon */
.cart-icon {
    position: relative;
}

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

/* Breadcrumbs */
.breadcrumbs {
    padding: 1rem 1rem 0 1rem;
    font-size: 0.875rem;
}

.breadcrumbs a {
    color: var(--color-primary);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span {
    margin: 0 0.5rem;
    color: var(--color-text-light);
}

/* Mobile Toggle Buttons */
.mobile-search-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: opacity 0.3s;
    margin-left: 1rem;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: opacity 0.3s;
}

.mobile-search-toggle:hover,
.mobile-menu-toggle:hover {
    opacity: 0.8;
}

.mobile-menu-toggle {
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Responsive */
@media (max-width: 768px) {
    .top-bar {
        height: auto;
        min-height: 40px;
    }

    .top-bar .container {
        padding: 0 1rem;
        position: relative;
        height: 40px;
    }

    .header-search {
        position: absolute;
        top: 4px;
        left: 0;
        right: 0;
        width: auto;
        height: auto;
        padding: 0;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    }

    .header-search.active {
        max-height: 100px;
        opacity: 1;
        padding: 0 1rem;
    }

    .header-search-wrapper {
        width: 100%;
        padding: 0;
    }

    .header-search-input {
        padding: 0.5rem 0.5rem 0.5rem 1rem;
    }

    .top-bar-text {
        display: none;
    }

    .navbar {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .logo {
        order: 1;
        flex: 1;
    }

    .logo .logo-icon {
        height: 100px;
        margin-top: -45px;
        margin-bottom: -30px;
    }

    .logo .logo-text {
        height: 40px;
    }

    .mobile-menu-toggle {
        display: flex;
        order: 2;
        z-index: 10;
    }

    .nav-menu {
        order: 4;
        flex-basis: 100%;
        flex-direction: column;
        gap: 0;
        background-color: rgba(255, 255, 255, 0.98);
        border-radius: 8px;
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        max-height: 400px;
        opacity: 1;
        margin-top: 1rem;
    }

    .nav-menu li {
        border-bottom: 1px solid var(--color-border);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        display: block;
        padding: 1rem;
        text-align: center;
    }

    .nav-actions {
        order: 3;
    }

    .cart-text {
        display: none;
    }

    .btn-cart {
        padding: 0.625rem 0.875rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .container {
        padding: 1rem;
    }
}

/* Tablet view */
@media (min-width: 769px) and (max-width: 1024px) {
    .navbar {
        padding: 0.75rem 1.5rem;
    }

    .nav-menu {
        gap: 1.5rem;
    }

    .logo .logo-icon {
        height: 120px;
        margin-top: -55px;
        margin-bottom: -40px;
    }

    .logo .logo-text {
        height: 45px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-accent { color: var(--color-accent); }
.text-orange { color: var(--color-tertiary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Price Highlight */
.price-highlight {
    color: var(--color-accent);
    font-weight: 700;
}

/* Section Divider */
.section-divider {
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-tertiary), var(--color-accent));
    border: none;
    margin: 2rem 0;
}

/* Badge Variants */
.badge-new {
    background-color: var(--color-tertiary);
}

.badge-hot {
    background-color: var(--color-accent);
}

/* Link Accent */
a.link-accent {
    color: var(--color-accent);
    text-decoration: none;
}

a.link-accent:hover {
    color: var(--color-accent-dark);
    text-decoration: underline;
}

/* Card Accent Border */
.card-accent {
    border-left: 4px solid var(--color-tertiary);
}

.card-accent-brown {
    border-left: 4px solid var(--color-accent);
}
