/**
 * Homepage - Agricultural Expert Style
 * 
 * Concept: "Your Agricultural Expert & Companion"
 * Strategy: Problem-Solution Flow → Soft Sell
 * Mobile-First Design
 * 
 * @package PlantPedia
 * @version 2.2.0
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    --expert-primary: #2d6a4f;
    --expert-primary-light: #40916c;
    --expert-primary-dark: #1b4332;
    --expert-secondary: #2c3e50;
    --expert-accent: #e67e22;
    --expert-accent-red: #e74c3c;
    --expert-bg: #f8faf9;
    --expert-bg-white: #ffffff;
    --expert-text: #2c3e50;
    --expert-text-light: #6c757d;
    --expert-border: #e9ecef;
    --expert-shadow: 0 2px 10px rgba(0,0,0,0.08);
    --expert-shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --expert-radius: 16px;
    --expert-radius-sm: 10px;
    --expert-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Base & Container
   ========================================================================== */

.homepage-expert {
    background: var(--expert-bg);
    overflow-x: hidden;
}

.homepage-expert .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
    box-sizing: border-box;
}

/* ==========================================================================
   HERO SECTION: SEARCH & DISCOVERY
   ========================================================================== */

.hero-search {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 50%, #40916c 100%);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    width: 100%;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.03"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.03"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 60px 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content > .container {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.hero-header {
    margin-bottom: 32px;
    text-align: center;
}

.hero-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    margin: 0 0 8px;
    letter-spacing: 1px;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
    letter-spacing: 2px;
}

.hero-tagline {
    font-size: 16px;
    color: rgba(255,255,255,0.9);
    margin: 0;
    font-weight: 400;
}

/* Big Search Bar */
.hero-search-box {
    max-width: 600px;
    margin: 0 auto 24px;
    padding: 0 16px;
    width: 100%;
}

.search-form-hero {
    width: 100%;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    transition: var(--expert-transition);
}

.search-input-wrapper:focus-within {
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
    transform: scale(1.02);
}

.search-icon {
    font-size: 20px;
    margin-right: 12px;
    opacity: 0.6;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--expert-text);
    background: transparent;
    min-width: 0;
}

.search-input::placeholder {
    color: #999;
    font-size: 14px;
}

.search-submit {
    background: linear-gradient(135deg, var(--expert-primary), var(--expert-primary-light));
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--expert-transition);
    white-space: nowrap;
}

.search-submit:hover {
    background: linear-gradient(135deg, var(--expert-primary-dark), var(--expert-primary));
    transform: scale(1.05);
}

/* Quick Tags */
.hero-quick-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
}

.tags-label {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    margin-right: 4px;
}

.quick-tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 13px;
    border-radius: 20px;
    text-decoration: none;
    transition: var(--expert-transition);
    backdrop-filter: blur(4px);
}

.quick-tag:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Desktop Hero */
@media (min-width: 768px) {
    .hero-search {
        min-height: 480px;
    }
    
    .hero-title {
        font-size: 56px;
    }
    
    .hero-tagline {
        font-size: 20px;
    }
    
    .search-input {
        font-size: 16px;
    }
    
    .search-submit {
        padding: 14px 32px;
        font-size: 15px;
    }
}

/* ==========================================================================
   QUICK NAVIGATION: MENU ICONS
   ========================================================================== */

.quick-menu {
    background: var(--expert-bg-white);
    padding: 16px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.quick-menu-list {
    display: flex;
    justify-content: space-around;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.quick-menu-item {
    flex: 1;
    max-width: 100px;
}

.quick-menu-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: var(--expert-radius-sm);
    text-decoration: none;
    color: var(--expert-text);
    transition: var(--expert-transition);
}

.quick-menu-link:hover {
    background: var(--expert-bg);
    color: var(--expert-primary);
}

.quick-menu-link.menu-highlight {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.1), rgba(230, 126, 34, 0.05));
    color: var(--expert-accent);
}

.quick-menu-link.menu-highlight:hover {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.2), rgba(230, 126, 34, 0.1));
}

.menu-icon {
    font-size: 24px;
}

.menu-text {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .quick-menu-list {
        justify-content: center;
        gap: 16px;
    }
    
    .quick-menu-item {
        max-width: 120px;
    }
    
    .quick-menu-link {
        padding: 12px 16px;
    }
    
    .menu-icon {
        font-size: 28px;
    }
    
    .menu-text {
        font-size: 13px;
    }
}

/* ==========================================================================
   SECTION HEADER (Shared)
   ========================================================================== */

.section-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.section-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.section-header-content {
    flex: 1;
    min-width: 200px;
}

.section-subtitle {
    font-size: 13px;
    color: var(--expert-primary);
    font-weight: 500;
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--expert-secondary);
    margin: 0;
    line-height: 1.3;
}

.section-more {
    align-self: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--expert-primary);
    text-decoration: none;
    white-space: nowrap;
    transition: var(--expert-transition);
}

.section-more:hover {
    color: var(--expert-primary-dark);
    transform: translateX(4px);
}

@media (min-width: 768px) {
    .section-icon {
        font-size: 40px;
    }
    
    .section-title {
        font-size: 28px;
    }
}

/* ==========================================================================
   SECTION 1: SEASONAL PLANTS
   ========================================================================== */

.section-plants {
    padding: 48px 0;
    background: var(--expert-bg-white);
}

.plants-showcase {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.plant-showcase-card {
    border-radius: var(--expert-radius);
    overflow: hidden;
    background: var(--expert-bg-white);
    box-shadow: var(--expert-shadow);
    transition: var(--expert-transition);
}

.plant-showcase-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--expert-shadow-lg);
}

.plant-showcase-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.plant-showcase-image {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
}

.plant-showcase-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.plant-showcase-card:hover .plant-showcase-image img {
    transform: scale(1.1);
}

.plant-showcase-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 12px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.plant-type-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--expert-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
}

.plant-showcase-info {
    padding: 14px;
}

.plant-showcase-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--expert-secondary);
    margin: 0 0 6px;
    line-height: 1.3;
}

.plant-view-btn {
    font-size: 12px;
    color: var(--expert-primary);
    font-weight: 500;
}

@media (min-width: 640px) {
    .plants-showcase {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .plants-showcase {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
    }
    
    .plant-showcase-image {
        aspect-ratio: 3/4;
    }
}

/* ==========================================================================
   SECTION 2: DISEASE CENTER
   ========================================================================== */

.section-diseases {
    padding: 48px 0;
    background: linear-gradient(180deg, #fef9f3 0%, var(--expert-bg) 100%);
}

.diseases-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.disease-card {
    background: var(--expert-bg-white);
    border-radius: var(--expert-radius);
    overflow: hidden;
    box-shadow: var(--expert-shadow);
    transition: var(--expert-transition);
}

.disease-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--expert-shadow-lg);
}

.disease-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.disease-card-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.disease-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.severity-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.severity-badge.severe { background: #c0392b; }
.severity-badge.high { background: #e74c3c; }
.severity-badge.moderate { background: #f39c12; }
.severity-badge.mild { background: #27ae60; }

.disease-card-content {
    padding: 16px;
}

.disease-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--expert-secondary);
    margin: 0 0 8px;
    line-height: 1.3;
}

.disease-excerpt {
    font-size: 13px;
    color: var(--expert-text-light);
    margin: 0 0 10px;
    line-height: 1.5;
}

.disease-cta {
    font-size: 13px;
    font-weight: 600;
    color: var(--expert-accent-red);
}

@media (min-width: 768px) {
    .diseases-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    
    .disease-name {
        font-size: 16px;
    }
}

/* ==========================================================================
   SECTION 3: HOW-TO KNOWLEDGE (GUIDES)
   ========================================================================== */

.section-guides {
    padding: 48px 0;
    background: var(--expert-bg-white);
}

.guides-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guide-item {
    background: var(--expert-bg-white);
    border-radius: var(--expert-radius);
    overflow: hidden;
    border: 1px solid var(--expert-border);
    transition: var(--expert-transition);
}

.guide-item:hover {
    border-color: var(--expert-primary);
    box-shadow: var(--expert-shadow);
}

.guide-item-link {
    display: flex;
    gap: 16px;
    text-decoration: none;
    color: inherit;
}

.guide-item-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    overflow: hidden;
}

.guide-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.guide-item-content {
    flex: 1;
    padding: 12px 12px 12px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.guide-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.guide-type,
.guide-difficulty,
.guide-time {
    font-size: 11px;
    color: var(--expert-text-light);
}

.guide-type {
    color: var(--expert-primary);
    font-weight: 500;
}

.guide-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--expert-secondary);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.guide-item-excerpt {
    display: none;
}

/* Featured Guide */
.guide-featured {
    border: 2px solid var(--expert-primary);
    background: linear-gradient(135deg, rgba(45, 106, 79, 0.03), transparent);
}

.guide-featured .guide-item-link {
    flex-direction: column;
}

.guide-featured .guide-item-image {
    width: 100%;
    height: 180px;
}

.guide-featured .guide-item-content {
    padding: 16px;
}

.guide-featured .guide-item-title {
    font-size: 18px;
    -webkit-line-clamp: 3;
}

.guide-featured .guide-item-excerpt {
    display: block;
    font-size: 13px;
    color: var(--expert-text-light);
    margin: 8px 0 0;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .guides-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .guide-featured {
        grid-column: 1;
        grid-row: 1 / 3;
    }
    
    .guide-featured .guide-item-image {
        height: 220px;
    }
    
    .guide-item:not(.guide-featured) .guide-item-link {
        flex-direction: row;
    }
    
    .guide-item:not(.guide-featured) .guide-item-image {
        width: 120px;
        height: auto;
        aspect-ratio: 1;
    }
}

/* ==========================================================================
   SECTION 4: PRODUCT REVIEWS 💰
   ========================================================================== */

.section-products {
    padding: 48px 0;
    background: linear-gradient(180deg, var(--expert-bg) 0%, #e8f5e9 100%);
}

.section-header-products {
    border-bottom: 2px solid var(--expert-accent);
    padding-bottom: 20px;
}

.section-header-products .section-subtitle {
    color: var(--expert-accent);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.product-card {
    background: var(--expert-bg-white);
    border-radius: var(--expert-radius);
    overflow: hidden;
    box-shadow: var(--expert-shadow);
    transition: var(--expert-transition);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--expert-shadow-lg);
}

.product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-card-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8f8f8;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--expert-transition);
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

.product-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
}

.product-card-content {
    padding: 14px;
}

.product-brand {
    display: block;
    font-size: 11px;
    color: var(--expert-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--expert-secondary);
    margin: 0 0 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--expert-accent);
}

.product-card-actions {
    display: flex;
    gap: 8px;
    padding: 0 14px 14px;
}

.btn-read-review,
.btn-check-price {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--expert-radius-sm);
    text-decoration: none;
    transition: var(--expert-transition);
}

.btn-read-review {
    background: var(--expert-bg);
    color: var(--expert-secondary);
}

.btn-read-review:hover {
    background: var(--expert-primary);
    color: #fff;
}

.btn-check-price {
    background: linear-gradient(135deg, var(--expert-accent), #d35400);
    color: #fff;
}

.btn-check-price:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
}

.section-cta-wrapper {
    text-align: center;
}

.btn-view-all-products {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--expert-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: var(--expert-transition);
}

.btn-view-all-products:hover {
    background: var(--expert-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--expert-shadow-lg);
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    
    .product-name {
        font-size: 15px;
        min-height: 40px;
    }
}

/* ==========================================================================
   BOTTOM CTA
   ========================================================================== */

.section-bottom-cta {
    padding: 60px 0;
    background: linear-gradient(135deg, var(--expert-primary-dark) 0%, var(--expert-primary) 100%);
}

.bottom-cta-box {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.bottom-cta-box .cta-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.bottom-cta-box .cta-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
}

.bottom-cta-box .cta-description {
    font-size: 15px;
    color: rgba(255,255,255,0.85);
    margin: 0 0 28px;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-cta-primary,
.btn-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: var(--expert-transition);
}

.btn-cta-primary {
    background: #fff;
    color: var(--expert-primary);
}

.btn-cta-primary:hover {
    background: var(--expert-bg);
    transform: translateY(-2px);
}

.btn-cta-secondary {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.4);
}

.btn-cta-secondary:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

@media (min-width: 640px) {
    .bottom-cta-box .cta-title {
        font-size: 32px;
    }
    
    .cta-buttons {
        flex-direction: row;
        justify-content: center;
    }
}

/* ==========================================================================
   PLACEHOLDER IMAGE
   ========================================================================== */

.placeholder-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f7f6, #e8ebe9);
    font-size: 40px;
    opacity: 0.8;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .hero-search,
    .quick-menu,
    .section-bottom-cta {
        display: none;
    }
}

/* ========================================
   SEO INTRO SECTION
   ======================================== */
.seo-intro-section {
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
    padding: 40px 20px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.seo-intro-content {
    max-width: 800px;
    margin: 0 auto;
}

.seo-intro-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.seo-intro-title {
    font-size: 1.5rem;
    color: #1e3a2f;
    margin: 0 0 15px 0;
    font-weight: 700;
    line-height: 1.4;
}

.seo-intro-title .highlight {
    color: #2ECC40;
}

.seo-intro-text {
    color: #4b5563;
    line-height: 1.8;
    font-size: 1rem;
    margin: 0;
}

.seo-intro-text strong {
    color: #2ECC40;
    font-weight: 600;
}

/* Mobile */
@media (max-width: 768px) {
    .seo-intro-section {
        padding: 30px 15px;
    }
    
    .seo-intro-icon {
        font-size: 2.5rem;
    }
    
    .seo-intro-title {
        font-size: 1.25rem;
    }
    
    .seo-intro-text {
        font-size: 0.9rem;
        line-height: 1.7;
    }
}

/* ========================================
   SEO FOOTER SECTION
   ======================================== */
.seo-footer-section {
    background: #f8fafc;
    padding: 40px 20px;
    border-top: 1px solid #e5e7eb;
}

.seo-footer-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.seo-footer-title {
    font-size: 1rem;
    color: #374151;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.seo-footer-text {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.8;
    margin: 0;
}

.seo-footer-text .keyword {
    color: #059669;
    font-weight: 500;
}

/* Mobile */
@media (max-width: 768px) {
    .seo-footer-section {
        padding: 30px 15px;
    }
    
    .seo-footer-text {
        font-size: 0.8rem;
        text-align: left;
    }
}

/* ========================================
   QUICK MENU - SEO DESC (เพิ่มคำบรรยาย)
   ======================================== */
.quick-menu-link .menu-desc {
    display: block;
    font-size: 0.6875rem;
    color: #64748b;
    margin-top: 4px;
    font-weight: 400;
    line-height: 1.3;
}

/* Hide desc on mobile */
@media (max-width: 768px) {
    .quick-menu-link .menu-desc {
        display: none;
    }
}
