/* หน้าแรก (panel/resources/views/site/home.blade.php) — แยกจากหน้าให้เบราว์เซอร์ cache ได้ */
    /* --- FIX: ป้องกัน layout shift และ scrollbar แนวนอน --- */
    html, body {
        width: 100%;
        overflow-x: hidden;
    }
    
    /* Fix Navbar Jump (ถ้ามีปัญหา) */
    .main-navbar { min-height: 72px; }

    :root {
        --primary-color: #8B4513;
        --primary-hover: #654321;
        --secondary-color: #C09060; 
        --accent-color: #2E7D32;
        --light-bg: #FFF8F0;
        --text-color: #333333;
        /* Flower Theme Colors */
        --flower-pink: #E91E63;
        --flower-light-pink: #FCE4EC;
    }
    
    body { color: var(--text-color); }
    
    .btn-primary {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
        border: none;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
        color: #fff !important; 
    }
    
    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3);
    }
    
    .btn-outline-primary {
        color: var(--primary-color);
        border-color: var(--primary-color);
    }
    .btn-outline-primary:hover {
        background-color: var(--primary-hover);
        border-color: var(--primary-hover);
        color: #fff;
    }
     .btn-link {
        color: var(--primary-color);
        text-decoration-color: var(--primary-color);
     }
     .btn-link:hover {
        color: var(--primary-hover);
        text-decoration-color: var(--primary-hover);
     }
    
    /* --- LCP & CLS Optimization --- */
    .hero-section {
        background: linear-gradient(135deg, var(--light-bg) 0%, #fff 100%);
        position: relative;
        overflow: hidden;
        /* CLS Fix: จองพื้นที่ความสูงขั้นต่ำ */
        min-height: 500px;
        display: flex;
        align-items: center;
        /* [PERFORMANCE] Isolate Layout/Paint to improve rendering speed */
        contain: layout paint;
    }
    
    .hero-section::before {
       content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 100%;
        height: 200%;
        background: radial-gradient(circle, rgba(212, 165, 116, 0.1) 0%, transparent 70%);
        animation: float 20s infinite ease-in-out;
        pointer-events: none; /* Fix scrolling performance */
        /* [PERFORMANCE] Promote to GPU layer to fix "non-composited animation" */
        will-change: transform;
    }
    @keyframes float {
        0%, 100% { transform: translate(0, 0) rotate(0deg); }
        50% { transform: translate(-20px, -20px) rotate(5deg); }
    }
    .feature-icon {
        width: 80px;
        height: 80px;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 1rem;
        box-shadow: 0 8px 20px rgba(139, 69, 19, 0.2);
        transition: transform 0.3s ease;
    }
    .feature-card:hover .feature-icon {
        transform: scale(1.1) rotate(5deg);
    }
    .product-card {
        border: none;
        border-radius: 15px;
        overflow: hidden;
        /* [PERFORMANCE] Specify transition properties */
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        box-shadow: 0 5px 15px rgba(0,0,0,0.08);
        height: 100%;
        background: #fff;
        /* [PERFORMANCE] Reduce painting area */
        contain: paint;
    }
    .product-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    }
    /* CLS Fix: บังคับอัตราส่วนภาพสินค้า 1:1 อย่างเคร่งครัด */
    .product-card-img {
        aspect-ratio: 1 / 1;
        width: 100%;
        height: auto;
        object-fit: cover;
        transition: transform 0.5s ease;
        background-color: #f8f9fa; /* Placeholder color while loading */
        /* [PERFORMANCE] GPU hint for hover effect */
        will-change: transform;
    }
    .product-card:hover .product-card-img {
       transform: scale(1.1);
    }
    .product-price {
        color: var(--accent-color);
        font-weight: 700;
        font-size: 1.1rem;
    }
    .badge-hot {
        position: absolute;
        top: 15px;
        right: 15px;
        background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
        color: white;
        padding: 5px 15px;
        border-radius: 20px;
        font-size: 0.75rem;
        font-weight: 600;
        z-index: 10;
        box-shadow: 0 3px 10px rgba(238, 90, 111, 0.4);
    }
    .section-title {
        position: relative;
        display: inline-block;
        padding-bottom: 15px;
    }
    .section-title::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 80px;
        height: 4px;
        background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        border-radius: 2px;
    }
    .trust-badge {
       background: white;
        border-radius: 10px;
        padding: 1.5rem;
        text-align: center;
        transition: transform 0.3s ease;
        height: 100%;
    }
    .trust-badge:hover {
        background: var(--light-bg);
        transform: translateY(-5px);
    }
    .cta-section {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
        color: white;
        border-radius: 20px;
        padding: 3rem 2rem;
        position: relative;
        overflow: hidden;
        /* [PERFORMANCE] */
        contain: paint;
    }
    .cta-section::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -20%;
        width: 300px;
        height: 300px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
    }
    .article-card {
        border: none;
        border-radius: 15px;
        overflow: hidden;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        box-shadow: 0 3px 10px rgba(0,0,0,0.1);
        height: 100%;
        /* [PERFORMANCE] */
        contain: paint;
    }
    .article-card:hover {
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
        transform: translateY(-5px);
    }
    .article-card-img-wrapper {
        height: auto;
        overflow: hidden;
        background: var(--light-bg);
        aspect-ratio: 400/250; /* CLS Fix */
    }
    .article-card-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
        aspect-ratio: 400/250; /* CLS Fix */
    }
    .article-card:hover .article-card-img {
        transform: scale(1.1);
    }
    .coverage-badge {
        display: inline-block;
        background: var(--accent-color);
        color: white;
        padding: 5px 15px;
        border-radius: 20px;
        font-size: 0.85rem;
        margin: 5px;
    }
    .category-section-header {
        border-bottom: 2px solid #f0f0f0;
        padding-bottom: 1rem;
    }
    .category-badge {
        background-color: var(--primary-color);
        color: white;
        font-weight: 600;
        font-size: 0.9rem;
    }
    .category-h2 {
        color: var(--primary-color);
        font-size: 1.75rem;
    }
    .category-description {
        font-size: 0.95rem;
        color: #555;
    }
    .faq-section {
        background: var(--light-bg);
        border-radius: 20px;
        padding: 2rem;
    }
    .faq-item {
        border-bottom: 1px solid var(--secondary-color);
    }
    .faq-item:last-child {
       border-bottom: none;
    }
    .faq-question {
        background: none;
        border: none;
        width: 100%;
        text-align: left;
        padding: 1.5rem 0;
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--primary-hover);
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
    }
    .faq-question::after {
        content: '\F4FE'; /* Bootstrap icon plus */
        font-family: "bootstrap-icons";
        font-weight: 900;
        transition: transform 0.3s ease;
    }
    .faq-question[aria-expanded="true"]::after {
       content: '\F47C'; /* Bootstrap icon dash */
       transform: rotate(180deg);
    }
    .faq-answer {
        padding-bottom: 1.5rem;
        color: #333;
        line-height: 1.8;
    }
    .faq-cta {
       background: white;
        border: 2px dashed var(--primary-color);
    }

    @media (max-width: 576px) { 
        .product-card-body { padding: 1rem; }
        .product-card .card-title { font-size: 0.9rem; min-height: 2.5rem; }
        .product-card .product-price { font-size: 1rem; }
        .product-card .btn { font-size: 0.85rem; padding: 0.4rem 0.8rem; }
        .faq-section { padding: 1.5rem; }
        .form-control-lg { 
             font-size: 1rem;
             padding: 0.6rem 1rem;
        }
    }
    
    /* --- Accessibility & Contrast Fixes --- */
    .product-sku {
        font-size: 0.75rem;
        color: #595959; /* FIX: เปลี่ยนจาก #999 เป็น #595959 เพื่อให้ Contrast Ratio ผ่าน */
        margin-bottom: 0.5rem;
    }
    .variant-list {
        background: linear-gradient(135deg, var(--light-bg) 0%, #fff 100%);
        border-radius: 8px;
        padding: 0.75rem;
        margin-top: 0.75rem;
        font-size: 0.85rem;
    }
    .variant-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.4rem 0;
        border-bottom: 1px solid rgba(0,0,0,.05);
    }
    .variant-item:last-child {
        border-bottom: none;
    }
    .variant-size {
        color: #444; /* FIX: ปรับให้เข้มขึ้น */
        font-weight: 500;
    }
    .variant-price {
        color: var(--accent-color);
        font-weight: 700;
        font-size: 0.9rem;
    }
    
    /* Override Bootstrap text-muted for better accessibility on white background */
    .text-muted {
        color: #636c72 !important;
    }

    .high-contrast-link {
        color: var(--primary-hover);
        text-decoration: underline;
        font-weight: 600;
    }
    .visually-hidden {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
    
    /* --- Styles for Temple Search Box --- */
    .temple-search-section {
        background: var(--light-bg);
        border-radius: 15px;
        padding: 2.5rem 2rem;
        box-shadow: 0 8px 25px rgba(0,0,0,0.05);
        contain: paint; /* [PERFORMANCE] */
    }
     .temple-search-wrapper {
        position: relative;
        max-width: 600px;
        margin: 0 auto;
     }
    .temple-search-results {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border: 1px solid #ddd;
        border-top: none;
        border-radius: 0 0 10px 10px;
        max-height: 250px;
        overflow-y: auto;
        z-index: 1000;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        display: none; 
    }
    .temple-result-item {
        padding: 0.75rem 1.25rem;
        cursor: pointer;
        border-bottom: 1px solid #f0f0f0;
    }
    a.temple-result-item { display: block; color: inherit; text-decoration: none; }
    a.temple-result-item:focus-visible { background: var(--light-bg, #FFF8F0); outline: 2px solid var(--primary-color); outline-offset: -2px; }
    .temple-result-empty { padding: 1rem 1.25rem; color: #444; text-align: center; }
    .temple-result-item:last-child {
        border-bottom: none;
    }
    .temple-result-item:hover {
        background: var(--light-bg);
    }
    .temple-result-item strong {
        color: var(--primary-hover);
    }
    .temple-result-item span {
        font-size: 0.9rem;
        color: #555; /* FIX: Contrast */
    }
     .form-control-lg { 
       font-size: 1.15rem;
       padding: 0.75rem 1.25rem;
     }
     
     /* --- FLOWER HIGHLIGHT SECTION STYLES --- */
     #flower-highlight {
         background: linear-gradient(180deg, #fff 0%, var(--flower-light-pink) 100%);
     }
     #flower-highlight .card-body h3 { /* Fix Selector from h5 to h3 */
         font-size: 1rem;
     }
     .btn-flower-outline {
         color: var(--flower-pink);
         border: 2px solid var(--flower-pink);
     }
     .btn-flower-outline:hover {
         background-color: var(--flower-pink);
         color: white;
     }

    /* [PERFORMANCE] content-visibility to reduce main thread time for below-fold content */
    .below-fold-section {
        content-visibility: auto;
        contain-intrinsic-size: 800px; /* Estimate height to prevent scrollbar jump */
    }
