/*
Theme Name: My Pham
Description: This is a child theme for Flatsome Theme
Author: Lâm Phúc
Template: flatsome
Version: 3.0
*/

/* ==========================================================================
   MỤC LỤC:
   1. TÙY CHỈNH CHUNG (GLOBAL & BUTTONS)
   2. HEADER, TÌM KIẾM & MEGA MENUS
   3. DANH MỤC & LƯỚI SẢN PHẨM (CATALOG & GRID)
   4. TRANG CHI TIẾT SẢN PHẨM (PDP)
   5. FORM ĐĂNG NHẬP / ĐĂNG KÝ
   6. FOOTER & SUBSCRIBE FORM
   ========================================================================== */

/* ==========================================================================
   1. TÙY CHỈNH CHUNG (GLOBAL & BUTTONS)
   ========================================================================== */
.img-inner.image-zoom.dark,
.attachment-original.size-original { border-radius: 15px !important; }
.button-tim-hieu-them-section3 { margin-top: 220px; }

/* Nút bấm hiệu ứng quét xanh (Sweep Button) */
.custom-btn-wrapper { display: flex; justify-content: flex-end; width: 100%; }
.custom-btn-sweep { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 6px 24px !important; background-color: #ffffff; border: 1px solid #555555; border-radius: 50px; color: #555555; text-decoration: none; font-size: 16px; overflow: hidden; transition: border-color 0.4s ease; }
.custom-btn-sweep::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: #3b5e2b; transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease-in-out; z-index: 1; }
.custom-btn-sweep .btn-text, .custom-btn-sweep .btn-icon { position: relative; z-index: 2; transition: color 0.4s ease-in-out; }
.custom-btn-sweep .btn-text { font-weight: 500; margin-right: 8px; }
.custom-btn-sweep:hover { border-color: #3b5e2b; }
.custom-btn-sweep:hover::before { transform: scaleX(1); }
.custom-btn-sweep:hover .btn-text, .custom-btn-sweep:hover .btn-icon { color: #ffffff; }

/* ==========================================================================
   2. HEADER, TÌM KIẾM & MEGA MENUS
   ========================================================================== */
.nav-spacing-xlarge>li { margin-left: 35px !important; }

/* Tìm kiếm AJAX */
.custom-ajax-search-wrapper { position: relative; max-width: 450px; width: 100%; }
.custom-search-form { display: flex; align-items: center; background-color: #e8edd9; border-radius: 50px; padding: 5px 20px; height: 30px; box-sizing: border-box; }
.custom-search-input { flex-grow: 1; border: none !important; background: transparent !important; box-shadow: none !important; outline: none !important; color: #3b5e2b; font-style: italic; font-size: 16px; padding: 0; }
.custom-search-input::placeholder { color: #4a7536; opacity: 0.8; }
.custom-search-btn { background: transparent !important; border: none !important; padding: 0; cursor: pointer; color: #3b5e2b; display: flex; align-items: center; justify-content: center; }
.custom-search-btn svg { transition: transform 0.2s ease; }
.custom-search-btn:hover svg { transform: scale(1.1); }
.custom-search-results { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); margin-top: 10px; z-index: 999; max-height: 400px; overflow-y: auto; }
.ajax-result-item { display: block; padding: 10px 15px; border-bottom: 1px solid #f0f0f0; text-decoration: none; color: #333; font-size: 14px; }
.ajax-result-item:hover { background-color: #f9f9f9; color: #3b5e2b; }
.ajax-result-item:last-child { border-bottom: none; }

/* Giỏ hàng & Icon Header */
.custom-header-actions { display: flex; align-items: center; gap: 25px; }
.action-icon { position: relative; display: inline-flex; text-decoration: none; cursor: pointer; }
.action-icon svg { transition: transform 0.2s ease; }
.action-icon:hover svg { transform: scale(1.1); }
.cart-badge { position: absolute; top: -8px; right: -12px; background-color: #e68c4d; color: #ffffff; font-size: 13px; font-weight: bold; min-width: 22px; height: 22px; border-radius: 20px; border: 2px solid #4b6b2d; display: flex; align-items: center; justify-content: center; padding: 0 5px; box-sizing: border-box; font-family: sans-serif; }

/* Mega Menu Tổng (5 cột) */
.custom-mega-menu-wrapper { background-color: #ffffff; border-radius: 12px; padding: 20px 20px 25px 20px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); max-width: 1200px; margin: 0 auto; box-sizing: border-box; }
.mega-menu-header { margin-bottom: 20px; }
.mega-view-all { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 700; color: #4b6b2d; text-transform: uppercase; text-decoration: none; transition: color 0.3s ease; }
.mega-view-all:hover { color: #f29b26; }
.mega-menu-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; }
.mega-menu-item { display: flex; flex-direction: column; text-decoration: none !important; }
.mega-img-box { width: 100%; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.mega-img-box img { width: 100%; height: auto; display: block; object-fit: cover; transition: transform 0.4s ease; }
.mega-menu-title { font-size: 13px; font-weight: 600; color: #333333; text-transform: uppercase; margin: 0; line-height: 1.4; text-align: left; transition: color 0.3s ease; }
.mega-menu-item:hover .mega-img-box img { transform: scale(1.05); }
.mega-menu-item:hover .mega-menu-title { color: #4b6b2d; }

/* Mega Menu Sản phẩm (Link + Hình) */
.custom-mega-menu-products { background: #ffffff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); padding: 30px; max-width: 1200px; margin: 0 auto; box-sizing: border-box; }
.mega-products-content { display: flex; gap: 40px; }
.mega-links-area { flex: 3; display: flex; flex-direction: column; justify-content: space-between; }
.mega-images-area { flex: 1; display: flex; flex-direction: column; gap: 20px; }
.mega-links-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px 20px; }
.mega-col-title { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 700; color: #4b6b2d; text-transform: uppercase; text-decoration: none; margin-bottom: 15px; transition: color 0.3s; }
.mega-col-title svg { width: 14px; height: 14px; }
.mega-col-title:hover { color: #f29b26; }
.mega-link-list { list-style: none; padding: 0; margin: 0; }
.mega-link-list li { margin-bottom: 12px; }
.mega-link-list a { color: #444444; text-decoration: none; font-size: 14px; transition: color 0.2s; }
.mega-link-list a:hover { color: #4b6b2d; font-weight: 500; }
.mega-bottom-link { margin-top: 30px; }
.mega-bottom-link a { display: inline-block; font-size: 14px; font-weight: 700; color: #4b6b2d; text-transform: uppercase; text-decoration: none; border-bottom: 2px solid #4b6b2d; padding-bottom: 2px; transition: color 0.3s, border-color 0.3s; }
.mega-bottom-link a:hover { color: #f29b26; border-color: #f29b26; }
.mega-promo-img { display: block; border-radius: 10px; overflow: hidden; height: 100%; }
.mega-promo-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s; }
.mega-promo-img:hover img { transform: scale(1.05); }

/* Mega Menu Về Chúng Tôi */
.custom-mega-menu-about { background: #ffffff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); padding: 35px; max-width: 1000px; margin: 0 auto; box-sizing: border-box; }
.mega-about-content { display: flex; align-items: center; }
.mega-about-links { flex: 1.3; border-right: 1px solid #f0f0f0; padding-right: 35px; }
.mega-about-image { flex: 1; padding-left: 35px; }
.mega-about-image img { width: 100%; height: auto; border-radius: 12px; display: block; object-fit: cover; }
.about-links-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px 15px; }
.about-link-item { display: flex; flex-direction: column; align-items: center; text-decoration: none !important; text-align: center; gap: 12px; }
.about-icon { width: 60px; height: 60px; background-color: #436b13; border-radius: 12px; display: flex; justify-content: center; align-items: center; color: #ffffff; transition: transform 0.3s, background-color 0.3s; }
.about-icon svg { width: 26px; height: 26px; }
.about-text { color: #444444; font-size: 13px; font-weight: 600; line-height: 1.4; transition: color 0.3s; }
.about-link-item:hover .about-icon { transform: translateY(-5px); background-color: #558718; }
.about-link-item:hover .about-text { color: #436b13; }

/* Sub-Menu dọc */
.custom-vertical-submenu { list-style: none !important; padding: 0 !important; margin: 0 !important; background-color: #ffffff; width: 260px; border-radius: 4px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); overflow: hidden; }
.custom-vertical-submenu li { margin: 0 !important; border-bottom: 1px dotted #b3b3b3; }
.custom-vertical-submenu li:last-child { border-bottom: none; }
.custom-vertical-submenu a { display: block !important; padding: 12px 20px !important; color: #4b6b2d !important; font-size: 15px !important; font-weight: 600 !important; text-decoration: none !important; transition: background-color 0.3s, color 0.3s; }
.custom-vertical-submenu a:hover { background-color: #4b6b2d !important; color: #ffffff !important; }

/* ==========================================================================
   3. DANH MỤC & LƯỚI SẢN PHẨM (CATALOG & GRID)
   ========================================================================== */

/* Thẻ Sản Phẩm (Hiển thị chung) */
.custom-product-col { padding-bottom: 20px; }
.custom-product-item { display: flex; flex-direction: column; }
.custom-product-item .product-img-box { width: 80% !important; margin: 0 auto 15px auto !important; padding: 0 !important; border-radius: 15px !important; overflow: hidden !important; position: relative; background-color: #faf8f0; }
.custom-product-item .product-img-box img { width: 100% !important; height: auto; display: block !important; margin: 0 !important; object-fit: cover; mix-blend-mode: multiply; }

/* Thông tin dưới ảnh */
.custom-product-item .product-info-box { width: 80% !important; margin: 0 auto !important; text-align: left !important; padding: 0 5px; }
.custom-product-item .product-title { font-size: 14px !important; font-weight: 600 !important; color: #333; margin-bottom: 5px !important; line-height: 1.4 !important; }
.custom-product-item .product-title a { color: #333; }
.custom-product-item .product-title a:hover { color: #436b13; }
.custom-product-item .product-price { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.custom-product-item .product-price .sale-price { font-size: 18px !important; font-weight: 700 !important; color: #cb5d2a; }
.custom-product-item .product-price .sale-price sup { font-size: 14px; text-decoration: underline; }
.custom-product-item .product-price .regular-price { font-size: 14px; color: #999; text-decoration: line-through; }
.product-rating { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #a0a0a0; }
.product-rating .stars { color: #eaa35d; letter-spacing: 2px; }

/* Huy hiệu (Tags/Sale) */
.badge { position: absolute; top: 15px; color: #fff; font-size: 11px; font-weight: bold; padding: 5px 6px; border-radius: 5px; z-index: 10; height: 1.8em; }
.discount-badge { left: 15px; background-color: #de7e2e; }
.product-tags-container { position: absolute; top: 15px; right: 5px; display: flex; flex-direction: column !important; align-items: flex-end !important; gap: 6px !important; }
.tag-badge { position: static; background-color: #436b13 !important; white-space: nowrap !important; text-align: center; }

/* Điều hướng Slider Trang Chủ */
.custom-products-row.slider .flickity-prev-next-button { top: 38% !important; transform: translateY(-50%) !important; width: 36px !important; height: 36px !important; }
.custom-products-row.slider .flickity-prev-next-button.previous { left: -10px !important; }
.custom-products-row.slider .flickity-prev-next-button.next { right: -10px !important; }

/* Bố cục Trang Danh Mục & Bộ Lọc */
.custom-catalog-wrapper form { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 20px; }
.catalog-sidebar { width: 250px; flex-shrink: 0; border-right: 1px solid #eaeaea; padding-right: 20px; }
.filter-group { margin-bottom: 30px; }
.filter-title { font-size: 16px; font-weight: bold; color: #555; margin-bottom: 15px; }
.filter-list { list-style: none; padding: 0; margin: 0; }
.filter-list li { margin-bottom: 10px; }
.custom-radio-checkbox { display: flex; align-items: center; position: relative; padding-left: 28px; cursor: pointer; font-size: 15px; color: #444; user-select: none; }
.custom-radio-checkbox input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.custom-radio-checkbox .checkmark { position: absolute; top: 50%; left: 0; transform: translateY(-50%); height: 18px; width: 18px; background-color: #fff; border: 1px solid #bbb; border-radius: 50%; transition: all 0.2s; }
.custom-radio-checkbox:hover input ~ .checkmark { border-color: #436b13; }
.custom-radio-checkbox input:checked ~ .checkmark { border-color: #436b13; border-width: 5px; }

.catalog-main { flex-grow: 1; width: calc(100% - 280px); }
.catalog-top-bar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eaeaea; padding-bottom: 15px; margin-bottom: 25px; }
.catalog-title { font-size: 20px; font-weight: bold; color: #333; margin: 0; }
.catalog-sort { display: flex; align-items: center; gap: 15px; font-size: 14px; font-weight: bold; color: #555; }
.catalog-sort select { padding: 8px 30px 8px 15px; border: 1px solid #ccc; border-radius: 20px; background-color: #fff; font-size: 14px; color: #333; outline: none; cursor: pointer; appearance: none; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'); background-repeat: no-repeat; background-position: right 12px center; background-size: 10px auto; }
.catalog-3-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ==========================================================================
   4. TRANG CHI TIẾT SẢN PHẨM (PDP)
   ========================================================================== */
.pdp-top-section { display: flex; gap: 40px; margin-bottom: 50px; flex-wrap: wrap; }
.pdp-gallery-col { flex: 1; min-width: 300px; max-width: 500px; }
.pdp-info-col { flex: 1; min-width: 300px; }

/* Hình ảnh Gallery */
.pdp-main-img { background: #faf8f0; border-radius: 12px; overflow: hidden; margin-bottom: 15px; }
.pdp-main-img img { width: 100%; height: auto; display: block; object-fit: cover; }
.pdp-thumbs { display: flex; gap: 10px; overflow-x: auto; }
.pdp-thumb-img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: border-color 0.3s; }
.pdp-thumb-img.active, .pdp-thumb-img:hover { border-color: #f29b26; }

/* Thông tin Cơ Bản */
.pdp-title { font-size: 26px; font-weight: 700; color: #333; margin-bottom: 15px; line-height: 1.3;}
.pdp-short-desc { background: #fcfdfa; border: 1px solid #e1e8db; border-radius: 12px; padding: 20px; font-size: 14px; color: #444; line-height: 1.6; }
.pdp-section-heading { font-size: 18px; font-weight: 700; color: #4b6b2d; text-transform: uppercase; border-bottom: 2px solid #4b6b2d; padding-bottom: 8px; display: inline-block; margin-bottom: 20px; }

/* Phân loại sản phẩm (Biến thể) */
.pdp-variations-box { margin-bottom: 25px; }
.variation-group { margin-bottom: 15px; }
.variation-title { font-size: 15px; font-weight: 600; color: #444; margin-bottom: 8px; }
.variation-options { display: flex; flex-wrap: wrap; gap: 5px; }
.variation-btn { background: #ffffff; border: 1px solid #4b6b2d; color: #4b6b2d; padding: 5px 10px; border-radius: 10px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.3s ease; }
.variation-btn:hover, .variation-btn.active { background: #4b6b2d; color: #ffffff; }

/* Số lượng & Giỏ hàng */
.pdp-action-box { display: flex; align-items: center; gap: 15px; margin: 15px 0 30px 0; flex-wrap: wrap;}
.qty-selector { display: flex; align-items: center; height: 45px; border: 1px solid #dcdcdc; border-radius: 25px; background: #fff; overflow: hidden; box-sizing: border-box; }
.qty-btn { background: transparent; border: none; width: 35px; height: 100%; font-size: 18px; font-weight: 500; cursor: pointer; color: #333; display: flex; align-items: center; justify-content: center; outline: none; }
#custom-qty-input { width: 45px; height: 100%; text-align: center; border: none; border-left: 1px solid #f0f0f0; border-right: 1px solid #f0f0f0; font-size: 16px; font-weight: 600; color: #333; -moz-appearance: textfield; outline: none; padding: 0; margin: 0; box-sizing: border-box; }
#custom-qty-input::-webkit-outer-spin-button, #custom-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.btn-add-cart-primary { height: 45px; background: #f29b26; color: #fff; border: none; padding: 0 35px; border-radius: 25px; font-weight: 700; font-size: 14px; cursor: pointer; transition: background 0.3s; box-sizing: border-box; display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.btn-add-cart-primary:hover { background: #d8871b; }

/* Tabs Nội dung (Mô tả, Nguyên liệu, HDSD) */
.custom-product-tabs .nav > li.tab { margin-right: 125px !important; }
.custom-product-tabs .nav > li.tab:last-child { margin-right: 0 !important; }
.custom-product-tabs .nav > li.tab > a { font-size: 20px !important; letter-spacing: 0px !important; color: black; }
.custom-product-tabs .nav > li.tab.active > a { color: #4b6b2d !important; }

.pdp-tabs-nav { display: flex; justify-content: center; gap: 60px; list-style: none; padding: 0; margin: 0 0 30px 0; border-bottom: 2px solid #eaeaea; }
.pdp-tabs-nav li { font-size: 18px; font-weight: 700; color: #666; padding-bottom: 12px; cursor: pointer; position: relative; transition: color 0.3s; }
.pdp-tabs-nav li.active { color: #3b5e2b; }
.pdp-tabs-nav li.active::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 3px; background: #3b5e2b; }
.pdp-tab-panel { display: none; animation: fadeInTab 0.4s ease; }
.pdp-tab-panel.active { display: block; }
@keyframes fadeInTab { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Khối thu gọn / Xem thêm */
.pdp-content-collapse { position: relative; max-height: 350px; overflow: hidden; transition: max-height 0.6s ease; }
.pdp-content-collapse.expanded { max-height: 10000px; }
.pdp-content-gradient { position: absolute; bottom: 0; left: 0; width: 100%; height: 100px; background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1)); transition: opacity 0.3s; }
.pdp-content-collapse.expanded .pdp-content-gradient { opacity: 0; pointer-events: none; }
.pdp-toggle-wrapper { text-align: center; margin-top: 20px; margin-bottom: 50px; }
.pdp-toggle-btn { background: transparent; border: 1px solid #4b6b2d; color: #4b6b2d; padding: 10px 30px; border-radius: 30px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.pdp-toggle-btn:hover { background: #4b6b2d; color: #fff; }

.pdp-reviews-box { background: #fcfcfc; border: 1px solid #eee; border-radius: 12px; padding: 30px; }

/* ==========================================================================
   5. FORM ĐĂNG NHẬP / ĐĂNG KÝ
   ========================================================================== */
.custom-login-wrapper { display: flex; justify-content: center; align-items: center; min-height: 60vh; padding: 40px 15px; background: #fafafa; }
.custom-login-box { background: #ffffff; width: 100%; max-width: 500px; padding: 40px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.login-title { text-align: center; font-size: 24px; font-weight: 700; color: #444; margin-bottom: 30px; }
.login-input { width: 100%; padding: 15px; margin-bottom: 20px; border: 1px solid #e0e0e0; border-radius: 5px; font-size: 15px; box-sizing: border-box; transition: border-color 0.3s; }
.login-input:focus { border-color: #4b6b2d; outline: none; }
.login-actions { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #666; margin-bottom: 25px; }
.login-actions a { color: #4b6b2d; text-decoration: none; }
.login-actions a:hover { text-decoration: underline; }
.btn-login-submit { width: 100%; background: #3b5e2b; color: #ffffff; padding: 15px; border: none; border-radius: 5px; font-size: 16px; font-weight: bold; cursor: pointer; transition: background 0.3s; }
.btn-login-submit:hover { background: #2d4721; }
.login-msg { text-align: center; margin-top: 15px; font-size: 14px; font-weight: 500; }
.login-footer { text-align: center; margin-top: 30px; font-size: 14px; color: #666; }
.login-footer a { color: #4b6b2d; font-weight: bold; text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }

/* ==========================================================================
   6. FOOTER & SUBSCRIBE FORM
   ========================================================================== */
.custom-subscribe-wrapper { width: 100%; max-width: 450px; }
#custom-subscribe-form { display: flex; background-color: #436b13; border-radius: 8px; padding: 6px; height: 50px; align-items: center; }
#custom-subscribe-form input[type="email"] { flex-grow: 1; background: transparent !important; border: none !important; box-shadow: none !important; color: #ffffff; font-size: 14px; font-style: italic; padding: 0 15px; margin-bottom: 0; }
#custom-subscribe-form input[type="email"]::placeholder { color: #a6c08e; }
#custom-subscribe-form button { background-color: #f29b26; color: #ffffff; border: none; border-radius: 5px; padding: 0 25px; font-weight: 700; font-size: 14px; height: 100%; cursor: pointer; transition: background 0.3s; }
#custom-subscribe-form button:hover { background-color: #d8871b; }

.custom-footer-area { background-color: #e8edd9; color: #3b5e2b; padding: 50px 15px 30px; font-size: 15px; line-height: 1.6; }
.custom-footer-container { max-width: 1200px; margin: 0 auto; }
.footer-top-section { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; flex-wrap: wrap; gap: 20px; }
.footer-brand { display: flex; align-items: center; gap: 20px; }
.footer-logo { max-height: 50px; object-fit: contain; }
.footer-slogan { font-size: 16px; font-weight: 600; letter-spacing: 0.5px; }
.footer-subscribe { flex: 1; max-width: 500px; display: flex; justify-content: flex-end; }
.footer-middle-section { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; margin-bottom: 50px; }
.footer-col { flex: 1; min-width: 200px; }
.footer-contact-col { flex: 1.5; }
.footer-heading { font-size: 16px; font-weight: bold; color: #3b5e2b; margin-bottom: 15px; text-transform: uppercase; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #3b5e2b; text-decoration: none; transition: color 0.3s; }
.footer-links a:hover { color: #f29b26; }
.store-locator-btn { display: inline-flex; align-items: center; gap: 10px; border: 1px solid #3b5e2b; padding: 10px 20px; color: #3b5e2b; font-weight: bold; text-decoration: none; border-radius: 5px; margin-bottom: 20px; transition: all 0.3s; }
.store-locator-btn:hover { background-color: #3b5e2b; color: #fff; }
.contact-info-grid { display: flex; gap: 20px; margin-bottom: 20px; }
.contact-item { display: flex; align-items: flex-start; gap: 10px; }
.contact-item a { color: #3b5e2b; text-decoration: none; }
.social-icons { display: flex; gap: 15px; }
.social-icons a { display: inline-flex; justify-content: center; align-items: center; width: 40px; height: 40px; background-color: #436b13; border-radius: 8px; transition: transform 0.3s; }
.social-icons a:hover { transform: translateY(-3px); }
.footer-bottom-section { display: flex; justify-content: space-between; align-items: flex-end; border-top: 1px solid #d0d8bc; padding-top: 30px; flex-wrap: wrap; gap: 20px; }
.company-details h4 { font-size: 16px; font-weight: bold; color: #3b5e2b; margin-bottom: 10px; }
.company-details p { margin: 0; }
.footer-badges { display: flex; gap: 15px; }
.footer-badges img { max-height: 40px; }

/* ==========================================================================
   Responsive (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 991px) {
    .mega-products-content, .mega-about-content { flex-direction: column; }
    .mega-links-grid { grid-template-columns: repeat(2, 1fr); }
    .mega-images-area { flex-direction: row; }
    .mega-about-links { border-right: none; border-bottom: 1px solid #f0f0f0; padding-right: 0; padding-bottom: 30px; margin-bottom: 30px; width: 100%; }
    .mega-about-image { padding-left: 0; width: 100%; }
    .about-links-grid { grid-template-columns: repeat(3, 1fr); }
    .custom-catalog-wrapper form { flex-direction: column; }
    .catalog-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #eaeaea; padding-bottom: 20px; }
    .catalog-main { width: 100%; }
    .catalog-top-bar { flex-direction: column; align-items: flex-start; gap: 15px; }
    .catalog-3-cols { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .mega-menu-grid { grid-template-columns: repeat(2, 1fr); }
    .custom-products-row.slider .flickity-prev-next-button { display: none; }
    .pdp-tabs-nav { gap: 20px; justify-content: space-between; }
    .pdp-tabs-nav li { font-size: 15px; }
    .footer-top-section { flex-direction: column; align-items: flex-start; }
    .footer-subscribe { justify-content: flex-start; width: 100%; }
    .contact-info-grid { flex-direction: column; }
}

@media (max-width: 576px) {
    .about-links-grid { grid-template-columns: repeat(2, 1fr); }
    .custom-login-box { padding: 30px 20px; }
    .login-actions { flex-direction: column; align-items: flex-start; gap: 10px; }
}




/* ==========================================================================
   GIAO DIỆN TRANG GIỎ HÀNG
   ========================================================================== */
.custom-cart-page-wrapper {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 15px;
    align-items: flex-start;
}

.cart-left-col { flex: 2; }
.cart-right-col { flex: 1; min-width: 300px; position: sticky; top: 20px; }

/* Bảng giỏ hàng */
.custom-cart-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.custom-cart-table thead { background: #f9f9f9; border-bottom: 2px solid #eaeaea; }
.custom-cart-table th { padding: 15px; text-align: left; font-weight: 600; color: #444; font-size: 15px; }
.custom-cart-table td { padding: 20px 15px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }

/* Các cột */
.col-img { width: 90px; }
.col-img img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; display: block; border: 1px solid #eee; }
.col-name strong { display: block; font-size: 15px; color: #333; margin-bottom: 5px; }
.cart-variant { font-size: 13px; color: #888; }
.col-price { color: #666; font-weight: 500; }
.col-total { font-size: 16px; }

/* Nút Tăng Giảm & Xóa */
.qty-selector.small { height: 35px; border-radius: 20px; max-width: 100px; }
.qty-selector.small .qty-btn { width: 25px; font-size: 16px; }
.qty-selector.small .qty-input { width: 40px; font-size: 14px; }
.btn-remove { background: #feebeb; color: #cb5d2a; border: none; width: 28px; height: 28px; border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; transition: all 0.3s; }
.btn-remove:hover { background: #cb5d2a; color: #fff; }

/* Cột Tổng kết (Bên phải) */
.cart-summary-box { background: #fff; border-radius: 12px; padding: 25px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid #e8edd9; }
.cart-summary-box h3 { font-size: 18px; color: #3b5e2b; border-bottom: 2px solid #e8edd9; padding-bottom: 15px; margin-bottom: 20px; font-weight: 700; text-transform: uppercase; }
.summary-row { display: flex; justify-content: space-between; font-size: 15px; color: #555; margin-bottom: 15px; }
.summary-row.total { font-size: 18px; color: #333; font-weight: 700; margin-top: 15px; }
.summary-row.total strong { color: #cb5d2a; font-size: 22px; }
.btn-checkout { display: block; width: 100%; background: #f29b26; color: #fff; text-align: center; padding: 15px; border-radius: 8px; font-weight: bold; font-size: 15px; text-decoration: none; transition: background 0.3s; margin-top: 25px; }
.btn-checkout:hover { background: #d8871b; color: #fff; }

/* Nút tiếp tục mua sắm (Khi rỗng) */
.btn-continue-shopping { display: inline-block; border: 2px solid #4b6b2d; color: #4b6b2d; padding: 10px 25px; border-radius: 25px; font-weight: bold; text-decoration: none; transition: all 0.3s; }
.btn-continue-shopping:hover { background: #4b6b2d; color: #fff; }

/* Responsive Mobile: Chuyển bảng thành dạng danh sách xếp chồng */
@media (max-width: 768px) {
    .custom-cart-page-wrapper { flex-direction: column; }
    .cart-right-col { width: 100%; position: static; }
    .custom-cart-table thead { display: none; }
    .custom-cart-table, .custom-cart-table tbody, .custom-cart-table tr, .custom-cart-table td { display: block; width: 100%; }
    .custom-cart-table tr { margin-bottom: 15px; border: 1px solid #eaeaea; border-radius: 10px; position: relative; padding: 15px; }
    .custom-cart-table td { padding: 10px 0; border: none; text-align: right; display: flex; justify-content: space-between; align-items: center; }
    .custom-cart-table td::before { content: attr(data-title); font-weight: 600; color: #666; }
    .custom-cart-table td.col-img { display: inline-block; padding: 0; }
    .custom-cart-table td.col-name { display: inline-block; text-align: left; width: calc(100% - 100px); vertical-align: top; padding-left: 15px; }
    .custom-cart-table td.col-name::before { display: none; }
    .custom-cart-table td.col-action { position: absolute; top: 15px; right: 15px; padding: 0; display: block; }
    .custom-cart-table td.col-action::before { display: none; }
}






/* --- FIX LỖI GIAO DIỆN BẢNG GIỎ HÀNG --- */
.custom-cart-table .qty-selector.small {
    display: inline-flex;
    align-items: center;
    height: 35px !important;
    border: 1px solid #ccc;
    border-radius: 20px;
    background: #fff;
    overflow: hidden;
}
.custom-cart-table .qty-selector.small .qty-btn {
    width: 25px; height: 100%; font-size: 16px; display: flex; align-items: center; justify-content: center;
}
.custom-cart-table .qty-selector.small .qty-input {
    width: 35px !important; height: 100% !important; text-align: center; border: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; background: transparent; pointer-events: none;
}
.custom-cart-table .btn-remove {
    display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; margin: 0 auto; line-height: 1;
}

/* --- FIX LỖI MÉO Ô SỐ LƯỢNG & NÚT XÓA Ở TRANG GIỎ HÀNG --- */
.custom-cart-table .qty-selector.small { 
    display: inline-flex !important; 
    align-items: center !important; 
    height: 36px !important; 
    border: 1px solid #ccc !important; 
    border-radius: 20px !important; 
    background: #fff !important; 
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important; 
}
.custom-cart-table .qty-selector.small .qty-btn { 
    margin-top: 15px !important;
    margin-left: 10px !important;
    width: 28px !important; 
    height: 36px !important; 
    background: transparent !important;
    border: none !important;
    font-size: 16px !important; 
    display: flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    color: #333 !important;
    padding: 0 !important;
}
.custom-cart-table .qty-selector.small .qty-input { 
    width: 35px !important; 
    height: 36px !important; 
    text-align: center !important; 
    border: none !important; 
    box-shadow: none !important; 
    padding: 0 !important; 
    margin: 0 !important; 
    background: transparent !important; 
    font-size: 14px !important;
    pointer-events: none !important; /* Ngăn khách tự gõ chữ làm méo khung */
}

/* Nút Xóa Hình Tròn Tuyệt Đối */
.custom-cart-table .btn-remove { 
    display: flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    width: 32px !important; 
    height: 32px !important; 
    padding: 20px !important; 
    margin: 0 auto !important; 
    border-radius: 50% !important; /* Bo tròn tuyệt đối */
    background: #feebeb !important; 
    color: #cb5d2a !important; 
    border: none !important; 
    font-size: 16px !important; 
    line-height: 1 !important; 
    cursor: pointer !important; 
}
.custom-cart-table .btn-remove:hover { background: #cb5d2a !important; color: #fff !important; }


/* ==========================================================================
   GIAO DIỆN QUẢN LÝ TÀI KHOẢN (DASHBOARD)
   ========================================================================== */
.custom-account-wrapper {
    display: flex;
    gap: 40px;
    max-width: 1200px;
    margin: 40px auto;
    align-items: flex-start;
}

/* Sidebar Menu Trái */
.account-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #fcfdfa;
    border: 1px solid #e8edd9;
    border-radius: 12px;
    overflow: hidden;
}

.account-user-info {
    text-align: center;
    padding: 30px 20px;
    background: #e8edd9;
    border-bottom: 1px solid #d0d8bc;
}

.account-user-info .avatar {
    width: 60px;
    height: 60px;
    background: #4b6b2d;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 10px;
}

.account-user-info .name {
    font-size: 18px;
    font-weight: bold;
    color: #3b5e2b;
}

.account-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.account-nav li {
    padding: 15px 20px;
    border-bottom: 1px solid #eaeaea;
    cursor: pointer;
    font-weight: 500;
    color: #555;
    transition: all 0.3s;
}

.account-nav li:last-child { border-bottom: none; }
.account-nav li:hover { background: #f2f5eb; color: #4b6b2d; }
.account-nav li.active { background: #4b6b2d; color: #fff; font-weight: bold; }
.account-nav li a { text-decoration: none; display: block; }

/* Nội dung bên phải */
.account-content {
    flex-grow: 1;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.account-tab-panel { display: none; animation: fadeInTab 0.4s ease; }
.account-tab-panel.active { display: block; }
.account-tab-panel h3 { font-size: 22px; color: #333; border-bottom: 2px solid #e8edd9; padding-bottom: 10px; margin-bottom: 20px; }

/* Bảng Đơn Hàng */
.custom-orders-table { width: 100%; border-collapse: collapse; }
.custom-orders-table th { background: #f9f9f9; padding: 12px; text-align: left; font-weight: 600; color: #444; border-bottom: 2px solid #eaeaea; }
.custom-orders-table td { padding: 15px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.custom-orders-table tr:hover td { background: #fafafa; }

/* Responsive Mobile */
@media (max-width: 768px) {
    .custom-account-wrapper { flex-direction: column; gap: 20px; }
    .account-sidebar { width: 100%; }
    .custom-orders-table thead { display: none; }
    .custom-orders-table, .custom-orders-table tbody, .custom-orders-table tr, .custom-orders-table td { display: block; width: 100%; }
    .custom-orders-table tr { margin-bottom: 15px; border: 1px solid #eaeaea; border-radius: 8px; padding: 10px; }
    .custom-orders-table td { text-align: right; padding: 8px 0; border: none; display: flex; justify-content: space-between; align-items: center; }
    .custom-orders-table td::before { content: attr(data-title); font-weight: bold; color: #666; }
}



/* ==========================================================================
   GIAO DIỆN TRANG TỔNG HỢP SẢN PHẨM (/san-pham)
   ========================================================================== */

.custom-catalog-page {
    max-width: 1200px;
    margin: 0 auto 50px auto;
    padding: 0 15px;
}

/* ==========================================================================
   BANNER ĐẦU TRANG TRÀN VIỀN MÀN HÌNH (CHIA ĐỀU 50/50)
   ========================================================================== */
.catalog-hero-banner-full {
    display: flex;
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 50px;
    overflow: hidden;
    align-items: stretch; /* Ép 2 cột căng đều nhau */
}

.catalog-hero-banner-full .banner-item {
    width: 50%; 
    flex-shrink: 0; 
    position: relative; /* Biến thẻ a thành một cái khung cố định */
    display: block;
    overflow: hidden;
    /* Tỷ lệ khung hình của TỪNG banner (Ngang 2 / Cao 0.7). Có thể tăng/giảm số 0.7 để chỉnh độ cao */
    aspect-ratio: 2 / 0.7; 
}

.catalog-hero-banner-full img {
    /* Ép ảnh gắn chặt vào 4 góc của khung (bỏ qua mọi định dạng của Theme) */
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    
    /* Ma thuật nằm ở đây: Tự động cắt cúp ảnh vừa vặn khung mà không bị méo/dẹt */
    object-fit: cover !important; 
    object-position: center !important; /* Luôn ưu tiên hiển thị tâm của bức ảnh */
    
    margin: 0 !important;
    padding: 0 !important;
    transition: transform 0.4s ease;
}

/* Hiệu ứng phóng to nhẹ khi trỏ chuột */
.catalog-hero-banner-full .banner-item:hover img {
    transform: scale(1.04) !important;
}

/* Responsive: Xếp dọc trên điện thoại */
@media (max-width: 768px) {
    .catalog-hero-banner-full {
        flex-direction: column;
        margin-bottom: 30px;
    }
    .catalog-hero-banner-full .banner-item {
        width: 100%;
        aspect-ratio: 2 / 1; /* Trên mobile nên để tỷ lệ 2:1 cho dễ nhìn */
    }
}


/* ==========================================================================
   CÁC KHỐI DANH MỤC SẢN PHẨM BÊN DƯỚI
   ========================================================================== */
.category-section {
    margin-bottom: 60px;
}

/* Header của danh mục (Tiêu đề + Nút xem tất cả) */
.cat-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.cat-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #3b5e2b;
    margin: 0;
    text-transform: uppercase;
}

.cat-view-all {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-decoration: none;
    border: 1px solid #ccc;
    padding: 6px 18px;
    border-radius: 20px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 15px;
    white-space: nowrap;
}

.cat-view-all:hover {
    background: #4b6b2d;
    color: #fff;
    border-color: #4b6b2d;
}

/* ========================================
   KIỂU PROMO: BANNER TRÁI + SLIDER PHẢI 
   ======================================== */
.cat-promo-layout {
    display: flex;
    gap: 30px;
    align-items: stretch;
}

.cat-promo-banner {
    flex: 0 0 35%; /* Banner chiếm 35% chiều rộng */
    border-radius: 12px;
    overflow: hidden;
    display: block;
}

.cat-promo-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}

.cat-promo-banner:hover img {
    transform: scale(1.05); /* Hiệu ứng zoom ảnh banner */
}

.cat-promo-products {
    flex: 1; /* Slider chiếm phần còn lại */
    min-width: 0; /* Lệnh quan trọng để Slider không bóp méo Flexbox */
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .cat-promo-layout { flex-direction: column; }
    .cat-promo-banner { flex: none; height: auto; }
}



/* ==========================================================================
   GIAO DIỆN TRANG BÀI VIẾT & THẺ BLOG
   ========================================================================== */

/* Thẻ bài viết */
.custom-blog-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.custom-blog-card:hover {
    transform: translateY(-5px);
}

.blog-img-box {
    width: 100%;
    aspect-ratio: 16 / 10; /* Tỷ lệ ảnh ngang chuẩn blog */
    overflow: hidden;
}

.blog-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.custom-blog-card:hover .blog-img-box img {
    transform: scale(1.05);
}

.blog-info-box {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    /* Ép hiển thị tối đa 2 dòng */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-title a { color: #3b5e2b; text-decoration: none; transition: color 0.3s; }
.blog-title a:hover { color: #f29b26; }

.blog-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
    /* Ép hiển thị tối đa 2 dòng */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-meta {
    font-size: 12px;
    color: #999;
    font-style: italic;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

/* Fix nút Slider cho Bài viết */
.custom-blog-row.slider .flickity-prev-next-button {
    top: 35% !important; /* Căn nút trượt vào giữa phần hình ảnh */
}

/* ==========================================================================
   BANNER CHIA ĐÔI (SPLIT BANNER TRONG TRANG BLOG)
   ========================================================================== */
.blog-split-banner {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 50px;
    background: #4b6b2d; /* Nền xanh lá */
    color: #fff;
    align-items: center;
}

.split-banner-img {
    flex: 1.2;
    aspect-ratio: 16 / 9;
}

.split-banner-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.split-banner-content {
    flex: 1;
    padding: 40px;
}

.split-banner-tag {
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.5);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.split-banner-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
}

.split-banner-desc {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 25px;
    opacity: 0.9;
}

.split-banner-btn {
    display: inline-block;
    border: 1px solid #fff;
    color: #fff;
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
}

.split-banner-btn:hover {
    background: #fff;
    color: #4b6b2d;
}

/* Lật ngược banner (Ảnh bên phải, Text bên trái) */
.blog-split-banner.reverse {
    flex-direction: row-reverse;
}

/* Banners Full ngang */
.blog-full-banner {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 50px;
}
.blog-full-banner img {
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 768px) {
    .blog-split-banner, .blog-split-banner.reverse { flex-direction: column; }
    .split-banner-img { width: 100%; }
    .split-banner-content { padding: 30px 20px; text-align: center; }
}






/* ==========================================================================
   GIAO DIỆN TRANG CHUYÊN MỤC BÀI VIẾT (CATEGORY)
   ========================================================================== */

/* Trình bày Phân trang (Pagination) dạng số tròn */
.custom-pagination ul.page-numbers {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.custom-pagination ul.page-numbers li {
    margin: 0;
}

.custom-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f1f5e8;
    color: #4b6b2d;
    border-radius: 50%;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.custom-pagination .page-numbers:hover,
.custom-pagination .page-numbers.current {
    background: #4b6b2d;
    color: #fff;
}

/* Hiệu ứng rê chuột bài viết cột phải */
.popular-post-item .pop-link:hover {
    color: #4b6b2d !important;
}

/* Ẩn sidebar trên mobile để ưu tiên nội dung chính */
@media (max-width: 768px) {
    .custom-blog-archive-row { flex-direction: column; }
    .custom-blog-sidebar { margin-top: 40px; border-top: 2px solid #e8edd9; padding-top: 30px; }
}




/* ==========================================================================
   GIAO DIỆN BÀI VIẾT CHI TIẾT & MỤC LỤC TỰ ĐỘNG
   ========================================================================== */

/* Định dạng khung nội dung bài viết */
.single-post-body h2 { font-size: 22px; color: #3b5e2b; margin-top: 30px; margin-bottom: 15px; }
.single-post-body h3 { font-size: 18px; color: #444; margin-top: 20px; margin-bottom: 10px; }
.single-post-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 20px 0; }
.single-post-body p { margin-bottom: 15px; }

/* Hiệu ứng hover cho sidebar */
.custom-post-sidebar .pop-info a:hover { color: #4b6b2d !important; }

/* --- NÚT MỞ MỤC LỤC LƠ LỬNG (Góc trái màn hình) --- */
.magic-toc-btn {
    position: fixed;
    top: 50%;
    left: -100px; /* Giấu nút ngoài màn hình */
    transform: translateY(-50%);
    background: #fdfdfd;
    border: 1px solid #4b6b2d;
    border-left: none; /* Áp sát mép màn hình */
    color: #4b6b2d;
    font-weight: bold;
    font-size: 13px;
    padding: 10px 15px 10px 10px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: left 0.4s ease;
}

.magic-toc-btn.visible {
    left: 0; /* Trượt ra khi cuộn */
}

.magic-toc-btn:hover {
    background: #4b6b2d;
    color: #fff;
}

/* --- CỬA SỔ MỤC LỤC TRƯỢT TỪ TRÁI SANG --- */
.magic-toc-panel {
    position: fixed;
    top: 20%;
    left: -320px; /* Giấu panel */
    width: 300px;
    max-height: 70vh;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 0 12px 12px 0;
    box-shadow: 5px 5px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.magic-toc-panel.active {
    left: 0; /* Mở panel */
}

.toc-header {
    background: #f4f7ed;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e8edd9;
    border-radius: 0 12px 0 0;
}

.toc-header h3 {
    margin: 0;
    font-size: 16px;
    color: #3b5e2b;
    font-weight: bold;
}

#close-toc-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #888;
    cursor: pointer;
}

#close-toc-btn:hover { color: #d63638; }

.toc-body {
    padding: 20px;
    overflow-y: auto;
}

.toc-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-body li { margin-bottom: 12px; line-height: 1.4; }
.toc-body li a { color: #555; text-decoration: none; font-size: 14px; transition: color 0.3s; }
.toc-body li a:hover { color: #4b6b2d; font-weight: 500; }

/* H3 thụt lề */
.toc-sub-item { padding-left: 20px; font-size: 13.5px; position: relative; }
.toc-sub-item::before { content: "-"; position: absolute; left: 8px; color: #ccc; }

/* Responsive Mobile */
@media (max-width: 768px) {
    .custom-post-content-col { order: 1; }
    .custom-post-sidebar { order: 2; margin-top: 40px; border-top: 2px solid #e8edd9; padding-top: 30px; }
    .magic-toc-panel { width: 85%; top: 10%; max-height: 80vh; }
}