/* Template ststore_v3 – bổ sung cho ega-theme.css (CSS trang tham khảo đã đóng phạm vi .ega).
   1) Biến :root + font khai báo inline trong <head> của trang tham khảo (omegaplus.vn/index.html).
   2) Nối markup tham khảo với JS cũ (ststore-v2.js): menu trượt điện thoại (#stv2Nav.is-open), ô tìm kiếm (#stv2Search.is-open).
   3) Slider dùng carousel Bootstrap 5 sẵn có thay slick; icon Font Awesome thay ảnh PNG của trang tham khảo. */

/* ---------- 1. Biến & font (giữ nguyên giá trị trang tham khảo) ---------- */
.ega {
    --text-color: #282828;
    --body-background: #F8F8F8;
    --text-secondary-color: #666666;
    --primary-color: #2f336f;
    --secondary-color: #292929;
    --price-color: #EB3030;
    --subheader-background: #e5677d;
    --subheader-color: #f9f9f6;
    --header-category-bg: #a50a06;
    --header-category-color: #fff3f4;
    --label-background: #EB3030;
    --label-color: #ffffff;
    --footer-bg: #ffffff;
    --footer-color: #111111;
    --sale-pop-color: #eed104;
    --addtocart-bg: #282828;
    --addtocart-text-color: #ffffff;
    --cta-color: #282828;
    --col-menu: 4;
    --border-color: #f1f1f1;
    --link-color: #EC720E;
    --link-hover-color: #2f5acf;
    --policies-bg: #2f336f;
    --policies-color: #ffffff;
    --reviewBg: #2f336f;
    --starColor: #ffffff;
    --btn-radius: 0px;
    --primary-button-background: #fff;
    --border-radius: 0px;
    font-family: 'Be Vietnam Pro', sans-serif;
    color: var(--text-color);
}
/* Trang tham khảo hiển thị nền trắng (các khối .card trắng liền mạch) */
body.ega-body { background: #fff; }
.ega-home { background: #fff; padding-bottom: 1px; }
.ega h1, .ega h2, .ega h3, .ega h4, .ega h5, .ega h6, .ega button, .ega input { font-family: 'Be Vietnam Pro', sans-serif; }
.ega a:hover { text-decoration: none; }

/* ---------- 2a. Header dính + ô tìm kiếm (JS cũ bật .is-open) ---------- */
.ega-header-scope { position: sticky; top: 0; z-index: 1030; }
/* body { overflow-x: hidden } của theme sau khi đóng phạm vi thành .ega { overflow-x: hidden } -> cắt submenu; header không cần */
.ega.ega-header-scope { overflow: visible; }
.ega-header-scope .ega-header { background: #fff; }
.ega-header-scope .ega-header.is-scrolled { box-shadow: 0 2px 12px rgba(0, 0, 0, .08); }
.ega-header-scope #logo img { max-height: 56px; width: auto; }
.ega .header-right__icons .header-icon { display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--text-color); cursor: pointer; position: relative; }
.ega .header-right__icons .header-icon a { color: inherit; }
/* Theme gốc dùng ảnh PNG cho icon và đặt chữ header màu trắng -> ép icon Font Awesome về màu chữ */
/* chỉ 3 icon chính (không áp vào link trong hộp tài khoản / giỏ hàng nhỏ) */
.ega .header-right__icons > .icon-action__search > i, .ega .header-right__icons #icon-account > a, .ega .header-right__icons #icon-account > a > i,
.ega .header-right__icons .mini-cart > a, .ega .header-right__icons .mini-cart > a > i { color: var(--text-color) !important; }
.ega .mini-cart .count_item { top: -6px; right: -10px; }
.ega .ega-search { display: none; border-top: 1px solid var(--border-color); background: #fff; padding: 12px 0; }
.ega .ega-search.is-open { display: block; }
.ega .ega-caret i { font-size: 10px; margin-left: 6px; }
.ega .account-action a { display: block; white-space: nowrap; }

/* Submenu 1 cột (menu "Sách", combo): mở ngay dưới mục, rộng theo nội dung thay vì full container */
@media (min-width: 992px) {
    .ega .submenu.ega-submenu--flat { left: 0; right: auto; width: auto; min-width: 240px; }
    .ega .submenu.ega-submenu--flat .submenu__list { display: block; width: auto; max-width: none; padding: 12px 0; }
    .ega .submenu.ega-submenu--flat .submenu__item--main { display: block; padding: 6px 20px; white-space: nowrap; }
    .ega .menu-item:hover > .submenu { opacity: 1; visibility: visible; pointer-events: auto; }
    /* ega-theme.css chỉ mở submenu khi `a:hover + .submenu`; nút mở menu điện thoại (.ega-mnav-toggle) chèn giữa <a> và
       .submenu làm quy tắc đó không còn khớp → menu "Tủ sách", "Combo sách"… không mở được khi rê chuột. Mở theo cả mục menu. */
    .ega .navigation .menu-item:hover > .submenu, .ega .navigation .menu-item:focus-within > .submenu { display: block; z-index: 900; opacity: 1; visibility: visible; pointer-events: auto; }
    .ega .ega-mnav-head { display: none !important; }
}

/* ---------- 2b. Menu trượt trên điện thoại (#stv2Nav.is-open do JS cũ bật) ---------- */
@media (max-width: 991.98px) {
    .ega #stv2Nav { display: block !important; position: fixed; top: 0; left: 0; bottom: 0; width: 300px; max-width: 86vw; background: #fff; z-index: 1050;
        transform: translateX(-100%); transition: transform .25s; overflow-y: auto; }
    .ega #stv2Nav.is-open { transform: none; }
    .ega .ega-mnav-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border-color); }
    .ega .ega-mnav-close { background: none; border: 0; font-size: 20px; }
    /* .navigation-wrapper của theme cao cố định + overflow hidden (thanh menu ngang) -> cắt danh sách trong menu trượt */
    .ega #stv2Nav .navigation-wrapper, .ega #stv2Nav nav, .ega #stv2Nav .navigation { overflow: visible; height: auto; max-height: none; }
    .ega #stv2Nav .navigation { flex-direction: column; }
    .ega #stv2Nav .ega-caret { display: none; }
    .ega #stv2Nav .menu-item { width: 100%; border-bottom: 1px solid var(--border-color); }
    .ega #stv2Nav .menu-item__link { display: flex; justify-content: space-between; padding: 12px 16px; }
    .ega #stv2Nav .submenu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; padding: 0 16px 10px; display: block; }
    .ega #stv2Nav .submenu__list { display: block; padding: 0; }
    .ega #stv2Nav .submenu__item, .ega #stv2Nav .submenu__col { display: block; padding: 5px 0; }
    /* Dưới .ega-header (z 1000) để không che menu trượt nằm trong header */
    .ega .opacity_menu.is-open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 999; }
}

/* ---------- 3. Slider: carousel Bootstrap 5 với giao diện nút/chấm của trang tham khảo ---------- */
.ega .home-slider .carousel-item img { width: 100%; height: auto; }
.ega .home-slider .slick-arrow { width: 44px; height: 44px; top: 50%; transform: translateY(-50%); bottom: auto; border-radius: 50%; background: rgba(255, 255, 255, .85);
    color: #282828; opacity: 0; transition: opacity .2s; margin: 0 16px; border: 0; }
.ega .home-slider:hover .slick-arrow { opacity: 1; }
.ega .home-slider .carousel-indicators { margin-bottom: 12px; }
.ega .home-slider .carousel-indicators [data-target] { width: 24px; height: 4px; border: 0; border-radius: 2px; background: #fff; opacity: .5; }
.ega .home-slider .carousel-indicators .active { opacity: 1; background: var(--primary-color); }

/* Icon lửa thay ảnh flashsale-hot.png */
.ega .ega-hot-icon { color: #f5780b; font-size: 20px; }

/* Lookbook: danh sách bộ sách có dấu đầu dòng (CSS cũ của site bỏ list-style toàn cục), ảnh rộng hết cột */
.ega .lookbook-desc-content ul { list-style: disc; padding-left: 20px; text-align: left; }
.ega .lookbook-desc-content li { list-style: disc; }
.ega .lookbook-desc-content a { color: inherit; }
.ega .lookbook-image-wrap img { width: 100% !important; max-height: none; }

/* Thẻ sách: ảnh bìa đứng (sách ST-Store) đặt giữa khung vuông như trang tham khảo */
.ega .item_product_main .image_thumb img { object-fit: contain; }

/* Video: nút play bằng icon */
.ega .video-play-button { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; }

/* Instagram: icon */
.ega .insta-icon { color: #fff; font-size: 28px; }

/* Đánh giá: sao */
.ega .star-vote i { color: var(--starColor); margin-right: 2px; }

/* Dải chính sách: icon Font Awesome thay ảnh PNG, cả khối là link */
.ega .policies-item { color: var(--policies-color); text-decoration: none; }
.ega .policies-item:hover { color: var(--policies-color); opacity: .9; }
.ega .policies-image i { font-size: 30px; line-height: 1; }
.ega .policies-title, .ega .policies-desc { color: var(--policies-color) !important; }

/* Footer: icon mạng xã hội + ứng dụng thay ảnh PNG */
.ega .ega-social { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-right: 8px; border-radius: 50%;
    background: var(--primary-color); color: #fff !important; font-size: 15px; }
.ega .ega-apps a { display: inline-flex; align-items: center; gap: 6px; margin: 0 8px 8px 0; padding: 6px 12px; border: 1px solid var(--border-color); border-radius: 4px; color: var(--footer-color); font-size: 13px; }
.ega .ega-bct { color: var(--footer-color); font-size: 13px; }
.ega .ega-bct i { color: #1a8f3c; }

/* custom0e2e.css của site ép .container { max-width: var(--container-width, 1280px) !important } -> đặt biến theo
   độ rộng container của trang tham khảo (1320px từ 1200px, 1650px từ 1800px) để khung trang khớp */
.ega { --container-width: 1320px; }
@media (min-width: 1800px) { .ega { --container-width: 1650px; } }

/* Theme xoay thẻ <i> trong .menu-item__link 45° (thiết kế cho icon SVG); quy tắc áp cả icon con -> xoay bù để mũi tên hướng xuống */
.ega .menu-item__link .ega-caret i { transform: rotate(-45deg) !important; display: inline-block; }

/* Footer: theme gốc ẩn danh sách link trên điện thoại và cần JS của họ để mở -> luôn hiện (không dùng JS tham khảo) */
@media (max-width: 991.98px) {
    .ega .footer-click .toggle-mn { display: block !important; }
    .ega .header-right__icons { gap: 4px; }
}

/* Đánh giá: chữ trắng trên nền --reviewBg (theme gốc tô màu bằng JS) */
.ega .feedback_header--left, .ega .feedback_header--left h3, .ega .feedback_header--left h4, .ega .feedback_header--left h5,
.ega .feedback_header--left p, .ega .feedback_header--left span { color: #fff; }

/* Video chưa có ảnh: khung 16:9 nền tối + tiêu đề */
.ega .ega-video-noimg { display: flex; align-items: flex-end; aspect-ratio: 16 / 9; padding: 12px; background: linear-gradient(135deg, #2f336f, #11132b);
    color: #fff; font-size: 14px; font-weight: 600; text-align: left; }

/* Video/Instagram: theme gốc chia ô bằng JS slick -> dùng CSS (cuộn ngang, 3 video / 5 ảnh trên máy tính) */
.ega .tiktok_slide_body .hrz-scroll { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; }
.ega .tiktok_slide_item { flex: 0 0 calc((100% - 40px) / 3); max-width: calc((100% - 40px) / 3); scroll-snap-align: start; }
/* Instagram: theme đã có lưới 5 cột -> ô lấp đầy cột, vuông; ảnh phủ kín */
.ega .insta_body .insta_item { width: 100%; max-width: none; aspect-ratio: 1 / 1; height: auto; display: block; position: relative; overflow: hidden; }
.ega .insta_body .insta_item::before { display: none; }
.ega .insta_body .insta_item img { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; }
@media (max-width: 767.98px) {
    .ega .tiktok_slide_item { flex-basis: 80%; max-width: 80%; }
}
.ega .ega-apps .fa-check-circle { color: #1a8f3c; }

/* Menu "Sách": dùng lại kiểu thả xuống 4 cột của ststore_v2 (.stv2-mega* trong ststore-v2.css).
   Mục menu của theme có position: relative -> đặt static để khung trải hết bề ngang header; căn lề theo container 1320px. */
@media (min-width: 992px) {
    .ega .navigation .menu-item.ega-v2mega { position: static; }
    .ega .ega-v2mega .stv2-mega { z-index: 900; padding: 24px max(24px, calc((100vw - 1320px) / 2 + 15px)); text-align: left; }
    .ega .ega-v2mega .stv2-mega__link, .ega .ega-v2mega .stv2-mega__chip { font-weight: 400; }
}
@media (max-width: 991.98px) {
    .ega #stv2Nav .ega-v2mega .stv2-mega { display: block; position: static; padding: 0 8px 12px; }
}

/* ---------- Menu trượt điện thoại: menu con thu gọn + nút mũi tên; icon tài khoản (14/10/2026) ---------- */
.ega .ega-mnav-toggle { display: none; }
@media (max-width: 991.98px) {
    .ega #stv2Nav .menu-item.has-submenu { position: relative; }
    .ega #stv2Nav .menu-item.has-submenu > .menu-item__link { padding-right: 60px; }
    .ega #stv2Nav .ega-mnav-toggle { display: flex; align-items: center; justify-content: center; position: absolute; top: 4px; right: 8px;
        width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #4a4f5c; font-size: 14px; }
    .ega #stv2Nav .ega-mnav-toggle:active, .ega #stv2Nav .ega-mnav-toggle:focus-visible { background: #f1f2f6; outline: none; }
    .ega #stv2Nav .ega-mnav-toggle i { transition: transform .2s; }
    .ega #stv2Nav .menu-item.ega-sub-open > .ega-mnav-toggle i { transform: rotate(180deg); }
    .ega #stv2Nav .menu-item.ega-sub-open > .menu-item__link { color: var(--primary-color, #2f336f); font-weight: 600; }
    /* ẩn menu con cho tới khi mở (ghi đè display:block ở trên) */
    .ega #stv2Nav .menu-item.has-submenu > .submenu,
    .ega #stv2Nav .ega-v2mega > .stv2-mega { display: none; }
    .ega #stv2Nav .menu-item.ega-sub-open > .submenu,
    .ega #stv2Nav .menu-item.ega-sub-open.ega-v2mega > .stv2-mega { display: block; background: #f8f9fb; }
    /* icon tài khoản trên điện thoại: chỉ là link, không hiện menu thả xuống (hover) */
    .ega .header-right__icons { grid-template-columns: repeat(3, 40px) !important; gap: 2px !important; align-items: center; }
    .ega #icon-account .account-action { display: none !important; }
    /* 3 ô icon bằng nhau, icon căn giữa cùng cỡ (trước: <a> tài khoản padding-right 15px, giỏ padding 0 5px -> khoảng cách lệch 9px / 26px) */
    .ega .header-right__icons > .header-icon, .ega .header-right__icons > .mini-cart { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; padding: 0; margin: 0; }
    .ega #icon-account > a, .ega .mini-cart > a.cart-count { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; padding: 0 !important; margin: 0; position: relative; }
    .ega .header-right__icons i.fas, .ega .header-right__icons i.far { font-size: 22px !important; width: 24px; height: 24px; line-height: 24px; text-align: center; }
    .ega .mini-cart > a.cart-count .count_item { top: 0; right: -2px; }
}
/* Màu link như ststore_v2 (theme v3 tô mọi <a> màu --link-color cam) */
.ega .ega-v2mega .stv2-mega__link, .ega .ega-v2mega .stv2-mega__chip { color: var(--stv2-text); }
.ega .ega-v2mega .stv2-mega__link i { color: var(--stv2-accent); }
.ega .ega-v2mega .stv2-mega__link:hover, .ega .ega-v2mega .stv2-mega__chip:hover { color: var(--stv2-primary); }

/* Thẻ sách: 2 nút trên ảnh (<button> giỏ hàng + <a> xem chi tiết) căn giữa đều nhau – <a> mặc định inline nên icon bị lệch */
.ega .item_product_main .product-thumbnail .action-bar { align-items: stretch; }
.ega .item_product_main .product-thumbnail .action-bar .action-child { display: inline-flex; align-items: center; justify-content: center; line-height: 1; vertical-align: top; color: var(--text-color); }
.ega .item_product_main .product-thumbnail .action-bar .action-child i { font-size: 16px; line-height: 1; }
/* Hàng sao dưới tên sách */
.ega .item_product_main .ega-card-rating { display: block; margin: 2px 0 4px; text-decoration: none; }

/* Header: 3 icon (tìm kiếm, tài khoản, giỏ) thẳng hàng – .d-lg-block của Bootstrap đè display:flex của ô tài khoản
   nên icon tài khoản nằm sát mép trên; đồng bộ cỡ 24px và căn giữa theo chiều dọc cho cả 3 */
@media (min-width: 992px) {
    .ega .header-right__icons #icon-account { display: flex !important; }
}
.ega .header-right__icons > * { display: flex; align-items: center; justify-content: center; }
.ega .header-right__icons .header-icon > a, .ega .header-right__icons .mini-cart > a { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.ega .header-right__icons > .icon-action__search > i, .ega .header-right__icons #icon-account > a > i, .ega .header-right__icons .mini-cart > a > i { font-size: 24px !important; line-height: 1 !important; }

/* =====================================================================
   Header: hộp tài khoản, giỏ hàng nhỏ, ô tìm kiếm – giống trang tham khảo (khung/hiện-ẩn dùng CSS theme:
   #icon-account .account-action, .mini-cart:hover .top-cart-content). JS: res/js/ega-header.js
   ===================================================================== */
/* Hộp tài khoản: căn giữa dưới icon, chữ trắng, rộng theo nội dung */
.ega .ega-header .header-right__icons #icon-account { position: relative; }
.ega .ega-header .header-right__icons #icon-account .account-action { top: calc(100% + 12px); left: 50%; transform: translateX(-50%); min-width: 140px; padding: 6px 0;
    opacity: 0; visibility: hidden; text-align: left; white-space: nowrap; z-index: 99; }
.ega .ega-header .header-right__icons #icon-account .account-action:after { top: -6px; }
.ega .ega-header .header-right__icons #icon-account .account-action a { color: #fff !important; padding: 7px 14px; font-size: 14px; font-weight: 500; }
.ega .ega-header .header-right__icons #icon-account .account-action a i { color: #fff !important; font-size: 13px !important; margin-right: 4px; }

/* Giỏ hàng nhỏ */
.ega .mini-cart { position: relative; }
.ega .mini-cart .ega-minicart__tip { position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%); padding: 2px 6px; border: 1px solid #ccc; border-radius: 2px;
    background: #f5f5f5; color: #333; font-size: 12px; white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity .15s; pointer-events: none; z-index: 200; }
.ega .mini-cart > a:hover + .ega-minicart__tip { opacity: 1; visibility: visible; transition-delay: .6s; }
.ega .ega-minicart { padding: 16px; border-radius: 4px; background: #fff; text-align: left; }
.ega .ega-minicart__loading, .ega .ega-minicart__empty { padding: 16px 0; text-align: center; color: #8a8a8a; position: relative; z-index: 1; }
.ega .ega-minicart__empty i { font-size: 32px; color: #ccc; }
.ega .ega-minicart__empty p { margin: 8px 0 0; }
.ega .ega-minicart__list { position: relative; z-index: 1; max-height: 330px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.ega .ega-minicart__item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.ega .ega-minicart__thumb { flex: 0 0 64px; }
.ega .ega-minicart__thumb img { width: 64px; height: 84px; object-fit: contain; }
.ega .ega-minicart__info { flex: 1; min-width: 0; }
.ega .ega-minicart__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; line-height: 1.4; color: var(--text-color) !important; }
.ega .ega-minicart__price { margin-top: 4px; font-size: 14px; color: var(--text-color); }
.ega .ega-minicart__price b { color: var(--price-color); }
.ega .ega-minicart__remove { flex: 0 0 auto; border: 0; background: none; padding: 2px 4px; color: #222; font-size: 16px !important; cursor: pointer; }
.ega .ega-minicart__remove i { font-size: 16px !important; color: #222 !important; }
.ega .ega-minicart__total { position: relative; z-index: 1; margin-top: 8px; padding-top: 16px; border-top: 1px solid #eee; text-align: center; font-size: 15px; }
.ega .ega-minicart__total b { color: var(--price-color); font-size: 17px; }
.ega .ega-minicart__checkout { position: relative; z-index: 1; display: block; margin-top: 12px; padding: 13px; background: var(--cta-color); color: #fff !important; text-align: center;
    font-size: 16px; font-weight: 600; }
.ega .ega-minicart__checkout:hover { filter: brightness(1.25); }
@media (max-width: 991.98px) { .ega .mini-cart .top-cart-content, .ega .mini-cart .ega-minicart__tip { display: none !important; } }

/* Ô tìm kiếm trong hàng header (bấm kính lúp): ẩn menu, thanh tìm kiếm bo tròn giữa header, từ khoá gợi ý bên dưới */
.ega .ega-header .ega-form-search { flex: 1 1 auto; max-width: 650px; margin: 0 auto; padding: 14px 0 8px; }
.ega .ega-header .ega-form-search[hidden] { display: none !important; }
.ega .ega-header.is-search-open #stv2Nav { display: none !important; }
.ega .ega-header.is-search-open .icon-action__search { display: none !important; }
.ega .ega-header.is-search-open .header-wrap { align-items: flex-start; }
.ega .ega-header.is-search-open #logo, .ega .ega-header.is-search-open .header-right { align-self: center; }
.ega .ega-form-search .search-bar { display: flex; flex-wrap: nowrap; border: 1px solid #222; border-radius: 999px; padding: 3px; background: #fff; }
.ega .ega-form-search .input-group-field { flex: 1; height: 40px; border: 0 !important; box-shadow: none !important; padding: 0 16px; font-size: 15px; background: transparent; }
.ega .ega-form-search .btn-action .btn { height: 40px; min-width: 88px; border: 0; border-radius: 999px; background: #2b2b2b; color: #fff; }
.ega .ega-form-search .btn-action .btn i { color: #fff !important; font-size: 18px !important; }
.ega .ega-form-search .search__list { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0 0; padding: 0; list-style: none; }
.ega .ega-form-search .search__list a { font-size: 13px; color: #6c757d; }
.ega .ega-form-search .search__list a:hover { color: var(--text-color); }
/* nằm trong .ega-header-scope (sticky z 1030): dưới header (z 1000) để header vẫn sáng, trên nội dung trang */
.ega-search-layer { display: none; position: fixed; inset: 0; z-index: 999; background: rgba(0, 0, 0, .45); }
.ega-search-layer.is-open { display: block; }
@media (max-width: 991.98px) {
    .ega .ega-header .ega-form-search { position: absolute; left: 0; right: 0; top: 100%; max-width: none; padding: 12px 16px; background: #fff; box-shadow: 0 8px 16px rgba(0, 0, 0, .1); }
    .ega .ega-header.is-search-open .icon-action__search { display: flex !important; }
}
/* custom0e2e.css (CSS cũ của site) tô nền xanh lá cho mọi .header-icon:hover – trùng tên class với theme mới */
.ega .header-icon:hover, .ega .header-icon .active { background: transparent !important; }
/* Mở ô tìm kiếm: header giãn theo nội dung để dòng từ khoá gợi ý nằm trong header */
@media (min-width: 992px) {
    .ega .ega-header.is-search-open .header-wrap { height: auto !important; min-height: 0; padding-bottom: 4px; }
}
/* Giỏ nhỏ: theme đặt mọi <a> trong .header-right là flex + justify-content: flex-end → tên sách lệch, chữ nút dồn phải */
.ega .header-right .ega-minicart__name { display: -webkit-box !important; justify-content: flex-start !important; text-align: left !important; }
.ega .header-right .ega-minicart__checkout { display: block !important; text-align: center !important; }
.ega .header-right .ega-minicart__thumb { display: block !important; }
/* Ô tìm kiếm: header-wrap là grid 250px | 1fr | 250px → ô lấp đầy cột giữa, tối đa 650px như trang tham khảo, căn giữa */
@media (min-width: 992px) {
    .ega .ega-header .ega-form-search { width: 100%; max-width: 650px; justify-self: center; }
    .ega .ega-header .ega-form-search .search-bar { width: 100%; }
}

/* Thẻ sách hết hàng (tổng tồn kho = 0): nhãn "Hết hàng" giữa đáy ảnh, ảnh mờ nhẹ; nút thêm giỏ đã ẩn ở _product_card.php */
.ega .item_product_main .ega-sold-out { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 2; padding: 4px 12px; border-radius: 4px; background: rgba(33, 37, 41, .85); color: #fff; font-size: 13px; line-height: 1.3; white-space: nowrap; pointer-events: none; }
.ega .item_product_main.is-sold-out .image_thumb img { opacity: .55; }

/* ---------- Marketing (12/10/2026): flash sale, popup, đăng ký nhận tin ---------- */
.ega .item_product_main .ega-flash-tag { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 3px 8px; border-radius: 4px; background: #DA273F; color: #fff; font-size: 12px; line-height: 1.3; pointer-events: none; }
.ega .item_product_main .ega-flash-time { margin-top: 4px; font-size: 12px; color: #DA273F; }
.estore-flash-home .flashsale__title, .estore-flash-home .flashsale__title i { color: #DA273F; }
.estore-flash-home__time { font-size: 14px; color: #444; }
.estore-flash-home__time b, .estore-flash-bar__time b { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #DA273F; color: #fff; font-variant-numeric: tabular-nums; }
.estore-flash-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; padding: 8px 12px; border-radius: 6px; background: linear-gradient(90deg, #DA273F, #ff6a3d); color: #fff; }
.estore-flash-bar__label { font-weight: 700; letter-spacing: .5px; }
.estore-flash-bar__time b { background: rgba(0, 0, 0, .25); }

.estore-popup { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.estore-popup[hidden] { display: none; }
.estore-popup__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.estore-popup__box { position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; border-radius: 10px; background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.estore-popup__close { position: absolute; top: 6px; right: 8px; z-index: 1; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .9); font-size: 24px; line-height: 1; cursor: pointer; }
.estore-popup__img { display: block; width: 100%; height: auto; }
.estore-popup__body { padding: 16px 20px 20px; text-align: center; }
.estore-popup__title { margin-bottom: 8px; font-size: 20px; font-weight: 700; }
.estore-popup__content { margin-bottom: 12px; }
.estore-popup__content img { max-width: 100%; height: auto; }

.estore-newsletter-form { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; padding: 16px 20px; border-radius: 8px; background: rgba(0, 0, 0, .04); }
.estore-newsletter-form__text { display: flex; flex-direction: column; gap: 2px; }
.estore-newsletter-form__text span { font-size: 13px; opacity: .8; }
.estore-newsletter-form__field { display: flex; flex: 1 1 320px; max-width: 480px; }
.estore-newsletter-form__field input[type=email] { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid #ccc; border-right: 0; border-radius: 6px 0 0 6px; }
.estore-newsletter-form__field button { height: 42px; padding: 0 18px; border: 0; border-radius: 0 6px 6px 0; background: #DA273F; color: #fff; font-weight: 600; white-space: nowrap; }
.estore-newsletter-form__field button:disabled { opacity: .6; }
.estore-newsletter-msg { flex-basis: 100%; font-size: 13px; }
.estore-newsletter-msg:empty { display: none; }
.estore-newsletter-msg.is-ok { color: #198754; }
.estore-newsletter-msg.is-error { color: #DA273F; }

/* Khối SỰ KIỆN trang chủ (cùng bố cục thẻ TIN TỨC): nhãn ngày nổi trên ảnh, khung dự phòng khi chưa có ảnh */
.ega .ega-events .image-blog { display: block; position: relative; }
.ega .ega-events .ega-event-date { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 52px; height: 56px; border-radius: 6px; background: #fff; color: var(--text-color); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); line-height: 1.1; }
.ega .ega-events .ega-event-date b { font-size: 22px; font-weight: 700; color: var(--price-color); }
.ega .ega-events .ega-event-date small { font-size: 12px; text-transform: uppercase; }
.ega .ega-events .ega-event-noimg { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; background: var(--primary-color); color: #fff; font-size: 40px; }
/* Khung ảnh thẻ sự kiện: tỉ lệ 16:10 cố định, ảnh/khung dự phòng phủ kín (theme đặt chiều cao ảnh blog cố định → 2 thẻ lệch nhau) */
.ega .ega-events .image-blog { aspect-ratio: 16 / 10; height: auto !important; padding: 0 !important; overflow: hidden; border-radius: 4px; margin-bottom: 12px; }
.ega .ega-events .image-blog img, .ega .ega-events .image-blog .ega-event-noimg { position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; aspect-ratio: auto; }
.ega .ega-events .ega-event-date { z-index: 2; }
.ega .ega-events.section .section_blog .blog-list-custom .blogwp .image-blog img { object-fit: cover; }

/* =====================================================================
   Khối kèm banner trái (SÁCH NỔI BẬT, TIN TỨC – SỰ KIỆN): banner dọc col-lg-3 cao bằng phần nội dung bên phải
   ===================================================================== */
.ega .section-section_featured { padding: 30px 0; }
.ega .ega-banner-block__row { align-items: stretch; }
.ega .ega-banner-block__side { display: flex; margin-bottom: 16px; }
.ega .ega-banner-block__banner { display: block; position: relative; width: 100%; min-height: 100%; overflow: hidden; border-radius: 6px; }
.ega .ega-banner-block__banner picture, .ega .ega-banner-block__banner img { display: block; width: 100%; height: 100%; }
.ega .ega-banner-block__banner img { position: absolute; inset: 0; object-fit: cover; transition: transform .4s; }
.ega .ega-banner-block__banner:hover img { transform: scale(1.03); }
.ega .ega-banner-block__grid { row-gap: 8px; }
@media (max-width: 991.98px) {
    .ega .ega-banner-block__banner { min-height: 0; aspect-ratio: 16 / 9; max-height: 280px; }
}

/* TIN TỨC – SỰ KIỆN: khung ảnh 16:10 phủ kín, nhãn ngày (sự kiện), nhãn nhóm tin */
.ega .ega-news-events .image-blog { display: block; position: relative; aspect-ratio: 16 / 10; height: auto !important; padding: 0 !important; overflow: hidden; border-radius: 4px; margin-bottom: 12px; }
.ega .ega-news-events .image-blog img, .ega .ega-news-events .image-blog .ega-event-noimg { position: absolute; inset: 0; width: 100% !important; height: 100% !important; aspect-ratio: auto; }
.ega .ega-news-events.section .section_blog .blog-list-custom .blogwp .image-blog img { object-fit: cover; }
.ega .ega-news-events .ega-event-noimg { display: flex; align-items: center; justify-content: center; background: var(--primary-color); color: #fff; font-size: 40px; }
.ega .ega-news-events .ega-event-date { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 52px; height: 56px; border-radius: 6px; background: #fff; color: var(--text-color); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); line-height: 1.1; }
.ega .ega-news-events .ega-event-date b { font-size: 22px; font-weight: 700; color: var(--price-color); }
.ega .ega-news-events .ega-event-date small { font-size: 12px; text-transform: uppercase; }
.ega .ega-news-events .ega-news-tag { position: absolute; right: 10px; bottom: 10px; z-index: 2; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--text-color); font-size: 12px; font-weight: 600; }
.ega .ega-news-events .ega-news-tag.is-event { background: var(--price-color); color: #fff; }

/* ---------- Menu ngang không đủ chỗ (12/10/2026) ----------
   Theme chia header 250px | menu | 250px -> menu chỉ còn 760px (1440px) / 640px (1200px); 8 mục cấp 1 rộng ~786px nên
   mục cuối xuống dòng 2 và bị .navigation-wrapper (cao cố định, overflow hidden) cắt mất ("Về NXB", "Video"...).
   Thu cột logo/icon về đúng nhu cầu, giảm khoảng đệm theo bề ngang, menu luôn 1 dòng. */
@media (min-width: 992px) {
    .ega .ega-header .header-wrap { grid-template-columns: 180px minmax(0, 1fr) 180px; }
    .ega #stv2Nav .navigation { flex-wrap: nowrap; justify-content: center; }
    .ega #stv2Nav .navigation > .menu-item { flex: 0 0 auto; }
    .ega #stv2Nav .navigation > .menu-item > .menu-item__link { white-space: nowrap; }
}
@media (min-width: 992px) and (max-width: 1399.98px) {
    .ega #stv2Nav .navigation > .menu-item > .menu-item__link { padding-left: 11px; padding-right: 11px; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    .ega .ega-header .header-wrap { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; }
    .ega #stv2Nav .navigation > .menu-item > .menu-item__link { padding-left: 7px; padding-right: 7px; font-size: 15px; }
}

/* ---------- Flash sale / popup (13/10/2026) ----------
   Nhãn "Flash sale" trùng góc với nút ♡ (shop-wish--icon top/right 8px) -> đặt ngay dưới nút ♡.
   Popup render cuối <body>, ngoài vùng .ega nên .btn-main của theme không có kiểu -> kiểu nút riêng. */
.ega .item_product_main .ega-flash-tag { top: 48px; right: 8px; }
.estore-popup .estore-popup__btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px;
    padding: 10px 28px; border: 0; border-radius: 999px; background: #DA273F; color: #fff !important; font-weight: 700;
    font-size: 15px; text-transform: uppercase; letter-spacing: .5px; text-decoration: none; transition: background .15s, transform .15s; }
.estore-popup .estore-popup__btn:hover, .estore-popup .estore-popup__btn:focus-visible { background: #b81d33; transform: translateY(-1px); outline: none; }

/* ---------- Nút "Lên đầu trang" (14/10/2026) ----------
   Theme gốc đặt .backtop trong khối cố định .addThis_listSharing; site không dùng khối đó -> tự cố định góc phải,
   dưới cùng, căn tâm với nút "Liên hệ" (#egaFloatContact) phía trên. Ẩn/hiện dùng .show có sẵn của theme. */
.ega #back-to-top.backtop { position: fixed; right: 16px; bottom: 20px; z-index: 99; color: #fff; line-height: 1; font-size: 0; margin: 0; box-shadow: 0 2px 5px rgba(0, 0, 0, .11); }
.ega #back-to-top.backtop:hover { color: #fff; box-shadow: 0 5px 10px rgba(0, 0, 0, .15), 0 4px 15px rgba(0, 0, 0, .13); }
@media (max-width: 576px) { .ega #back-to-top.backtop { right: 12px; bottom: 16px; width: 40px; height: 40px; } }

/* ---------- Nút Liên hệ nổi (main.php #egaFloatContact) (14/10/2026) ----------
   Thay cột 5 nút tròn: 1 nút "Liên hệ" 48px (căn tâm với nút "Lên đầu trang" bên dưới), bấm bung danh sách có nhãn chữ. */
.ega-fc { position: fixed; right: 14px; bottom: 74px; z-index: 98; display: flex; flex-direction: column; align-items: flex-end; font-family: "Be Vietnam Pro", sans-serif; }
/* Khung .ega-fc trong suốt nhưng có kích thước của cả menu ẩn (~256×276px) -> chặn chạm vào nút bên dưới (vd ĐĂNG NHẬP trên iPhone).
   Khung không nhận chạm; chỉ nút tròn và menu khi đang mở mới nhận. */
.ega-fc { pointer-events: none; }
.ega-fc__toggle, .ega-fc.is-open .ega-fc__menu { pointer-events: auto; }
.ega-fc__toggle { position: relative; width: 48px; height: 48px; border: 0; border-radius: 50%; background: #2f336f; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 20px; box-shadow: 0 4px 12px rgba(47, 51, 111, .35); transition: transform .2s, background .2s; }
.ega-fc__toggle:hover { transform: scale(1.05); }
.ega-fc__toggle:focus-visible { outline: 3px solid rgba(47, 51, 111, .35); outline-offset: 2px; }
.ega-fc__toggle::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #2f336f; animation: egaFcPulse 2.4s ease-out infinite; }
.ega-fc__ico-close { display: none; font-size: 28px; line-height: 1; }
.ega-fc.is-open .ega-fc__toggle { background: #DA273F; }
.ega-fc.is-open .ega-fc__toggle::before { animation: none; border-color: transparent; }
.ega-fc.is-open .ega-fc__ico-open { display: none; }
.ega-fc.is-open .ega-fc__ico-close { display: block; }
@keyframes egaFcPulse { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(1.45); opacity: 0; } }
.ega-fc__menu { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
    opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .2s, transform .2s, visibility .2s; }
.ega-fc.is-open .ega-fc__menu { opacity: 1; visibility: visible; transform: none; }
.ega-fc__item { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.ega-fc__label { background: #fff; color: #1b2233; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; white-space: nowrap;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .14); transition: color .15s; }
.ega-fc__item:hover .ega-fc__label { color: #2f336f; }
.ega-fc__icon { flex: 0 0 36px; width: 36px; height: 36px; margin-right: 6px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 15px; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.ega-fc__icon i { color: #fff !important; }
.ega-fc__icon--zalo { background: #fff; }
.ega-fc__icon--messenger { background: linear-gradient(135deg, #00B2FF 0%, #006AFF 55%, #A334FA 100%); }
.ega-fc__icon--facebook { background: #1877F2; }
.ega-fc__icon--buy { background: #DA273F; }
.ega-fc__icon--read { background: #2f336f; }
@media (max-width: 576px) {
    .ega-fc { right: 10px; bottom: 64px; }
    .ega-fc__toggle { width: 44px; height: 44px; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .ega-fc__toggle::before { animation: none; } }

/* ---------- Khối 2 ảnh ngang (bento / bento_2) (14/10/2026) ----------
   Mỗi ảnh tỉ lệ 5:2 (khớp banner 1983×793 – không bị cắt), thấp hơn lưới bento gốc (353px) và bớt khoảng trắng phía trên. */
@media (min-width: 768px) {
    .ega .ega-bento-2 .bento-grid { margin-top: 0; grid-gap: 20px; }
    .ega .ega-bento-2 .bento-grid-item { min-height: 0; aspect-ratio: 5 / 2; border-radius: 8px; }
}
/* Theme đặt margin-bottom 100px cho mọi khối -> khối ảnh rút còn 50px trên/dưới (margin âm gộp với 100px của khối trước) */
.ega .ega-bento-2 .section_bento_grid { padding-top: 0; padding-bottom: 0; margin-bottom: 50px; }
.ega section.ega-bento-2 { margin-top: -50px; margin-bottom: 0; }
/* ≤ 991px theme chỉ để margin-bottom 1rem (16px) cho khối trước ⇒ margin âm -50px đè 34px lên hàng cuối khối trước
   (mất chữ giá / đồng hồ flash sale của Sách bán chạy, Flash sale trên điện thoại) – không kéo lên nữa (15/10/2026) */
@media (max-width: 991px) {
    .ega section.ega-bento-2 { margin-top: 0; }
}

/* ---------- Cửa sổ tư vấn Zalo (#supportChatModal.ega-support-modal, main.php) (14/10/2026) ----------
   Trượt từ phải (giữ .modal.right cũ), kiểu thiết kế mới: header navy, nền xám nhạt, thẻ chi nhánh trắng, nút Chat Zalo + Gọi. */
.ega-support-modal .modal-dialog { width: 420px; max-width: 100%; }
.ega-support-modal .modal-content { background: #f5f6fa; border: 0; border-radius: 0; font-family: "Be Vietnam Pro", sans-serif; display: flex; flex-direction: column; }
.ega-support__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 18px; background: #2f336f; color: #fff; }
.ega-support__title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 19px; font-weight: 700; color: #fff; }
.ega-support__title img { background: #fff; border-radius: 50%; padding: 3px; width: 30px; height: 30px; }
.ega-support__sub { margin: 6px 0 0; font-size: 13px; color: rgba(255, 255, 255, .8); }
.ega-support__close { flex: 0 0 auto; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff;
    font-size: 24px; line-height: 1; cursor: pointer; transition: background .15s; }
.ega-support__close:hover, .ega-support__close:focus-visible { background: rgba(255, 255, 255, .3); outline: none; }
.ega-support__body { flex: 1 1 auto; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ega-support__card { background: #fff; border: 1px solid #e6e8ef; border-radius: 12px; padding: 14px; box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
    transition: box-shadow .15s, border-color .15s; }
.ega-support__card:hover { border-color: #c9cde0; box-shadow: 0 4px 14px rgba(16, 24, 40, .08); }
.ega-support__info { display: flex; align-items: center; gap: 12px; }
.ega-support__avatar { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #eef0f6; border: 2px solid #fff; box-shadow: 0 0 0 1px #e6e8ef; }
.ega-support__text { min-width: 0; }
.ega-support__name { font-size: 15px; font-weight: 700; color: #1b2233; line-height: 1.35; }
.ega-support__line { margin-top: 3px; font-size: 13px; color: #5b6475; }
.ega-support__line i { width: 14px; color: #2f336f; font-size: 11px; }
.ega-support__area { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ega-support__actions { display: flex; gap: 8px; margin-top: 12px; }
.ega-support__btn { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 999px;
    font-size: 14px; font-weight: 600; text-decoration: none !important; transition: filter .15s, background .15s; }
.ega-support__btn--zalo { background: #0068ff; color: #fff !important; }
.ega-support__btn--zalo:hover { filter: brightness(1.08); }
.ega-support__btn--call { background: #fff; color: #2f336f !important; border: 1px solid #2f336f; }
.ega-support__btn--call:hover { background: #2f336f; color: #fff !important; }

/* Banner 1 ảnh giữa FLASH SALE và SÁCH MỚI PHÁT HÀNH (co_home_item section=banner_mid) */
.ega .ega-banner-mid__link { display: block; overflow: hidden; }
.ega .ega-banner-mid__img { display: block; width: 100%; height: auto; }
