/* ============================================================
   Shop filter sidebar — Danh mục / Thương hiệu / Mức giá
   ============================================================ */
/* Ẩn widget text rỗng "Chọn theo nhu cầu" (giữ trong DOM để sidebar còn active) */
#shop-sidebar .widget_text{ display:none; }

/* Đồng bộ: khối nội dung danh mục (filter + sản phẩm) có đổ bóng như các thẻ khác trên site */
.category-page-row{ box-shadow:0 1px 2px 0 rgba(60,64,67,.102), 0 2px 6px 2px rgba(60,64,67,.149) !important; }
/* Ngăn cách filter (trái) với sản phẩm (phải) bằng 1 đường viền mảnh */
.category-page-row #shop-sidebar{ border-right:1px solid #eef0f2; padding-right:22px; }

.dap-shopf{ font-size:14px; color:#1f2430; line-height:1.4; }
.dap-shopf-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding-bottom:12px; margin-bottom:16px; border-bottom:2px solid #ed1c24; }
.dap-shopf-title{ font-size:16px; font-weight:800; display:inline-flex; align-items:center; gap:8px; color:#1f2430; }
.dap-shopf-title i{ color:#ed1c24; font-size:15px; }
.dap-shopf-clear{ font-size:12.5px; font-weight:600; color:#ed1c24; white-space:nowrap; }
.dap-shopf-clear:hover{ text-decoration:underline; }

.dap-shopf-sec{ margin-bottom:22px; }
.dap-shopf-sec:last-child{ margin-bottom:0; }
.dap-shopf-h{ font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.02em; color:#6b7280; margin:0 0 11px; }

/* Danh mục — chọn 1 (radio) */
.dap-shopf-cats{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px; }
.dap-shopf-cat{ display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:9px; color:#374151; font-weight:500; transition:background .18s ease, color .18s ease; }
.dap-shopf-cat:hover{ background:#f6f7f8; color:#ed1c24; }
.dap-shopf-cat.is-active{ background:#fdecec; color:#ed1c24; font-weight:700; }
.dap-shopf-radio{ width:18px; height:18px; flex:0 0 18px; border:2px solid #cbd0d6; border-radius:50%; position:relative; transition:border-color .15s ease; }
.dap-shopf-cat.is-active .dap-shopf-radio{ border-color:#ed1c24; }
.dap-shopf-cat.is-active .dap-shopf-radio::after{ content:""; position:absolute; left:3px; top:3px; right:3px; bottom:3px; border-radius:50%; background:#ed1c24; }

/* Checkbox-style: thương hiệu + mức giá */
.dap-shopf-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px; }
.dap-shopf-chk{ display:flex; align-items:center; gap:10px; padding:8px 8px; border-radius:8px; color:#374151; font-weight:500; transition:background .15s ease, color .15s ease; }
.dap-shopf-chk:hover{ background:#f6f7f8; color:#ed1c24; }
.dap-shopf-box{ width:18px; height:18px; flex:0 0 18px; border:2px solid #cbd0d6; border-radius:5px; position:relative; transition:border-color .15s ease, background .15s ease; }
.dap-shopf-chk.is-active{ color:#ed1c24; font-weight:600; }
.dap-shopf-chk.is-active .dap-shopf-box{ background:#ed1c24; border-color:#ed1c24; }
.dap-shopf-chk.is-active .dap-shopf-box:after{ content:""; position:absolute; left:4px; top:0; width:6px; height:10px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg); }

/* ============================================================
   Toolbar mobile — thanh gọn: [N kết quả] [Sắp xếp] [Bộ lọc]
   ============================================================ */
.dap-shop-toolbar{ display:none; }
.dap-shopf-close{ display:none; }
.dap-shopf-foot{ display:none; }

/* Off-canvas filter: magnific-popup canh giữa dọc -> panel bị đẩy xuống dưới fold.
   Ép panel filter phủ nguyên màn hình từ đỉnh. Dùng class .dap-shopf-panel do JS
   gắn (KHÔNG dùng :has vì 1 số browser cũ không hỗ trợ -> rule bị bỏ -> footer trôi). */
@media (max-width:849px){
  /* Selector thắng rule menu ☰ ".mfp-wrap.off-canvas .mfp-content{overflow:hidden}"
     (nếu thua -> overflow-y:auto bị đè -> KHÔNG lăn chuột/cuộn được) */
  .mfp-wrap.off-canvas .mfp-content.dap-shopf-panel,
  .mfp-content.dap-shopf-panel{
    position:fixed !important; top:0 !important; left:0 !important; right:0 !important; bottom:0 !important;
    height:100dvh !important; max-height:100dvh !important; width:100% !important; max-width:100% !important;
    margin:0 !important; vertical-align:top !important;
    overflow-y:auto !important; overflow-x:hidden !important;
    background:#fff !important; -webkit-overflow-scrolling:touch;
  }
}

@media (max-width:849px){
  /* Ẩn thanh sort + nút LỌC mặc định (thay bằng toolbar gọn).
     .sort_giuseart = hàng "Sắp xếp theo: Giá giảm dần..." (bản desktop UA) — trùng chức năng toolbar */
  .shop-page-title .category-filtering,
  .sort_giuseart,
  .sapxep{ display:none !important; }

  .dap-shop-toolbar{
    display:flex; align-items:center; gap:8px;
    background:#faf6ee; border:1px solid #efe7d6; border-radius:14px;
    padding:7px 8px 7px 13px; margin:0 0 14px;
  }
  .dap-stb-count{ flex:0 0 auto; font-size:13px; font-weight:700; color:#1f2430; white-space:nowrap; padding-right:12px; margin-right:2px; border-right:1px solid #ece3d0; }
  /* Dropdown sắp xếp custom (thay <select> native) */
  .dap-sort{ flex:1 1 auto; min-width:0; position:relative; }
  .dap-sort-btn{
    display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%;
    background:transparent; border:0; padding:8px 10px; border-radius:9px;
    font-size:13px; font-weight:600; color:#1f2430; cursor:pointer; line-height:1.4;
    text-transform:none !important; letter-spacing:normal;
  }
  .dap-sort-btn i{ flex:0 0 auto; color:#6b7280; font-size:12px; transition:transform .2s ease; }
  .dap-sort.is-open .dap-sort-btn i{ transform:rotate(180deg); }
  .dap-sort-cur{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .dap-sort-menu{
    display:none; position:absolute; top:calc(100% + 8px); left:0; z-index:30;
    min-width:210px; max-width:78vw; margin:0; padding:6px; list-style:none;
    background:#fff; border:1px solid #eef0f2; border-radius:12px; box-shadow:0 12px 32px rgba(0,0,0,.14);
  }
  .dap-sort.is-open .dap-sort-menu{ display:block; }
  .dap-sort-opt{
    display:block; width:100%; text-align:left; background:transparent; border:0;
    padding:11px 12px; border-radius:8px; font-size:14px; color:#374151; font-weight:500; cursor:pointer; white-space:nowrap; line-height:1.3;
    text-transform:none !important; letter-spacing:normal;
  }
  .dap-sort-opt:active{ background:#f6f7f8; }
  .dap-sort-opt.is-active{ background:#fdecec; color:#ed1c24; font-weight:700; }
  .dap-stb-filter{
    flex:0 0 auto; display:inline-flex; align-items:center; gap:6px;
    background:#fff; border:1px solid #e6ddca; border-radius:10px;
    padding:8px 13px; font-size:13px; font-weight:700; color:#1f2430; white-space:nowrap;
  }
  .dap-stb-filter i{ color:#ed1c24; font-size:13px; }
  .dap-stb-filter:active{ background:#f6f7f8; }

  /* --- Panel filter (off-canvas): X đóng + footer Đặt lại/Áp dụng --- */
  .dap-shopf{ padding:14px 16px 90px; }
  .dap-shopf-head{ margin-bottom:14px; }

  .dap-shopf-close{
    display:inline-flex; align-items:center; justify-content:center;
    width:34px; height:34px; margin:-4px -4px -4px 8px;
    border-radius:50%; color:#1f2430; font-size:17px; background:transparent;
  }
  .dap-shopf-close:active{ background:#f1f2f4; }

  .dap-shopf-foot{
    display:flex; gap:10px; align-items:center;
    position:fixed; left:0; right:0; bottom:0; z-index:5;
    margin:0; padding:12px 16px;
    background:#fff; border-top:1px solid #eef0f2;
    box-shadow:0 -2px 12px rgba(0,0,0,.06);
  }
  .dap-shopf-reset,
  .dap-shopf-apply{
    display:inline-flex !important; align-items:center; justify-content:center;
    height:46px; min-height:0 !important; padding:0 16px !important; margin:0 !important;
    border-radius:10px; line-height:1.4 !important; font-size:14px; cursor:pointer;
  }
  .dap-shopf-reset{ flex:0 0 auto; min-width:92px; border:1px solid #d9dde2; background:#fff; color:#374151; font-weight:600; }
  .dap-shopf-reset:active{ background:#f6f7f8; }
  .dap-shopf-apply{ flex:1 1 auto; border:0; background:#ed1c24; color:#fff; font-weight:700; }
  .dap-shopf-apply:active{ background:#c50f18; }
}
