
/* --- 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; /* ป้องกันการล้นของหน้าจอ */
}

/* แก้ไข: เพิ่ม Sarabun เป็น fallback ให้กับภาษาไทยในหัวข้อ และเพิ่มการสืบทอดฟอนต์ให้ Input/Button */
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; }
.section--nopb { padding: 80px 0 0 0; }
.col-xl-6 { flex: 0 0 50%; max-width: 50%; width: 100%; }

/* --- 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; }

/* ปรับขนาดโลโก้ SVG ให้เหมาะสม */
.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); }

/* Mobile Hamburger - Hidden by default */
.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;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
}
.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; }

/* Hero */
.hero { padding: 60px 0; }
.hero_content-header_title { font-size: 56px; line-height: 1.1; margin-bottom: 20px; color: var(--primary); }
.hero_content-header_text { font-size: 17px; color: var(--text-muted); margin-bottom: 35px; }

/* แก้ไข: ปรับปุ่มให้ default เป็นสีทองหรูหรา */
.btn { 
    display: inline-block; 
    padding: 16px 45px; 
    background: var(--gold); 
    color: #fff; 
    border-radius: 4px; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    box-shadow: 0 10px 20px rgba(212, 160, 23, 0.25); 
    transition: 0.4s; 
    border: none; 
    cursor: pointer; 
}
.btn:hover { 
    background: var(--primary); 
    transform: translateY(-3px); 
    box-shadow: 0 15px 25px rgba(26, 60, 52, 0.2); 
}

/* แก้ไข: สำหรับส่วน promo ไม่ต้องใส่ shadow ในตอนปกติ และใส่ shadow ตอน hover เป็นสีทอง 0.2 */
.promo .btn {
    box-shadow: none;
}
.promo .btn:hover {
    background: var(--gold);
    box-shadow: 0 10px 25px rgba(212, 160, 23, 0.2);
}

.features-list { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-top: 50px; }
.features-list_item .wrapper { display: flex; align-items: center; gap: 15px; }
.features-list_item .icon { width: 50px; height: 50px; background: #fff; border: 1px solid #eee; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--accent); }

.hero_media { flex: 0 0 50%; max-width: 50%; text-align: right; position: relative; }
.hero_media::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(252, 251, 247, 0) 75%);
    z-index: 0;
    pointer-events: none;
}
.hero_media img { position: relative; z-index: 1; max-width: 100%; height: auto; }

/* Popular Products - Added Dimension with White Background */
.popular.section { background-color: var(--white); border-top: 1px solid rgba(26,60,52,0.05); border-bottom: 1px solid rgba(26,60,52,0.05); }
.popular_header { text-align: center; margin-bottom: 50px; }
.popular_header-title { font-size: 38px; margin-bottom: 10px; color: var(--primary); }

/* วางแถวละ 4 (แถวละสี่) ตามความนิยมสากล */
.popular_slider { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }

.product_card { background: #fff; border-radius: 15px; padding: 15px; transition: 0.4s; border: 1px solid transparent; display: flex; flex-direction: column; }
.product_card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(26,60,52,0.08); border-color: #eee; }

.product_card .media { 
    border-radius: 10px; 
    overflow: hidden; 
    position: relative; 
    margin-bottom: 15px; 
    aspect-ratio: 3/4; 
    background: radial-gradient(circle, rgba(255, 255, 255, 0.7) 10%, #f4f6f5 100%); 
}
.product_card .media img { width: 100%; height: 100%; object-fit: cover; }

/* Ribbon Styling */
.product_card .media .ribbon {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--gold);
    color: #fff;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    z-index: 5;
    border-bottom-right-radius: 10px;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main_rating { color: var(--gold); font-size: 24px; margin-bottom: 5px; display: flex; justify-content: center; gap: 3px; }
.product_sold_count { text-align: center; font-size: 12px; color: var(--text-muted); margin-bottom: 10px; opacity: 0.8; }
.product_card .main_title { display: block; font-size: 19px; font-weight: 700; margin-bottom: 10px; color: var(--primary); text-align: center; }
.product_card .price { display: block; font-weight: 800; color: var(--accent); font-size: 20px; text-align: center; margin-top: auto; }

.product_overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(26,60,52,0.5); display: flex; justify-content: center; align-items: center; opacity: 0; transition: 0.3s; backdrop-filter: blur(2px); }
.product_card:hover .product_overlay { opacity: 1; }
.overlay_action { width: 40px; height: 40px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 5px; color: var(--primary); cursor: pointer; transition: 0.3s; }
.overlay_action:hover { background: var(--gold); color: #fff; }

/* Promo */
.promo { background: var(--primary); color: #fff; border-radius: 20px; overflow: hidden; margin: 80px 0; position: relative; }
.promo .section { padding: 40px 0; position: relative; z-index: 1; }

.promo::before {
    content: '';
    position: absolute;
    top: 50%;
    right: -10%;
    transform: translateY(-50%);
    width: 80%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.17) 0%, rgba(26, 60, 52, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

.promo_img_wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}
.promo_img_wrapper img { position: relative; z-index: 1; max-width: 100%; height: auto; }

.promo_timer { display: flex; gap: 20px; margin: 30px 0; flex-wrap: wrap; }
.timer_block { background: rgba(255,255,255,0.08); padding: 15px; border-radius: 10px; text-align: center; min-width: 80px; border: 1px solid rgba(255,255,255,0.1); flex: 1; }
.timer_block span:first-child { display: block; font-size: 28px; font-weight: 800; color: var(--gold-light); }
.timer_block span:last-child { font-size: 12px; text-transform: uppercase; opacity: 0.7; }

/* --- News Card Section Styling --- */
.knowledge_grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.news_card { background: #fff; border-radius: 15px; overflow: hidden; border: 1px solid #eee; transition: var(--transition); display: flex; flex-direction: column; height: 100%; }
.news_card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(26,60,52,0.08); }

.news_card-media { aspect-ratio: 16/9; overflow: hidden; background: #f4f6f5; width: 100%; }
.news_card-media img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.news_card:hover .news_card-media img { transform: scale(1.05); }

.news_card-content { padding: 25px; display: flex; flex-direction: column; flex-grow: 1; }
.news_card-title { font-size: 22px; font-weight: 700; color: var(--primary); margin-bottom: 12px; line-height: 1.4; } 
.news_card-caption { font-size: 16px; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }

.news_card-btn { 
    margin-top: auto; 
    color: var(--gold); 
    font-weight: 700; 
    font-size: 17px; 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    transition: var(--transition); 
}
.news_card-btn:hover { color: var(--primary); text-decoration: underline; }

/* FAQ - Added Dimension with White Background */
.faq.section { background-color: var(--white); border-top: 1px solid rgba(26,60,52,0.05); }
.accordion_component-item { background: #fdfdfd; border-radius: 10px; margin-bottom: 15px; border: 1px solid #eee; overflow: hidden; }
.accordion_component-item_header { padding: 25px; cursor: pointer; font-weight: 700; display: flex; justify-content: space-between; font-size: 18px; color: var(--primary); }
.accordion_component-item_body { padding: 0 25px 25px; color: var(--text-muted); font-size: 15px; }

/* Scroll To Top Button */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gold);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border: none;
    outline: none;
}
.scroll-top.show {
    opacity: 1;
    visibility: visible;
}
.scroll-top:hover {
    background: var(--primary);
    transform: translateY(-5px);
}

/* 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); }

/* Responsive - Improved Viewport Handling */
@media (max-width: 1024px) {
    .popular_slider { grid-template-columns: repeat(3, 1fr); gap: 20px; }
    .knowledge_grid { gap: 20px; }
    .header_nav { gap: 15px; }
}

@media (max-width: 992px) {
    .hero_content-header_title { font-size: 42px; }
    .popular_slider { grid-template-columns: repeat(2, 1fr); }
    .knowledge_grid { grid-template-columns: repeat(2, 1fr); }
    .footer_main { grid-template-columns: 1fr 1fr; }
    .col-xl-6 { flex: 0 0 100%; max-width: 100%; text-align: center; }
    .hero_media { display: none; }
    .features-list { justify-content: center; }
    .cart-dropdown { width: 300px; right: -50px; }
    
    .promo .container { flex-direction: column-reverse; }
    .promo_img_wrapper { margin-top: 40px; }
    .promo_timer { justify-content: center; }

    .promo::before { 
        width: 100%; 
        height: 100%; 
        right: 0; 
        top: 0; 
        transform: none; 
        background: radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.17) 0%, rgba(26, 60, 52, 0) 100%); 
    }
}

/* เจาะจงเฉพาะปุ่มใน Hero Content */
.hero_content .btn {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
}

@media (max-width: 768px) {
    .header_nav { display: none; }
    .header_user-action-heart { display: none; }
    .hamburger-btn { display: flex; }

    .section { padding: 60px 0; }
    .popular_header-title { font-size: 30px; }
    .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; }
    .scroll-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
    .hero_content .btn {
        font-size: 20px;
        padding: 15px 40px;
    }
}

@media (max-width: 576px) {
    .popular_slider { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .knowledge_grid { grid-template-columns: 1fr; gap: 20px; }
    .product_card { padding: 10px; border-radius: 10px; }
    .product_card .main_title { font-size: 15px; margin-bottom: 5px; }
    .product_card .price { font-size: 16px; }
    .main_rating { font-size: 18px; }

    .news_card-content { padding: 15px; }
    .news_card-title { font-size: 18px; margin-bottom: 8px; } 
    .news_card-caption { font-size: 14px; } 
    
    .hero_content-header_title { font-size: 32px; }
    
    /* แก้ไขตามคำสั่ง: ปุ่มในจอเล็กไม่ต้องเต็มจอ */
    .btn { padding: 12px 30px; font-size: 14px; text-align: center; }
    
    .timer_block { padding: 10px; min-width: 60px; }
    .timer_block span:first-child { font-size: 20px; }
    .timer_block span:last-child { font-size: 10px; }
    
    .promo .section { padding: 30px 15px; }
    .promo h2 { font-size: 28px !important; }
    
    .cart-dropdown { width: calc(100vw - 30px); right: -15px; position: fixed; top: 70px; left: 15px; }
    .footer_social-list { justify-content: center; }
}

@media (max-width: 400px) {
    .popular_slider { grid-template-columns: repeat(2, 1fr); } 
    .knowledge_grid { grid-template-columns: 1fr; } 
    .features-list { grid-template-columns: 1fr; }
}
