/* หน้า /จัดส่งวัด/{slug} (panel/resources/views/site/temple.blade.php) — แยกจากหน้าให้เบราว์เซอร์ cache ได้ */
/* *** FIX 1: Explicit Font Loading *** */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;600;700&family=Sarabun:wght@300;400;500;600&display=swap');

/* Scope everything to .temple-layout-wrapper to prevent global overrides */
.temple-layout-wrapper {
    /* ... Global Styles Scoped ... */
    --primary-color: #8B4513; 
    --primary-hover: #654321;
    --secondary-color: #D4A574;
    --accent-color: #2E7D32;
    --light-bg: #FFF8F0;
    --heading-font: 'Prompt', sans-serif;
    --body-font: 'Sarabun', sans-serif;
     
    font-family: var(--body-font);
    color: #333;
    -webkit-font-smoothing: antialiased;
}

.temple-layout-wrapper h1, 
.temple-layout-wrapper h2, 
.temple-layout-wrapper h3, 
.temple-layout-wrapper h4, 
.temple-layout-wrapper h5, 
.temple-layout-wrapper h6, 
.temple-layout-wrapper .btn, 
.temple-layout-wrapper .filter-pill, 
.temple-layout-wrapper .sub-pill {
    font-family: var(--heading-font);
}

/* *** FIX 4: STRONG Override for Colors (No more Blue!) *** */
.temple-layout-wrapper .btn-primary {
    background: var(--primary-color) !important;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
}
.temple-layout-wrapper .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3) !important;
}

.temple-layout-wrapper .btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}
.temple-layout-wrapper .btn-outline-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: #fff !important;
}

.temple-layout-wrapper .btn-link {
    color: var(--primary-color) !important;
    text-decoration-color: var(--primary-color);
}
.temple-layout-wrapper .btn-link:hover {
    color: var(--primary-hover) !important;
}

/* --- UPDATED BREADCRUMB STYLES (Styles for Visual Breadcrumb) --- */
.temple-layout-wrapper .breadcrumb-section {
    background-color: #fff;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.temple-layout-wrapper .breadcrumb {
    margin-bottom: 0;
    font-size: 0.9rem;
    font-family: var(--body-font);
}
.temple-layout-wrapper .breadcrumb-item a {
    color: #888;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 400;
}
.temple-layout-wrapper .breadcrumb-item a:hover {
    color: var(--primary-color);
}
.temple-layout-wrapper .breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 600;
}
/* เปลี่ยนตัวคั่นเป็นลูกศร */
.temple-layout-wrapper .breadcrumb-item + .breadcrumb-item::before {
    content: "›" !important; 
    color: #ccc;
    font-size: 1.2rem;
    line-height: 1;
    vertical-align: top;
    padding: 0 0.5rem;
}

/* Temple Hero Styles */
.temple-layout-wrapper .temple-hero {
    background: linear-gradient(135deg, var(--light-bg) 0%, #fff 100%);
    padding: 2.5rem 0;
    border-bottom: 3px solid var(--secondary-color);
    position: relative;
    overflow: hidden;
}
.temple-layout-wrapper .temple-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color)); 
}
.temple-layout-wrapper .temple-hero h1 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.75rem; 
    line-height: 1.3;
    margin-bottom: 1rem;
}
.temple-layout-wrapper .temple-hero .lead {
    font-size: 1rem;
    line-height: 1.6;
    color: #555; 
}
.temple-layout-wrapper .temple-info-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem; 
    margin-bottom: 1.5rem; 
}
.temple-layout-wrapper .temple-info-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none; 
}
.temple-layout-wrapper .badge-district { background-color: #6c757d; color: white; }
.temple-layout-wrapper .badge-delivery-free { background-color: var(--accent-color); color: white; box-shadow: 0 2px 8px rgba(46, 125, 50, 0.4); }
.temple-layout-wrapper .badge-delivery-paid { background-color: #ffc107; color: #333; border: 1px solid #e0a800; }

/* [NEW] Location Alert Box Style */
.temple-layout-wrapper .location-alert-box {
    background: #fff;
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    text-align: left;
}
.temple-layout-wrapper .location-alert-box::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 6px;
    background: #ffc107;
}
.temple-layout-wrapper .location-alert-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #856404;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}
.temple-layout-wrapper .location-detail { font-size: 1.2rem; font-weight: 600; color: #333; }
.temple-layout-wrapper .btn-map-check {
    background-color: #fff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.temple-layout-wrapper .btn-map-check:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* Temple Description */
.temple-layout-wrapper .temple-description-section {
    padding: 2.5rem 0;
    background: white;
}
.temple-layout-wrapper .temple-description-content {
     border: 1px solid #eee;
     background: var(--light-bg);
     padding: 2rem;
     border-radius: 12px;
}
.temple-layout-wrapper .temple-description-content h2 {
     color: var(--primary-color);
     font-size: 1.3rem;
     font-weight: 700;
     margin-bottom: 1rem;
     padding-bottom: 0.5rem;
     border-bottom: 2px solid var(--secondary-color);
     display: inline-block;
}
.temple-layout-wrapper .temple-description-content p {
     color: #444;
     line-height: 1.8;
     font-size: 0.95rem;
}

/* FAQ Section Styles */
.temple-layout-wrapper .faq-section {
    background: #fff;
    border-top: 1px solid #f0f0f0;
}
.temple-layout-wrapper .faq-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-left: 4px solid var(--secondary-color);
}
.temple-layout-wrapper .faq-question {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    display: flex;
    align-items: flex-start;
}
.temple-layout-wrapper .faq-question i {
    margin-top: 4px;
    color: var(--accent-color);
}
.temple-layout-wrapper .faq-answer {
    color: #555;
    padding-left: 1.75rem;
    line-height: 1.6;
}

/* Nearby Temples & Semantic Tags Styles */
.temple-layout-wrapper .nearby-temples-section {
    background-color: var(--light-bg);
    padding-top: 2rem;
    padding-bottom: 2rem;
    border-top: 1px solid #e0e0e0;
}
.temple-layout-wrapper .nearby-temples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.temple-layout-wrapper .nearby-temple-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    text-decoration: none;
    color: #333;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}
.temple-layout-wrapper .nearby-temple-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    color: var(--primary-color);
    border-color: var(--secondary-color);
}

/* *** COMPACT STICKY FILTER *** */
.temple-layout-wrapper .filter-sticky-container {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    padding-top: 0.75rem;
}
.temple-layout-wrapper .parent-tabs-wrapper {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding: 0 15px 0.75rem 15px;
}
.temple-layout-wrapper .parent-tabs-wrapper::-webkit-scrollbar { display: none; }

.temple-layout-wrapper .filter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 50px;
    background: #f8f9fa;
    border: 1px solid #eee;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    user-select: none;
}
/* *** OVERRIDE: Active State to Brown Gradient !important *** */
.temple-layout-wrapper .filter-pill:hover { 
    background: var(--light-bg); 
    color: var(--primary-color); 
    border-color: var(--secondary-color);
}
.temple-layout-wrapper .filter-pill.active {
    background: var(--primary-color) !important;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.2) !important;
}

.temple-layout-wrapper .sub-tabs-container {
    background: #fdfbf7;
    border-top: 1px solid #eee;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
}
.temple-layout-wrapper .sub-tabs-container.open { max-height: 100px; padding: 10px 0; }
.temple-layout-wrapper .sub-tabs-wrapper {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding: 0 15px;
}
.temple-layout-wrapper .sub-tabs-wrapper::-webkit-scrollbar { display: none; }

.temple-layout-wrapper .sub-pill {
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 50px;
    background: white;
    border: 1px solid #ddd;
    color: #555;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}
.temple-layout-wrapper .sub-pill:hover {
    border-color: var(--secondary-color);
    color: var(--primary-color);
    background: white;
    font-weight: 600;
}
/* *** OVERRIDE: Active Sub-Pill to Brown Gradient !important *** */
.temple-layout-wrapper .sub-pill.active { 
    background: var(--primary-color) !important;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 2px 5px rgba(139, 69, 19, 0.2) !important;
    font-weight: 600;
}

.temple-layout-wrapper .result-badge-sticky {
    font-size: 0.75rem;
    text-align: center;
    padding: 4px 0;
    background: #fff;
    border-top: 1px solid #eee;
    color: #888;
    margin-top: 0;
    letter-spacing: 0.5px;
}
.temple-layout-wrapper .result-badge-sticky .count { color: var(--primary-color); font-weight: 700; }

.temple-layout-wrapper .product-card { 
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    background: white;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.temple-layout-wrapper .product-image-wrapper { position: relative; overflow: hidden; background: #f8f8f8; aspect-ratio: 1 / 1; }
.temple-layout-wrapper .product-card-img { object-fit: cover; width: 100%; height: 100%; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.temple-layout-wrapper .btn-view-detail { 
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
    width: 100%; 
    text-align: center; 
    text-decoration: none; 
}
.temple-layout-wrapper .btn-view-detail:hover {
    color: white !important;
}
.temple-layout-wrapper .cta-section {
    background: var(--light-bg); 
    border: 2px dashed var(--primary-color); 
    border-radius: 12px;
    padding: 2rem 1.5rem; 
    margin-top: 3rem;
    text-align: center;
}
.temple-layout-wrapper .empty-state { text-align: center; padding: 3rem 1rem; }
.temple-layout-wrapper .empty-state-icon { font-size: 3rem; color: #ccc; margin-bottom: 1rem; }
#product-grid-wrapper.loading { opacity: 0.5; pointer-events: none; }

/* *** FIX 3: Adjust Product Title Size for Better Readability *** */
.temple-layout-wrapper .product-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    margin-bottom: 0.5rem;
    /* Ensure text doesn't overflow or look weird */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8rem; /* Fixed height for consistency */
}

/* STICKY ACTION BAR (MOBILE EO) */
.sticky-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1050;
    display: none; /* Show only on small screens */
    padding: 10px 15px;
    gap: 10px;
}
.sticky-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.sticky-btn-line {
    background-color: #00B900;
    color: white;
}
.sticky-btn-call {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
}

@media (max-width: 768px) {
    .temple-layout-wrapper .temple-hero { padding: 1.5rem 0; }
    .temple-layout-wrapper .temple-hero h1 { font-size: 1.3rem; }
    .temple-layout-wrapper .filter-sticky-container { padding-top: 0.5rem; }
    .temple-layout-wrapper .filter-pill { padding: 6px 14px; font-size: 0.85rem; }
    
    /* Better mobile text sizing */
    .temple-layout-wrapper .product-title { font-size: 0.95rem; }
    .temple-layout-wrapper .product-sku { font-size: 0.75rem; }
    
    /* Show sticky bar */
    .sticky-action-bar { display: flex; }
    /* Prevent footer from being hidden behind sticky bar */
    body { padding-bottom: 70px; } 
}
/* ===== UX ปรับปรุง ต.ค. 2569: การ์ดสินค้า / เนื้อหาวัด / ปุ่มหมวด ===== */
.temple-layout-wrapper .product-card-body { padding: .9rem 1rem .5rem; flex: 1 1 auto; display: flex; flex-direction: column; }
.temple-layout-wrapper .product-title a { color: #222 !important; }
.temple-layout-wrapper .product-sku { font-size: .8rem; color: #6b6b6b; margin-bottom: .6rem; }
.temple-layout-wrapper .variant-list { margin-top: auto; }
.temple-layout-wrapper .variant-item { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding: .35rem 0; border-top: 1px dashed #eadfd5; font-size: .88rem; }
.temple-layout-wrapper .variant-item .variant-size { color: #555; }
.temple-layout-wrapper .variant-item .variant-price { color: var(--primary-color); font-weight: 700; font-size: 1rem; white-space: nowrap; }
.temple-layout-wrapper .product-card-footer { padding: .5rem 1rem 1rem; }
.temple-layout-wrapper .btn-view-detail { background: #fff; color: var(--primary-color); border: 1.5px solid var(--primary-color); box-shadow: none; padding: .6rem; min-height: 44px; }
.temple-layout-wrapper .btn-view-detail:hover, .temple-layout-wrapper .btn-view-detail:focus-visible { background: var(--primary-color); color: #fff !important; }
.temple-layout-wrapper .product-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.temple-layout-wrapper .col.is-more { display: none; }
.temple-layout-wrapper .btn-load-more { border: 1.5px solid var(--primary-color); color: var(--primary-color); background: #fff; border-radius: 999px; padding: .7rem 2rem; font-weight: 600; min-height: 48px; }
.temple-layout-wrapper .btn-load-more:hover { background: var(--light-bg); }
.temple-layout-wrapper .filter-pill:focus-visible, .temple-layout-wrapper .sub-pill:focus-visible { outline: 3px solid var(--secondary-color); outline-offset: 2px; }
.temple-layout-wrapper .temple-description-content h2 { display: table; }
.temple-layout-wrapper .temple-description-content p, .temple-layout-wrapper .temple-description-content li { color: #444; line-height: 1.8; font-size: 1rem; max-width: 70ch; }
.temple-layout-wrapper .temple-description-content ul { padding-left: 1.25rem; margin-bottom: 1rem; }
.temple-layout-wrapper .temple-description-content strong { color: #222; }
@media (max-width: 576px) {
    .temple-layout-wrapper .product-card-body { padding: .7rem .7rem .4rem; }
    .temple-layout-wrapper .product-card-footer { padding: .4rem .7rem .8rem; }
    .temple-layout-wrapper .variant-item { font-size: .8rem; }
    .temple-layout-wrapper .variant-item .variant-price { font-size: .9rem; }
    .temple-layout-wrapper .temple-description-content { padding: 1.25rem; }
}
