/*
Theme Name: AI VIP
Theme URI: https://localhost/prompthub
Author: bizenxu
Author URI: https://localhost
Description: Theme bán prompt / tool / ebook AI kèm affiliate, tương thích WooCommerce. Có giao diện Sáng/Tối, lấy cảm hứng từ PromptBase.
Version: 2.4
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: prompthub
*/

/* ============ Biến màu (Tối mặc định / Sáng) ============ */
:root, html[data-theme="dark"] {
  --bg:#0f1020; --bg-soft:#171933; --card:#1d2040; --card-2:#23264d; --line:#2c2f5a;
  --txt:#e9eaff; --txt-soft:#a6a9d8; --muted:#7b7fb3;
  --brand:#7c5cff; --brand-2:#4ad6c8; --brand-soft:rgba(124,92,255,.15);
  --ok:#36d399; --warn:#fbbd23; --err:#f87272;
  --radius:13px; --shadow:0 16px 40px -22px rgba(0,0,0,.6); --max:1180px;
  --topbar-bg:rgba(15,16,32,.78);
}
html[data-theme="light"] {
  --bg:#f4f5fb; --bg-soft:#ffffff; --card:#ffffff; --card-2:#f1f2f9; --line:#e3e5f0;
  --txt:#1b1c30; --txt-soft:#52566f; --muted:#8a8ea6;
  --brand:#6b4eff; --brand-2:#0fa99a; --brand-soft:rgba(107,78,255,.10);
  --shadow:0 16px 40px -24px rgba(40,40,90,.30); --topbar-bg:rgba(255,255,255,.85);
}

*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--txt);
  font-family:"Be Vietnam Pro",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  font-size:15px;line-height:1.55}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto}
.wrap{max-width:var(--max);margin:0 auto;padding:0 20px}

/* ============ Topbar ============ */
.ph-topbar{position:sticky;top:0;z-index:50;backdrop-filter:blur(14px);
  background:var(--topbar-bg);border-bottom:1px solid var(--line)}
.ph-topbar .inner{max-width:var(--max);margin:0 auto;padding:10px 20px;display:flex;align-items:center;gap:14px}
.ph-logo{display:flex;align-items:center;gap:9px;font-weight:800;font-size:18px}
.ph-logo .mark{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;font-weight:900}
.ph-logo .mark-wrap{width:38px;height:38px;border-radius:11px;overflow:hidden;flex:none;
  border:1px solid var(--line);display:block;background:#08080a}
.ph-logo .mark-wrap img{width:100%;height:100%;object-fit:cover;display:block}
.ph-logo .mark-wrap.zoom img{transform:scale(1.8)} /* ảnh gốc nhiều viền đen -> phóng to */
.ph-nav{display:flex;gap:4px;align-items:center;margin-left:8px}
.ph-nav a{padding:7px 11px;border-radius:9px;color:var(--txt-soft);font-weight:500;font-size:14px}
.ph-nav a:hover,.ph-nav .current-menu-item>a{background:var(--brand-soft);color:var(--txt)}
.ph-nav ul{list-style:none;display:flex;gap:4px;margin:0;padding:0}
.spacer{flex:1}
.ph-acts{display:flex;align-items:center;gap:8px}

/* ============ Tìm kiếm live trên header ============ */
.ph-headsearch{position:relative;flex:1;max-width:340px;margin:0 10px}
.ph-headsearch input{width:100%;background:var(--bg);border:1px solid var(--line);color:var(--txt);
  border-radius:999px;padding:8px 15px;font-size:13px;outline:none;transition:.15s}
.ph-headsearch input:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}
#ph-live-results{position:absolute;top:calc(100% + 8px);left:0;right:0;z-index:99;
  background:var(--card);border:1px solid var(--line);border-radius:13px;overflow:hidden;
  box-shadow:var(--shadow);max-height:380px;overflow-y:auto}
.ph-ls-item{display:flex;align-items:center;gap:10px;padding:9px 12px;border-bottom:1px solid var(--line)}
.ph-ls-item:hover{background:var(--brand-soft)}
.ph-ls-item img,.ph-ls-noimg{width:38px;height:38px;border-radius:8px;object-fit:cover;flex:none;
  display:grid;place-items:center;background:var(--bg-soft);font-size:18px}
.ph-ls-info{min-width:0}
.ph-ls-info b{display:block;font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ph-ls-info small{color:var(--brand-2);font-weight:700;font-size:12px}
.ph-ls-all{display:block;text-align:center;padding:9px;font-size:12.5px;font-weight:700;color:var(--brand-2)}
.ph-ls-all:hover{background:var(--brand-soft)}
.ph-ls-empty{padding:14px;text-align:center;color:var(--muted);font-size:13px}
.ph-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:9px;cursor:pointer;
  border:1px solid var(--line);background:var(--card-2);color:var(--txt)}
.ph-icon:hover{border-color:var(--brand)}

/* ============ Buttons ============ */
.btn,.woocommerce a.button,.woocommerce button.button,.woocommerce input.button,
.woocommerce #respond input#submit,.woocommerce a.button.alt,.woocommerce button.button.alt{
  display:inline-flex;align-items:center;gap:8px;justify-content:center;cursor:pointer;
  border:1px solid var(--line);background:var(--card-2);color:var(--txt);
  padding:10px 16px;border-radius:11px;font-weight:600;font-size:14px;transition:.15s;line-height:1}
.btn:hover,.woocommerce a.button:hover,.woocommerce button.button:hover{border-color:var(--brand);transform:translateY(-1px)}
.btn.primary,.woocommerce a.button.alt,.woocommerce button.button.alt,.woocommerce #respond input#submit{
  background:linear-gradient(135deg,var(--brand),#9b7bff);border-color:transparent;color:#fff}
.btn.accent{background:linear-gradient(135deg,var(--brand-2),#6ee7da);border-color:transparent;color:#06231f}

/* ============ Hero (bản gọn ~1/2 chiều cao) ============ */
.ph-hero{position:relative;border-radius:16px;overflow:hidden;padding:20px 24px;margin:14px 0;
  background:linear-gradient(135deg,var(--brand-soft),rgba(74,214,200,.08)),var(--bg-soft);border:1px solid var(--line)}
.ph-hero .tag{font-size:11px;font-weight:600;background:var(--brand-soft);color:var(--brand-2);padding:2px 9px;border-radius:999px}
.ph-hero h1{font-size:clamp(19px,2.4vw,27px);line-height:1.12;margin:8px 0 5px;font-weight:800;letter-spacing:-.3px}
.ph-hero p{font-size:13.5px;color:var(--txt-soft);max-width:560px;margin:0 0 10px}
.ph-hero .cta{display:flex;gap:10px;flex-wrap:wrap}
.ph-hero .cta .btn{padding:8px 13px;font-size:13px}
.ph-search{display:flex;gap:8px;max-width:480px;margin-top:4px}
.ph-search input{flex:1;background:var(--bg);border:1px solid var(--line);color:var(--txt);border-radius:10px;padding:8px 12px;font-size:13px}
.ph-search .btn{padding:8px 14px;font-size:13px}
/* ===== Hero 2 cột (desktop) — lấp khoảng trống bên phải ===== */
.ph-hero{display:grid;grid-template-columns:1.05fr .92fr;gap:26px;align-items:center}
.ph-hero-left{min-width:0}
.ph-hero-right{min-width:0;display:flex;flex-direction:column;gap:12px;
  background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.09);border-radius:14px;padding:16px}
html[data-theme="light"] .ph-hero-right{background:rgba(0,0,0,.035);border-color:var(--line)}
.ph-hero-right .ph-search{max-width:none;margin-top:0}
.ph-hero-right .ph-search input{background:rgba(0,0,0,.25)}
html[data-theme="light"] .ph-hero-right .ph-search input{background:#fff}
.ph-hero-right .cta{margin-top:0 !important}
.ph-hero-right .cta .btn{flex:1;justify-content:center;text-align:center}
.ph-hero-right .ph-stats{margin-top:2px;display:flex;flex-wrap:wrap;gap:10px 18px}
/* ===== Mobile: xếp lại 1 cột, bỏ khung panel ===== */
@media (max-width:900px){
  .ph-hero{grid-template-columns:1fr;gap:14px}
  .ph-hero-right{background:transparent;border:0;padding:0}
  .ph-hero-right .cta .btn{flex:0 1 auto}
  .ph-hero-right .ph-stats{display:flex;flex-wrap:wrap;gap:14px 22px}
  .ph-hero-right .ph-search input{background:var(--bg)}
}
@media (max-width:480px){
  .ph-hero-right .cta{flex-direction:column}
  .ph-hero-right .cta .btn{width:100%;flex:1 1 auto}
  .ph-hero-right .ph-stats{gap:12px 14px}
}

/* ============ Category tiles ============ */
.ph-cats{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin:24px 0}
.ph-cats a{display:flex;align-items:center;gap:10px;padding:14px 16px;border:1px solid var(--line);
  border-radius:14px;background:var(--card);font-weight:600;font-size:14px}
.ph-cats a:hover{border-color:var(--brand);transform:translateY(-2px)}

/* ============ Section heading ============ */
.ph-sec-head{display:flex;justify-content:space-between;align-items:baseline;margin:20px 0 10px}
.ph-sec-head h2{margin:0;font-size:18px}
.ph-sec-head a{color:var(--muted);font-size:14px}

/* ============ WooCommerce product grid ============ */
.woocommerce ul.products{display:grid !important;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:16px;margin:0;padding:0}
/* clearfix ::before/::after của WooCommerce bị grid tính là 1 ô -> tắt đi (sửa lỗi trống ô đầu) */
.woocommerce ul.products::before,.woocommerce ul.products::after{display:none !important;content:none !important}
/* nhãn Miễn phí (giá 0đ) */
.ph-free{color:var(--ok);font-weight:800}
.woocommerce ul.products li.product{width:auto !important;margin:0 !important;float:none !important;
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;padding:0;transition:.16s;text-align:left}
.woocommerce ul.products li.product:hover{transform:translateY(-3px);border-color:var(--brand);box-shadow:var(--shadow)}
.woocommerce ul.products li.product a img{margin:0;border-radius:0}
.woocommerce ul.products li.product .woocommerce-loop-product__title{padding:12px 13px 0;font-size:15px;font-weight:700}
.woocommerce ul.products li.product .price{padding:6px 13px;color:var(--brand-2);font-weight:800;display:block}
.woocommerce ul.products li.product .price del{color:var(--muted);font-weight:500;font-size:.85em}
.woocommerce ul.products li.product .button{margin:0 13px 14px;display:inline-flex}
.woocommerce span.onsale{background:var(--err);color:#fff;border-radius:999px;min-height:auto;min-width:auto;padding:3px 9px;top:8px;right:8px;left:auto}
/* Trang chi tiết: badge giảm giá nằm trên ẢNH, không đè tiêu đề */
.woocommerce div.product div.images{position:relative}
.woocommerce div.product span.onsale{top:14px;left:14px;right:auto;z-index:3}

/* ============ Single product / cart / checkout ============ */
.woocommerce div.product .product_title{font-size:28px}
.woocommerce div.product p.price,.woocommerce div.product span.price{color:var(--brand-2);font-weight:800;font-size:24px}
.woocommerce-message,.woocommerce-info,.woocommerce-error{border-top-color:var(--brand);background:var(--card);color:var(--txt)}
.woocommerce table.shop_table,.woocommerce .cart-collaterals,
.woocommerce form .form-row input.input-text,.woocommerce-page table,.select2-container--default .select2-selection--single{
  background:var(--card);color:var(--txt);border-color:var(--line)}
.woocommerce table.shop_table th,.woocommerce table.shop_table td{border-color:var(--line);color:var(--txt)}

/* ============ Promo banner ============ */
.ph-promo{display:flex;justify-content:space-between;align-items:center;gap:20px;flex-wrap:wrap;
  padding:26px 30px;border-radius:20px;border:1px solid var(--line);margin:34px 0;
  background:linear-gradient(135deg,rgba(74,214,200,.14),var(--brand-soft)),var(--bg-soft)}
.ph-promo h2{margin:0 0 6px}

/* ============ Content / pages ============ */
.ph-main{max-width:var(--max);margin:0 auto;padding:10px 20px 50px;min-height:55vh}
.entry-content{line-height:1.7}

/* ============ Footer ============ */
.ph-footer{border-top:1px solid var(--line);margin-top:30px}
.ph-footer .inner{max-width:var(--max);margin:0 auto;padding:28px 20px;display:flex;justify-content:space-between;
  gap:20px;flex-wrap:wrap;color:var(--muted);font-size:14px}
.ph-footer a:hover{color:var(--brand-2)}

@media (max-width:820px){ .ph-nav{display:none} .ph-hero{padding:18px 16px} }

/* =====================================================================
   ===============  NÂNG CẤP GIAO DIỆN (v1.1 — giống demo)  =============
   ===================================================================== */

/* ---------- Hero: lưới trang trí + thống kê ---------- */
.ph-hero::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:
    radial-gradient(420px 220px at 88% -10%,rgba(124,92,255,.28),transparent 60%),
    radial-gradient(380px 200px at 10% 120%,rgba(74,214,200,.22),transparent 60%)}
.ph-hero > *{position:relative;z-index:1}
.ph-stats{display:flex;gap:22px;flex-wrap:wrap;margin-top:12px}
.ph-stats .it{display:flex;flex-direction:column}
.ph-stats .it b{font-size:16px;font-weight:800;background:linear-gradient(135deg,var(--brand),var(--brand-2));
  -webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.ph-stats .it span{font-size:11.5px;color:var(--muted)}

/* ---------- Category tiles có icon (bản gọn: desktop 1 hàng, mobile 2 cột) ---------- */
.ph-models{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:8px;margin:10px 0 4px}
.ph-models a{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--line);
  border-radius:11px;background:var(--card);font-weight:600;font-size:12.5px;line-height:1.25;transition:.16s}
.ph-models a:hover{border-color:var(--brand);transform:translateY(-2px);box-shadow:var(--shadow)}
.ph-models .ic{width:28px;height:28px;border-radius:8px;display:grid;place-items:center;font-size:15px;
  background:var(--brand-soft);flex:none}
.ph-models small{display:block;color:var(--muted);font-weight:500;font-size:10.5px}
@media (max-width:560px){
  .ph-models{grid-template-columns:repeat(2,1fr)}
  .ph-models small{display:none}
}

/* Tự thêm icon cho ô danh mục WooCommerce mặc định */
.woocommerce ul.products li.product-category a img{aspect-ratio:1;object-fit:cover}

/* ---------- Pills lọc nhanh ---------- */
.ph-pills{display:flex;gap:9px;flex-wrap:wrap;margin:6px 0 4px}
.ph-pills a{padding:7px 14px;border-radius:999px;border:1px solid var(--line);background:var(--card);
  font-size:13px;font-weight:600;color:var(--txt-soft)}
.ph-pills a:hover,.ph-pills a.on{background:var(--brand-soft);color:var(--txt);border-color:var(--brand)}

/* ---------- Thẻ sản phẩm: badge model + rating ---------- */
.woocommerce ul.products li.product{position:relative;display:flex;flex-direction:column}
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link{display:block}
.woocommerce ul.products li.product img{aspect-ratio:4/3;object-fit:cover;width:100%}
.ph-badge{position:absolute;top:9px;left:9px;z-index:2;display:inline-flex;align-items:center;gap:5px;
  background:rgba(15,16,32,.72);color:#fff;backdrop-filter:blur(6px);
  padding:4px 9px;border-radius:999px;font-size:11px;font-weight:700;border:1px solid rgba(255,255,255,.14)}
html[data-theme="light"] .ph-badge{background:rgba(255,255,255,.82);color:#1b1c30;border-color:var(--line)}
.woocommerce ul.products li.product .star-rating{margin:8px 13px 0;font-size:.78em;color:var(--warn)}
.woocommerce ul.products li.product .price{margin-top:auto}
/* Giá / "Miễn phí" ở GÓC ẢNH của thẻ */
.ph-price-badge{position:absolute;top:9px;left:9px;z-index:3;display:inline-flex;align-items:center;gap:4px;
  padding:5px 10px;border-radius:999px;font-size:12px;font-weight:800;line-height:1;white-space:nowrap;
  background:rgba(10,12,24,.82);color:#fff;border:1px solid rgba(255,255,255,.14);backdrop-filter:blur(4px)}
.ph-price-badge del{opacity:.55;font-weight:500;font-size:.82em;margin-right:2px}
.ph-price-badge ins{text-decoration:none;color:#fff}
html[data-theme="light"] .ph-price-badge{background:rgba(255,255,255,.92);color:#1b1c30;border-color:var(--line)}
html[data-theme="light"] .ph-price-badge ins{color:#1b1c30}
/* Danh mục chức năng — chữ nhỏ dưới tên prompt */
.ph-cat-mini{padding:4px 13px 0;font-size:11px;color:var(--muted);font-weight:600;line-height:1.3}
/* Người đăng ở trang chi tiết */
.ph-poster{margin:2px 0 10px;color:var(--txt-soft);font-size:14px}
/* ===== Nút Mua ngay + hàng nút trên trang sản phẩm ===== */
.woocommerce div.product form.cart{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.woocommerce div.product form.cart .quantity{margin:0}
.woocommerce div.product form.cart .single_add_to_cart_button{padding:11px 18px!important;border-radius:10px;font-weight:700}
.ph-buy-now{background:linear-gradient(135deg,var(--brand),var(--brand-2))!important;color:#fff!important;border:0!important;
  font-weight:800;padding:11px 20px!important;border-radius:10px;box-shadow:0 6px 18px rgba(124,92,255,.35);cursor:pointer}
.ph-buy-now:hover{filter:brightness(1.07)}
/* 2 nút (Thêm giỏ + Mua ngay) NẰM NGANG 1 hàng trên thẻ sản phẩm */
.ph-card-btns{display:flex;gap:8px;margin:12px 13px 14px}
.woocommerce ul.products li.product .ph-card-btns .button{flex:1;margin:0 !important;padding:9px 6px !important;
  font-size:12.5px;text-align:center;justify-content:center;white-space:nowrap;border-radius:10px}
.woocommerce ul.products li.product .ph-buy-now-loop{display:flex !important;align-items:center;justify-content:center;font-weight:800;
  background:linear-gradient(135deg,var(--brand),var(--brand-2)) !important;color:#fff !important;box-shadow:0 5px 14px rgba(124,92,255,.32)}
.woocommerce ul.products li.product .ph-buy-now-loop:hover{filter:brightness(1.07)}
@media (max-width:520px){ .ph-card-btns{gap:6px;margin:10px 9px 10px} .woocommerce ul.products li.product .ph-card-btns .button{font-size:11px;padding:8px 4px !important} }
/* ===== GIỎ HÀNG — dễ nhìn ===== */
.woocommerce-cart table.cart{border:1px solid var(--line);border-radius:14px;border-collapse:separate;overflow:hidden;background:#1d2040}
.woocommerce-cart table.cart thead th{background:rgba(255,255,255,.05);color:var(--txt-soft);font-size:12px;text-transform:uppercase;letter-spacing:.4px;padding:12px 14px;border:0}
.woocommerce-cart table.cart td{padding:14px;border-top:1px solid var(--line);vertical-align:middle;background:transparent}
.woocommerce-cart table.cart td.product-thumbnail img{width:62px;height:62px;object-fit:cover;border-radius:10px}
.woocommerce-cart table.cart td.product-name a{color:var(--txt);font-weight:700;text-decoration:none}
.woocommerce-cart table.cart td.product-name a:hover{color:var(--brand-2)}
.woocommerce-cart table.cart td.product-price,.woocommerce-cart table.cart td.product-subtotal{color:var(--brand-2);font-weight:700}
.woocommerce-cart .product-remove a.remove{color:#ff6b6b!important;font-size:18px;line-height:1;width:26px;height:26px;border-radius:50%;background:rgba(255,107,107,.14)!important;display:inline-flex;align-items:center;justify-content:center}
.woocommerce-cart .quantity input.qty{width:66px;background:var(--bg);border:1px solid var(--line);color:var(--txt);border-radius:8px;padding:8px;text-align:center}
.woocommerce-cart td.actions{padding:14px;background:transparent}
.woocommerce-cart .coupon input#coupon_code{background:var(--bg);border:1px solid var(--line);color:var(--txt);border-radius:8px;padding:9px 12px;margin-right:6px}
.woocommerce-cart td.actions .button{border-radius:9px;padding:9px 16px;background:var(--brand);color:#fff;border:0}
.woocommerce-cart .cart-collaterals{margin-top:18px;display:flex;justify-content:flex-end}
.woocommerce-cart .cart_totals{width:min(420px,100%);background:#1d2040;border:1px solid var(--line);border-radius:14px;padding:18px}
.woocommerce-cart .cart_totals h2{margin:0 0 10px;font-size:16px}
.woocommerce-cart .cart_totals table{width:100%;border:0}
.woocommerce-cart .cart_totals th,.woocommerce-cart .cart_totals td{padding:9px 0;border-top:1px solid var(--line);color:var(--txt-soft)}
.woocommerce-cart .cart_totals .order-total td,.woocommerce-cart .cart_totals .order-total th{font-size:17px;color:var(--txt);font-weight:800}
.woocommerce-cart .wc-proceed-to-checkout{padding-top:14px}
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button{display:block;text-align:center;background:linear-gradient(135deg,var(--brand),var(--brand-2))!important;color:#fff!important;font-weight:800;padding:13px!important;border-radius:11px;font-size:15px;box-shadow:0 6px 18px rgba(124,92,255,.35)}
.woocommerce-message,.woocommerce-info{background:rgba(124,92,255,.10);border-left:3px solid var(--brand);color:var(--txt);border-radius:10px;padding:12px 14px}
.woocommerce-message a.button,.woocommerce-info a.button{background:var(--brand);color:#fff;border-radius:8px}
@media (max-width:760px){
  .woocommerce-cart table.cart thead{display:none}
  .woocommerce-cart table.cart td{display:flex;justify-content:space-between;align-items:center;text-align:right;gap:12px}
  .woocommerce-cart table.cart td::before{content:attr(data-title);color:var(--muted);font-weight:600;text-align:left}
  .woocommerce-cart table.cart td.product-remove::before,.woocommerce-cart table.cart td.product-thumbnail::before{content:none}
  .woocommerce-cart .cart-collaterals,.woocommerce-cart .cart_totals{width:100%}
}
.ph-card-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:2px 13px 0;color:var(--muted);font-size:12px}
.ph-card-meta .seller{display:flex;align-items:center;gap:6px;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ph-card-meta > span:last-child{flex:none;white-space:nowrap}
.ph-card-meta .seller .av{width:18px;height:18px;border-radius:50%;
  background:linear-gradient(135deg,var(--brand),var(--brand-2))}

/* ---------- Promo / seller band ---------- */
.ph-promo{position:relative;overflow:hidden}
.ph-promo::after{content:"";position:absolute;right:-40px;top:-40px;width:220px;height:220px;border-radius:50%;
  background:radial-gradient(circle,rgba(124,92,255,.35),transparent 70%);pointer-events:none}
.ph-promo .left{max-width:560px;position:relative;z-index:1}
.ph-promo .btn{position:relative;z-index:1}

/* ---------- Khối "Tại sao chọn" (icon cùng hàng với tiêu đề) ---------- */
.ph-feats{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin:14px 0}
.ph-feats .f{padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:var(--card);
  display:grid;grid-template-columns:auto 1fr;gap:6px 10px;align-items:center}
.ph-feats .f .ic{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;font-size:16px;
  background:var(--brand-soft);margin:0}
.ph-feats .f h3{margin:0;font-size:14.5px}
.ph-feats .f p{margin:0;color:var(--txt-soft);font-size:12.5px;grid-column:1 / -1}

/* ---------- Affiliate dashboard (shortcode) ---------- */
.ph-aff{display:grid;gap:16px}
.ph-aff .row{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:14px}
.ph-aff .box{padding:18px;border:1px solid var(--line);border-radius:16px;background:var(--card)}
.ph-aff .box b{font-size:24px;display:block}
.ph-aff .box span{color:var(--muted);font-size:13px}
.ph-aff .linkbox{display:flex;gap:8px;flex-wrap:wrap}
.ph-aff .linkbox input{flex:1;min-width:240px;background:var(--bg);border:1px solid var(--line);
  color:var(--txt);border-radius:10px;padding:10px 12px;font-size:13px}

/* ---------- Form người bán ---------- */
.ph-form{max-width:640px;display:grid;gap:14px}
.ph-form label{font-weight:600;font-size:14px;display:block;margin-bottom:5px}
.ph-form input[type=text],.ph-form input[type=number],.ph-form textarea,.ph-form select,.ph-form input[type=file]{
  width:100%;background:var(--bg);border:1px solid var(--line);color:var(--txt);border-radius:11px;padding:11px 13px;font:inherit}
.ph-form textarea{min-height:110px;resize:vertical}
.ph-note{font-size:13px;color:var(--muted)}
.ph-check{display:flex;gap:9px;align-items:flex-start;font-size:13px;color:var(--txt-soft)}
.ph-alert{padding:12px 14px;border-radius:12px;border:1px solid var(--line);background:var(--card);font-size:14px}
.ph-alert.ok{border-color:var(--ok);color:var(--ok)}
.ph-alert.err{border-color:var(--err);color:var(--err)}

/* ---------- Trang chi tiết: hàng tin cậy ---------- */
.woocommerce div.product .ph-trust{display:flex;gap:18px;flex-wrap:wrap;margin:14px 0;
  padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:var(--card);font-size:13px;color:var(--txt-soft)}
.woocommerce div.product .ph-trust b{color:var(--txt)}

/* ---------- Thanh bộ lọc trang Cửa hàng ---------- */
.ph-filterbar{margin:4px 0 18px;padding:14px 16px;border:1px solid var(--line);
  border-radius:14px;background:var(--card);display:grid;gap:10px}
.ph-filter-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.ph-filter-row .lb{font-size:13px;font-weight:700;color:var(--muted);flex:none;min-width:78px}
.ph-filterbar .ph-pills{margin:0}

/* ---------- Dòng đếm kết quả + ô sắp xếp ---------- */
.woocommerce .woocommerce-result-count{color:var(--muted);font-size:13px;margin:6px 0 14px}
.woocommerce .woocommerce-ordering{margin:0 0 14px}
.woocommerce .woocommerce-ordering select,
.woocommerce select.orderby{
  -webkit-appearance:none;appearance:none;cursor:pointer;
  background:var(--card);border:1px solid var(--line);color:var(--txt);
  border-radius:10px;padding:9px 36px 9px 13px;font:inherit;font-size:13px;font-weight:600;
  background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a8ea6' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 12px center}
.woocommerce .woocommerce-ordering select:hover,
.woocommerce select.orderby:hover{border-color:var(--brand)}
/* thông báo 0 kết quả gọn gàng */
.woocommerce-no-products-found .woocommerce-info{border-radius:12px;border:1px solid var(--line);border-top-color:var(--brand)}

/* ---------- Trang thanh toán: lưới 2 cột
   TRÁI: Đơn hàng của bạn + Thông tin bổ sung (ghi chú)
   PHẢI: chỉ khối thanh toán (QR) ---------- */
.woocommerce-checkout form.checkout{
  display:grid;grid-template-columns:1.05fr .95fr;gap:16px 20px;align-items:start}
.woocommerce-checkout form.checkout #order_review_heading{grid-column:1;grid-row:1;margin:0}
.woocommerce-checkout form.checkout #order_review{display:contents}
.woocommerce-checkout form.checkout #order_review table.shop_table{grid-column:1;grid-row:2;margin:0}
.woocommerce-checkout form.checkout #payment{
  grid-column:2;grid-row:1 / span 4;margin:0;
  background:var(--card);border:1px solid var(--line);border-radius:14px}
.woocommerce-checkout form.checkout #customer_details{grid-column:1;grid-row:3}
.woocommerce-checkout form.checkout #customer_details .col-1,
.woocommerce-checkout form.checkout #customer_details .col-2{float:none;width:100%;margin:0}
/* Ẩn khối "Xác nhận đơn hàng" khi không có ô nào phải điền (đã đăng nhập) */
.woocommerce-checkout .woocommerce-billing-fields:not(:has(.form-row)){display:none}
.woocommerce-checkout #payment ul.payment_methods{border-bottom:1px solid var(--line);padding:14px}
.woocommerce-checkout #payment div.payment_box{background:transparent;color:var(--txt-soft)}
.woocommerce-checkout #payment div.payment_box::before{display:none}
.ph-checkout-qr{background:var(--bg-soft)}
#ph-auto-note{background:var(--brand-soft);color:var(--txt)}

/* ---------- Responsive checkout ---------- */
@media (max-width:820px){
  .woocommerce-checkout form.checkout{grid-template-columns:1fr}
  .woocommerce-checkout form.checkout #payment{grid-column:1;grid-row:auto}
  .woocommerce-checkout form.checkout #customer_details{grid-row:auto}
}
@media (max-width:560px){
  .ph-acts .btn{display:none}
  .ph-stats{gap:14px}
  /* bớt viền đen 2 bên: padding khung còn 10px */
  .wrap{padding:0 10px}
  .ph-main{padding:6px 10px 36px}
  .ph-topbar .inner{padding:8px 10px;gap:8px}
  .ph-headsearch{margin:0;max-width:none}
  .ph-hero{padding:14px 12px;margin:10px 0}
  /* thẻ sản phẩm gọn: chữ nhỏ, đệm mỏng */
  .woocommerce ul.products{grid-template-columns:repeat(2,1fr)!important;gap:9px}
  .woocommerce ul.products li.product .woocommerce-loop-product__title{
    padding:8px 10px 0;font-size:12.5px;line-height:1.3}
  .woocommerce ul.products li.product .price{padding:3px 10px;font-size:13px}
  .woocommerce ul.products li.product .price del{font-size:.8em}
  .woocommerce ul.products li.product .button{
    margin:0 10px 10px;padding:7px 11px;font-size:12px;width:calc(100% - 20px);justify-content:center}
  .ph-badge{font-size:9.5px;padding:3px 7px;top:6px;left:6px}
  .woocommerce span.onsale{font-size:10px;padding:2px 7px;top:6px;right:6px}
  .ph-card-meta{padding:2px 10px 0;font-size:10.5px}
  .ph-card-meta .seller .av{width:14px;height:14px}
  .ph-promo{padding:16px 14px;margin:18px 0}
}
