
/* --- 1. BASE & MOOD TONE --- */
:root {
    --primary: #1a3c34;     /* เขียวเข้มลึกแบบสมุนไพรต้นตำรับ */
    --accent: #2d5a4c;      /* เขียวใบไม้หม่น */
    --gold: #d4a017;        /* ทองโบราณ ดูมีค่า */
    --gold-light: #efc368;
    --bg-cream: #fcfbf7;    /* พื้นหลังครีมแบบกระดาษโบราณสะอาดตา */
    --white: #ffffff;
    --text-main: #1a3c34;
    --text-muted: #5a716c;
    --transition: all 0.3s ease;
}

/* เพิ่มการเลื่อนแบบนุ่มนวล */
html { scroll-behavior: smooth; }

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Sarabun', sans-serif; 
    background-color: var(--bg-cream); 
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden; 
}

h1, h2, h3, h4, .brand { font-family: 'Playfair Display', 'Sarabun', serif; }
input, button, select, textarea { font-family: 'Sarabun', sans-serif; }

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- 2. LAYOUT UTILITIES --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; width: 100%; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-column { flex-direction: column; }
.section { padding: 80px 0; }
.gap-4 { gap: 1.5rem; }

/* --- 3. COMPONENTS --- */

/* Header */
.header { padding: 15px 0; background: var(--bg-cream); border-bottom: 1px solid rgba(26,60,52,0.05); position: sticky; top: 0; z-index: 1000; }
.header_logo { font-size: 26px; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 12px; }

.brand-logo-svg {
    width: 48px;
    height: 48px;
    display: block;
}

.header_nav-list { display: flex; gap: 30px; }
.header_nav-list_item a { font-weight: 600; font-size: 15px; color: var(--primary); opacity: 0.8; }
.header_nav-list_item a:hover { opacity: 1; color: var(--gold); }

.header_user { display: flex; align-items: center; gap: 15px; }
.header_user-action { width: 42px; height: 42px; background: var(--white); border: 1px solid #eee; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primary); transition: 0.3s; position: relative; cursor: pointer; }
.header_user-action:hover { background: var(--gold); color: #fff; border-color: var(--gold); }

.hamburger-btn { display: none; overflow: hidden; }

/* --- Hamburger Animation Styles --- */
.hamburger-btn svg line {
    transition: transform 0.3s ease, opacity 0.2s ease;
    transform-origin: center;
}
.hamburger-btn.active svg line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.hamburger-btn.active svg line:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}
.hamburger-btn.active svg line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* --- Mobile Overlay Menu --- */
/* --- Mobile Overlay Menu --- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.mobile-menu-overlay.active { opacity: 1; visibility: visible; }
.mobile-menu-overlay_close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.mobile-menu-item {
    transition-delay: 0.1s; /* เพิ่ม delay ให้เมนูค่อยๆ โผล่มาทีละบรรทัด */
}

.mobile-menu-list {
    text-align: center;
}
.mobile-menu-item {
    margin-bottom: 25px;
    transform: translateY(20px);
    opacity: 0;
    transition: 0.4s ease;
}
.mobile-menu-overlay.active .mobile-menu-item {
    transform: translateY(0);
    opacity: 1;
}

.mobile-menu-link {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    font-family: 'Playfair Display', 'Sarabun', serif;
    transition: var(--transition);
}
.mobile-menu-link:hover {
    color: var(--gold-light);
}
/* --- Cart Dropdown Styles --- */
.cart-wrapper { position: relative; }
.cart-badge { 
    position: absolute; top: -5px; right: -5px; 
    background: var(--gold); color: white; 
    font-size: 10px; width: 18px; height: 18px; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; border: 2px solid var(--white);
}
.cart-dropdown {
    position: absolute; top: 55px; right: 0;
    width: 350px; background: var(--white);
    border-radius: 12px; box-shadow: 0 15px 50px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.05);
    display: none; flex-direction: column;
    overflow: hidden; z-index: 1100;
}
.cart-dropdown.active { display: flex; animation: fadeInDown 0.3s ease; }
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.cart-dropdown_header { padding: 15px 20px; border-bottom: 1px solid #f0f0f0; font-weight: 700; color: var(--primary); font-size: 16px; background: #fafafa; }
.cart-dropdown_list { max-height: 300px; overflow-y: auto; padding: 10px 0; }
.cart-item { display: flex; align-items: center; padding: 12px 20px; border-bottom: 1px solid #f9f9f9; transition: 0.2s; }
.cart-item:hover { background: #fcfbf7; }
.cart-item_img { width: 60px; height: 60px; border-radius: 8px; background: #f4f6f5; object-fit: cover; margin-right: 15px; }
.cart-item_info { flex: 1; }
.cart-item_name { font-weight: 700; font-size: 14px; color: var(--primary); margin-bottom: 4px; display: block; }
.cart-item_price { color: var(--accent); font-weight: 600; font-size: 13px; }
.cart-item_qty { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

.qty-btn { 
    width: 24px; 
    height: 24px; 
    border-radius: 50%; 
    border: 1px solid #ddd; 
    background: #fff; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    line-height: 0; 
    padding-bottom: 4px; 
    cursor: pointer; 
    font-size: 18px; 
    font-weight: 500;
    color: var(--primary);
    transition: 0.2s;
}
.qty-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.qty-val { font-size: 14px; font-weight: 700; min-width: 20px; text-align: center; }

.cart-dropdown_footer { padding: 20px; border-top: 1px solid #f0f0f0; background: #fff; }
.cart-total { display: flex; justify-content: space-between; margin-bottom: 15px; font-weight: 700; color: var(--primary); }
.cart-btn-primary { 
    display: block; width: 100%; text-align: center; 
    background: var(--primary); color: #fff; padding: 12px; 
    border-radius: 6px; font-weight: 700; font-size: 14px; transition: 0.3s;
}
.cart-btn-primary:hover { background: var(--gold); }
.cart-empty-msg { padding: 30px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* --- 4. ARTICLE DETAIL STYLES --- */
.breadcrumb { padding: 20px 0; font-size: 14px; color: var(--text-muted); }
.breadcrumb span { margin: 0 8px; }

.article-layout { display: flex; gap: 40px; align-items: flex-start; }
.article-main { flex: 1; background: var(--white); border-radius: 15px; overflow: hidden; border: 1px solid rgba(26,60,52,0.05); box-shadow: 0 10px 30px rgba(0,0,0,0.02); }

.article-hero { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: #f4f6f5; }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }

.article-content { padding: 40px; }
.article-meta { display: flex; gap: 20px; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px; }
.article-title { font-size: 38px; color: var(--primary); line-height: 1.3; margin-bottom: 25px; font-weight: 800; }

.article-body { font-size: 17px; color: #444; line-height: 1.8; }
.article-body p { margin-bottom: 25px; }
.article-body h2 { font-size: 26px; color: var(--primary); margin: 40px 0 20px 0; }
.article-body ul { margin-bottom: 25px; padding-left: 20px; }
.article-body li { margin-bottom: 10px; list-style-type: disc; color: var(--text-muted); }

.quote-box { background: var(--bg-cream); border-left: 4px solid var(--gold); padding: 30px; margin: 40px 0; font-style: italic; font-size: 19px; color: var(--accent); }

.article-footer { margin-top: 50px; padding-top: 30px; border-top: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.share-links { display: flex; gap: 10px; align-items: center; }
.share-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #eee; display: flex; align-items: center; justify-content: center; color: var(--primary); transition: 0.3s; }
.share-btn:hover { background: var(--gold); color: #fff; border-color: var(--gold); }

/* Sidebar Styles */
.sidebar { flex: 0 0 350px; position: sticky; top: 100px; }
.sidebar-card { background: var(--white); padding: 30px; border-radius: 15px; border: 1px solid rgba(26,60,52,0.05); box-shadow: 0 10px 30px rgba(0,0,0,0.02); margin-bottom: 30px; }
.sidebar-title { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 20px; border-bottom: 2px solid var(--bg-cream); padding-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }

.related-article { display: flex; gap: 15px; margin-bottom: 20px; transition: 0.3s; }
.related-article:hover { opacity: 0.8; }
.related-article_img { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; background: #f4f6f5; flex-shrink: 0; }
.related-article_info { display: flex; flex-direction: column; justify-content: center; }
.related-article_title { font-size: 14px; font-weight: 700; color: var(--primary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-article_date { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

.promo-banner { background: var(--primary); color: #fff; padding: 30px; border-radius: 15px; text-align: center; }
.promo-banner h4 { font-size: 20px; margin-bottom: 15px; color: var(--gold-light); }
.promo-banner p { font-size: 14px; opacity: 0.8; margin-bottom: 20px; }
.btn-sm { display: inline-block; padding: 10px 20px; background: var(--gold); color: #fff; border-radius: 4px; font-weight: 700; font-size: 13px; text-transform: uppercase; transition: 0.3s; }
.btn-sm:hover { background: var(--white); color: var(--primary); }

/* Footer */
.footer { background: var(--primary); padding-top: 80px; color: #fff; }
.footer_main { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 50px; margin-bottom: 60px; }
.footer_main-header { font-size: 19px; font-weight: 800; margin-bottom: 25px; color: var(--gold-light); }
.footer_main p { font-size: 14px; color: rgba(255,255,255,0.7); }
.footer_main .header_logo { color: #fff; margin-bottom: 20px; }
.footer_main a { color: rgba(255,255,255,0.8); transition: var(--transition); }
.footer_main a:hover { color: var(--gold-light); }

.footer_contact-list { margin-top: 10px; }
.footer_contact-list li { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 14px; color: rgba(255,255,255,0.7); }
.footer_contact-list .svg-icon { width: 18px; height: 18px; color: var(--gold-light); flex-shrink: 0; stroke-width: 2.5; }

/* Social Icons in Footer */
.footer_social-list { display: flex; gap: 15px; margin-top: 20px; }
.footer_social-link { 
    width: 40px; 
    height: 40px; 
    background: rgba(255,255,255,0.08); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: var(--gold-light); 
    border: 1px solid rgba(255,255,255,0.1); 
    transition: var(--transition); 
}
.footer_social-link:hover { 
    transform: translateY(-3px); 
}
.footer_social-link[title="Facebook"]:hover { color: #1877F2; }
.footer_social-link[title="Instagram"]:hover { color: #E4405F; }
.footer_social-link[title="YouTube"]:hover { color: #FF0000; }

.footer_social-link .svg-icon { width: 20px; height: 20px; }

.svg-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }

.footer_secondary { padding: 30px 0; border-top: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; font-size: 13px; color: rgba(255,255,255,0.5); }


@media (max-width: 992px) {
    .article-layout { flex-direction: column; }
    .sidebar { flex: 0 0 auto; width: 100%; position: static; }
    .article-title { font-size: 30px; }
    .header_nav { display: none; }
    .hamburger-btn { display: flex; }
    .footer_main { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .footer_main { grid-template-columns: 1fr; gap: 30px; text-align: center; }
    .footer_contact-list li { justify-content: center; }
    .footer_secondary { flex-direction: column; text-align: center; gap: 10px; }
    /* เลือก a.header_user-action ตัวแรก (รูปหัวใจ) แล้วซ่อนทิ้ง */
    .header_user > a.header_user-action:first-child {
        display: none;
    }

    /* ปรับระยะขอบเล็กน้อยเพื่อให้ตะกร้าและเมนูดูสมดุลขึ้น */
    .header_user {
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .article-content { padding: 25px; }
    .article-title { font-size: 24px; }

    .cart-dropdown { width: calc(100vw - 30px); right: -15px; position: fixed; top: 70px; left: 15px; }
    .footer_social-list { justify-content: center; }
}
