
/* --- 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 & Navigation) --- */
.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; padding: 0; }
.header_user-action:hover { background: var(--gold); color: #fff; border-color: var(--gold); }

.hamburger-btn { display: none; background: none; border: none; cursor: pointer; }
.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-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: 20px; right: 20px; color: #fff; background: none; border: none; cursor: pointer; transition: transform 0.4s; }
.mobile-menu-overlay.active .mobile-menu-overlay_close { transform: rotate(90deg); }
.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; }

/* 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; }
.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; }
.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); 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; cursor: pointer; }
.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; }

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

.product-main { background: var(--white); padding: 30px; border-radius: 12px; display: flex; gap: 40px; box-shadow: 0 5px 20px rgba(0,0,0,0.03); margin-bottom: 30px; border: 1px solid rgba(26,60,52,0.05); }
.product-media { flex: 0 0 450px; }
.product-media_main { width: 100%; aspect-ratio: 1/1; background: #f8f8f8; border-radius: 8px; overflow: hidden; margin-bottom: 15px; }
.product-media_main img { width: 100%; height: 100%; object-fit: cover; }
.product-media_thumbs { display: flex; gap: 10px; }
.thumb { width: 80px; height: 80px; border: 2px solid transparent; border-radius: 4px; overflow: hidden; cursor: pointer; }
.thumb.active { border-color: var(--gold); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-info { flex: 1; }
.product-info_title { font-size: 28px; color: var(--primary); margin-bottom: 15px; font-weight: 700; line-height: 1.4; }
.product-info_stats { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; font-size: 14px; }
.rating-stars { color: var(--gold); border-right: 1px solid #eee; padding-right: 20px; }
.rating-count { border-right: 1px solid #eee; padding-right: 20px; text-decoration: underline; cursor: pointer; }

.product-info_price-box { background: #fafafa; padding: 20px; border-radius: 8px; margin-bottom: 25px; }
.price-current { font-size: 36px; font-weight: 800; color: var(--accent); }
.price-original { text-decoration: line-through; color: #999; margin-left: 10px; font-size: 18px; }

.product-option_row { display: flex; margin-bottom: 20px; align-items: flex-start; }
.option_label { width: 110px; color: #757575; font-size: 14px; padding-top: 8px; }
.option_content { flex: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.option-btn { border: 1px solid #e8e8e8; padding: 10px 18px; border-radius: 4px; font-size: 14px; cursor: pointer; background: #fff; transition: 0.2s; }
.option-btn.active { border-color: var(--gold); color: var(--gold); font-weight: 600; }

.qty-input { display: flex; border: 1px solid #e8e8e8; width: fit-content; border-radius: 4px; overflow: hidden; }
.qty-btn-local { width: 40px; height: 40px; background: #fff; border: none; cursor: pointer; font-size: 20px; }
.qty-val-local { width: 60px; border-left: 1px solid #e8e8e8; border-right: 1px solid #e8e8e8; text-align: center; line-height: 40px; font-size: 16px; font-weight: 700; }

.product-actions { display: flex; gap: 15px; margin-top: 30px; }
.btn-add-cart { background: rgba(212, 160, 23, 0.1); border: 1px solid var(--gold); color: var(--gold); flex: 1; padding: 16px; font-weight: 700; cursor: pointer; border-radius: 6px; display: flex; align-items: center; justify-content: center; gap: 10px; transition: 0.3s; }
.btn-buy-now { background: var(--primary); color: #fff; flex: 1; padding: 16px; font-weight: 700; border-radius: 6px; border: none; cursor: pointer; transition: 0.3s; }

.details-layout { margin-top: 20px; align-items: flex-start; }
.product-sidebar { flex: 0 0 300px; }
.sidebar-card { background: var(--white); padding: 25px; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.03); border: 1px solid rgba(26,60,52,0.05); }
.sidebar-title { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 20px; border-bottom: 2px solid var(--bg-cream); padding-bottom: 12px; }
.side-product { display: block; margin-bottom: 25px; }
.side-product_img { width: 100%; aspect-ratio: 1; border-radius: 8px; margin-bottom: 10px; object-fit: cover; }
.side-product_name { font-size: 14px; color: #333; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 40px; }
.side-product_price { font-size: 16px; color: var(--gold); font-weight: 700; margin-top: 5px; display: block; }

.detail-card { background: var(--white); padding: 30px; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.03); border: 1px solid rgba(26,60,52,0.05); margin-bottom: 25px; }
.detail-card_title { background: #fafafa; padding: 15px 30px; margin: -30px -30px 25px -30px; font-size: 18px; font-weight: 700; color: var(--primary); border-bottom: 1px solid #eee; }

/* เพิ่มส่วนนี้เข้าไปในไฟล์ CSS */
.detail-card.reviews-section {
    min-height: 750px; /* กำหนดความสูงเผื่อไว้สำหรับ Summary และรายการรีวิวประมาณ 3-5 รายการ */
    display: flex;
    flex-direction: column;
}

#reviewList {
    flex: 1;
    min-height: 400px; /* ความสูงเฉพาะส่วนรายการรีวิว */
}

.spec-list { display: grid; grid-template-columns: 200px 1fr; gap: 15px; font-size: 15px; }
.spec-label { color: #757575; }

.review-header { display: flex; align-items: center; gap: 40px; margin-bottom: 30px; }
.review-summary .big { font-size: 48px; font-weight: 800; color: var(--gold); }
.review-item { padding: 25px 0; border-bottom: 1px solid #f0f0f0; }
.review-images { display: flex; gap: 10px; margin-top: 15px; }
.review-img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; border: 1px solid #eee; cursor: pointer; }

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


/* Image Modal */
.img-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 5000; display: none; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.img-modal.active { display: flex; }
.img-modal_content { max-width: 90%; max-height: 85vh; border-radius: 8px; transform: scale(0.9); transition: 0.3s; }
.img-modal.active .img-modal_content { transform: scale(1); }
.img-modal_close { position: absolute; top: 30px; right: 30px; color: #fff; cursor: pointer; background: none; border: none; font-size: 30px; }

@keyframes fadeInDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 992px) {
    .product-main { flex-direction: column; }
    .product-media { flex: 0 0 auto; width: 100%; }
    .details-layout { flex-direction: column; }
    .product-sidebar { width: 100%; }
    .header_nav { display: none; }
    .hamburger-btn { display: flex; }
    .footer_main { grid-template-columns: 1fr 1fr; }
    #recommendedList { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
@media (max-width: 576px) {
        .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; }
    .review-header { flex-direction: column; align-items: flex-start; gap: 20px; }
    .price-current { font-size: 30px; }
        .header_user > a.header_user-action:first-child {
        display: none;
    }

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

/* ส่วนที่เพิ่มใน CSS */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    padding-bottom: 20px;
}

.page-link-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e8e8e8;
    background: var(--white);
    color: var(--text-main);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: var(--transition);
}

.page-link-btn:hover:not(.active) {
    border-color: var(--gold);
    color: var(--gold);
}

.page-link-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
