/*
Theme Name: Shopkeeper - The Child Theme
Theme URI: https://shopkeeper.getbowtied.com
Description: This is the Child Theme for Shopkeeper - a Hassle-free Worpress Theme with great design and extensive functionality.
Author: Get Bowtied
Author URI: https://getbowtied.com
Template: shopkeeper
Version: 2.0
*/


/****************************************************************/
/*************** ADD YOUR CUSTOM CSS IN THIS AREA ***************/
/****************************************************************/

/* ==========================================================================
   CUSTOM CSS - KIỀU THỊ (CHILD THEME)
   Áp dụng cho toàn network: kieuthi.com (gốc), en.kieuthi.com, zh.kieuthi.com
   File này dùng chung cho cả 3 site (network-activated theme).
   Phần riêng theo ngôn ngữ (en/zh) nằm ở cuối file, dùng selector html:lang().
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. WOOCOMMERCE - THANH TOÁN & HIỂN THỊ GIÁ (áp dụng chung 3 site)
   -------------------------------------------------------------------------- */

/* Kích thước logo cổng thanh toán (PayOS...) */
.woocommerce #payment ul.payment_methods li img {
    max-height: 16px !important;
}

/* Màu giá gạch (giá cũ) trong giỏ hàng */
del bdi {
    color: darkgray;
}

/* Bỏ nền đậm mặc định của giá giảm (thẻ <ins>) */
.entry-content ins {
    font-size: 1em;
    background-color: #ffffff;
    padding: 2px 0px 3px;
}

/* Định dạng ký hiệu tiền tệ (₫, $...) ngoài bảng giá sỉ */
.woocommerce-Price-currencySymbol {
    font-size: 70%;
    font-weight: lighter;
    vertical-align: .23em;
    letter-spacing: 2pt;
}

/* --------------------------------------------------------------------------
   2. PLUGIN: WPC Price by Quantity for WooCommerce
      Bảng giá theo số lượng, kiểu hiển thị giống 1688.
      Toàn bộ block này dùng chung cho 3 site, KHÔNG tách theo ngôn ngữ,
      trừ 2 chỗ có ghi chú riêng bên dưới (nhãn chữ, và content động ở cuối file).
   -------------------------------------------------------------------------- */

.wpcpq-item-price-val span {
    color: #96588a;
    font-weight: bold;
    font-size: 22px;
}

/* Lưu ý: cỡ 70% này áp dụng chung cho cả en/zh (đã chốt không tách riêng 100% cho subsite) */
.wpcpq-item-price-val .woocommerce-Price-currencySymbol {
    font-size: 70%;
    font-weight: lighter;
    vertical-align: .25em;
    letter-spacing: 2pt;
}

.wpcpq-summary div {
    margin-bottom: 40px;
}

.wpcpq-table.wpcpq-layout-quick_buy .wpcpq-item .wpcpq-item-info .wpcpq-item-qty {
    font-weight: 300;
    font-size: .8em;
}

.wpcpq-table.wpcpq-layout-quick_buy {
    margin-bottom: 50px;
}

.wpcpq-item-atc {
    display: none;
}

.wpcpq-table {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 500px;
}

.wpcpq-table.wpcpq-layout-quick_buy .wpcpq-item:last-child,
.wpcpq-table.wpcpq-layout-quick_buy .wpcpq-item {
    border-bottom: 0px dashed #e5e5e5;
    border-top: 0px dashed #e5e5e5;
}

.wpcpq-item-price #after-price-item-tabble,
.wpcpq-item-text {
    font-size: .8em;
}

/* Nhãn mặc định: tiếng Việt, dùng cho site gốc kieuthi.com.
   en.kieuthi.com và zh.kieuthi.com override lại ở cuối file (mục 4). */
.wpcpq-wrap:before {
    content: "GIÁ BÁN BUÔN";
    font-size: .8em;
}

/* --------------------------------------------------------------------------
   3. MULTILANGUAGE SWITCHER (MSLS) - LÁ CỜ NGÔN NGỮ
      Class .msls-flags-wrapper là class thật do plugin MSLS render ra.
      Áp dụng chung cho 3 site.
   -------------------------------------------------------------------------- */

/* Lưu ý: dùng :not(.x) để "cộng điểm" specificity (không match gì cả, chỉ để
   tăng độ ưu tiên) vì có CSS khác load SAU style.css cũng định nghĩa lại
   .msls-flags-wrapper cùng !important, khiến rule gốc (specificity thấp) bị
   thua theo thứ tự load. Cách này giúp rule luôn thắng mà không cần đặt ở
   Additional CSS (vốn luôn được WordPress in cuối <head>). */

/* 3.1 Ép cụm lá cờ hiển thị hàng ngang, không bị vỡ dòng */
body:not(.x) header .msls-flags-wrapper,
body:not(.x) div .msls-flags-wrapper,
body:not(.x) li .msls-flags-wrapper,
body:not(.x) .msls-flags-wrapper {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;            /* khoảng cách giữa các lá cờ */
    padding: 0 !important;
    vertical-align: middle !important;
    float: none !important;
    clear: none !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
}

/* 3.2 Ép các phần tử cờ bên trong không bị biến dạng / xuống dòng */
body:not(.x) header .msls-flags-wrapper a,
body:not(.x) header .msls-flags-wrapper span,
body:not(.x) .msls-flags-wrapper a,
body:not(.x) .msls-flags-wrapper span {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    float: none !important;
}

/* 3.3 Cố định kích thước hình ảnh lá cờ 20px */
body:not(.x) header .msls-flags-wrapper img,
body:not(.x) .msls-flags-wrapper img {
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    height: auto !important;
    display: inline-block !important;
    margin: 0 !important;
    vertical-align: middle !important;
}

/* 3.4 FIX GỐC RỄ: .msls-flags-wrapper nằm trực tiếp trong <ul class="menu-right-main-menu">,
   ngang hàng với <li>. Menu này dùng display:flex; nếu <ul> có flex-wrap:wrap và
   không đủ chỗ, cả cụm cờ (là 1 flex-item) sẽ bị đẩy xuống dòng dưới - bất kể CSS
   bên trong .msls-flags-wrapper là gì. Phải chặn wrap ở chính <ul>, và không cho
   cụm cờ bị co lại. */
.main-navigation.right-navigation ul.menu-right-main-menu,
ul.menu-right-main-menu {
    flex-wrap: nowrap !important;
}

ul.menu-right-main-menu .msls-flags-wrapper {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

/* --------------------------------------------------------------------------
   4. RIÊNG THEO SUBSITE (en.kieuthi.com / zh.kieuthi.com)
      Dựa vào thuộc tính <html lang="..."> mà WordPress tự render theo
      Site Language (Settings > General) của từng site trong multisite.
      ĐIỀU KIỆN: Site Language của en.kieuthi.com phải là dạng "en..." (vd: en_US)
      và của zh.kieuthi.com phải là dạng "zh..." (vd: zh_CN) thì rule mới nhận đúng site.
      Nếu không thấy đổi nhãn khi qua subsite, kiểm tra lại Site Language trước.
   -------------------------------------------------------------------------- */

/* Nhãn tiếng Anh cho bảng giá theo số lượng (en.kieuthi.com) */
html:lang(en) .wpcpq-wrap:before {
    content: "WHOLESALE PRICE";
}

/* Nhãn tiếng Trung giản thể cho bảng giá theo số lượng (zh.kieuthi.com) */
html:lang(zh) .wpcpq-wrap:before {
    content: "批发价" !important;
}

/* Định dạng ký hiệu tiền Trung */
html:lang(zh) .woocommerce-Price-currencySymbol {
    font-size: 50% !important;
    vertical-align: .6em !important;
    letter-spacing: 0pt !important;
}


/* --------------------------------------------------------------------------
   GHI CHÚ CHUNG / ĐÃ CHỦ ĐỘNG BỎ QUA (không đưa vào bản này theo quyết định của Dũng):
   - KHÔNG có font-weight:100 riêng cho h1-h6/.page-title ở en/zh
     -> tiêu đề hiển thị đồng nhất, đậm như site gốc trên cả 3 site.
   - KHÔNG ép flex cho div[class*="header"] (selector cũ quá rộng, dễ ảnh hưởng
     tới các phần tử không liên quan tới header) -> nếu header lệch dòng thật,
     cần bổ sung lại bằng class cụ thể hơn, không dùng selector kiểu này.
   -------------------------------------------------------------------------- */

/****************************************************************/
/****************************************************************/
/****************************************************************/
