/* =============================================================
   responsive.css — GIAO DIỆN RIÊNG cho MOBILE + TABLET (không phải "co lại").
   Nạp trên MỌI trang (prerender.js + build-pages.js). Desktop ≥992px GIỮ NGUYÊN.

   Tầng breakpoint:
     • ≤991px  = TẦNG "APP"  (mobile + tablet): thanh đáy, header gọn, ẩn khối thừa,
                             carousel khối phụ, footer accordion.
     • ≤599px  = điện thoại : siết chặt (lưới 2 cột, chữ nhỏ, PDP 1 cột).
     • 600–991 = tablet      : "phóng to" (lưới 3 cột, card/chữ lớn hơn).

   Đi kèm assets/mobile.js (bơm thanh đáy + bottom-sheet danh mục + footer accordion
   + class body.ckd-pdp cho trang sản phẩm). File này nạp SAU CSS inline của pagekit
   → override được các rule cũ khi cùng độ đặc hiệu.
   ============================================================= */

:root{
  --ckd-g:#0e3d2e;      /* xanh rêu thương hiệu */
  --ckd-g2:#16533c;
  --ckd-acc:#f47c2e;    /* cam hành động */
  --ckd-tabh:58px;      /* cao thanh đáy */
}

/* Thanh đáy + bottom-sheet + nút giỏ PDP mặc định ẨN ở desktop (chỉ bật ở ≤991 phía dưới).
   ⚠ .ckd-pdp-cart do mobile.js chèn vào .pd-act trên MỌI viewport → PHẢI ẩn ở desktop, nếu không
   SVG không set kích thước (mặc định ~300px) sẽ đội .pd-act cao lên → 2 nút flex:1 stretch thành hình tròn. */
.ckd-tabbar,.ckd-sheet,.ckd-sheet-ov,.ckd-pdp-cart{display:none}

/* ============================================================
   TẦNG APP  (≤991px)  — mobile + tablet dùng chung
   ============================================================ */
@media (max-width:991px){

  /* ---------- A. HEADER ---------- */
  /* Ẩn thanh trên cùng (SĐT / ngôn ngữ / khu vực) — thừa trên mobile */
  .nav-topbar{display:none!important}

  /* Header dính đầu trang, gọn: LOGO + Ô TÌM KIẾM (fill) */
  .navbar-logo-left{position:sticky;top:0;z-index:1200;background:#fff;box-shadow:0 2px 12px rgba(0,0,0,.07)}
  .navbar-logo-left .container{overflow:visible;max-width:100%;padding-left:0!important;padding-right:0!important}
  .navbar-wrapper{display:flex!important;align-items:center;gap:10px;flex-wrap:nowrap;
    padding:9px 14px!important;box-sizing:border-box;width:100%;max-width:100%}
  .navbar-brand{flex:0 0 auto;margin:0}
  .logo-iimage{height:32px;width:auto;display:block}

  /* Bỏ hamburger + các link menu (thay bằng tab "Danh mục" ở đáy) */
  .menu-button,.w-nav-button{display:none!important}
  .nav-right-link{display:none!important}   /* Tài khoản/Giỏ ở header — đã có ở thanh đáy */

  /* Bung ô tìm kiếm ra khỏi menu ẩn của Webflow, cho hiện full-width (ép co để không tràn) */
  .nav-menu-wrapper{display:block!important;position:static!important;transform:none!important;
    background:none!important;box-shadow:none!important;border:none!important;padding:0!important;margin:0!important;
    flex:1 1 0%;min-width:0;width:auto!important;max-width:100%;overflow:visible!important}
  .nav-menu-two,.nav-menu-wrapper>ul{display:none!important}   /* link Danh mục/Khuyến mãi/… */
  .nav-menu-wrapper .search,.nav-menu-wrapper .search-form{display:block!important;flex:1;margin:0!important;
    width:100%;max-width:100%;min-width:0;box-sizing:border-box}
  .nav-menu-wrapper .zero-widht{display:none}
  .search-input{width:100%!important;max-width:100%;box-sizing:border-box;height:42px;border-radius:999px;
    border:1.5px solid #e8e8ea;background:#f6f6f7;padding:0 16px;font-size:14px}
  .search-input:focus{border-color:var(--ckd-g);background:#fff;outline:none}
  /* dropdown gợi ý bám full-width dưới header */
  .ckd-sr{left:0;right:0;width:auto!important;max-width:100%}

  /* ---------- B. TRANG CHỦ ---------- */
  /* Ẩn khối user chọn bỏ: "Cửa hàng bán chạy" + "Dịch vụ hỗ trợ" */
  .best-selling-store-area,.services-help-area{display:none!important}

  /* Hero gọn — bỏ ảnh nền bg-stage (minh hoạ desktop), thay nền gradient thương hiệu */
  .banner-area{background-image:none!important;background:linear-gradient(135deg,#e9f2ec 0%,#fbf1e6 100%)!important;
    padding:20px 0 22px!important;border-radius:0 0 22px 22px;overflow:hidden}
  .banner-content h1,.banner-inner h1,.banner-title{font-size:26px!important;line-height:1.18!important;margin-bottom:10px!important}
  .banner-stage-wrap,.banner-stage,.d-ipad-pro-none{display:none!important}
  .banner-area .banner-paragraph{font-size:14px!important;margin-bottom:16px!important}
  .banner-button{margin-top:4px}

  /* Tiêu đề section gọn hơn */
  .section-title-wrap{margin-bottom:16px!important}
  .section-title-wrap .section-title,.section-title{font-size:20px!important;line-height:1.25!important}

  /* 6 nhóm danh mục nổi bật → lưới 3 ô */
  .shop-category-wrap{display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:10px!important}
  .shop-category-single-item.ckd-cat-card{padding:12px 6px!important}
  .shop-category-single-item.ckd-cat-card .category-title{font-size:12.5px!important;text-align:center;margin-top:6px}
  .ckd-cat-sub{display:none!important}   /* mô tả phụ — bỏ cho gọn trên mobile */

  /* "ƯU ĐÃI HÔM NAY" (chính) = LƯỚI 2 CỘT — ép Swiper thành grid */
  .best-deal-for-you-area .product-outer-wrap{overflow:visible!important}
  .best-deal-for-you-area .swiper-wrapper{display:grid!important;grid-template-columns:repeat(2,1fr)!important;
    gap:12px!important;transform:none!important;width:auto!important;height:auto!important}
  .best-deal-for-you-area .product-single-item.swiper-slide{width:auto!important;margin:0!important;flex:none!important}

  /* Khối PHỤ = VUỐT NGANG:
     - "Bán chạy nhất" (Swiper) đã cuộn ngang sẵn → chỉ chỉnh bề rộng slide.
     - "Xu hướng" (grid) → ép flex cuộn ngang. */
  .most-selling-product-area .product-single-item.swiper-slide{width:56vw!important;max-width:230px}
  .trending-product-item-wrap{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;gap:12px;
    padding-bottom:8px;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .trending-product-item-wrap::-webkit-scrollbar{display:none}
  .trending-single-item{flex:0 0 66vw!important;max-width:280px;margin:0!important;scroll-snap-align:start}

  /* card SP gọn lại trên mobile */
  .product-single-item .product-title{font-size:13.5px!important}
  .product-single-item .product-price{font-size:15px!important;font-weight:800}
  .product-color{font-size:11.5px!important}

  /* ---------- C. TRANG DANH MỤC / SẢN PHẨM (pagekit) ---------- */
  .pg{padding-left:14px;padding-right:14px}
  .crumb{margin:14px 0;font-size:12.5px}
  .cat-banner{min-height:0!important;margin-bottom:16px}
  .cat-banner .t{padding:22px!important}
  .cat-banner h1{font-size:23px!important;margin-bottom:14px!important}
  .cat-banner .im{display:none!important}
  .cat-h{font-size:20px!important}
  /* thanh filter cuộn ngang thay vì xuống dòng lộn xộn */
  .filters{flex-wrap:nowrap!important;overflow-x:auto;padding-bottom:6px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .filters::-webkit-scrollbar{display:none}
  .filters .chip{flex:0 0 auto}
  .chip.sort{margin-left:0!important}
  .cat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important}

  /* TRANG SP */
  .pd{grid-template-columns:1fr!important;gap:20px!important;margin-bottom:20px}
  .pd-info h1{font-size:22px!important}
  .pd-price{font-size:24px!important}
  .pd-thumb{flex-basis:60px;width:60px;height:60px}
  .pd-desc{font-size:14.5px;margin-bottom:26px}
  .rel-carousel .product-single-item{flex:0 0 60vw!important;width:60vw!important}

  /* ---------- D. GIỎ / THANH TOÁN ---------- */
  .co-wrap{grid-template-columns:1fr!important;gap:16px!important}
  .co-form{grid-template-columns:1fr!important}
  .co-h{font-size:22px!important;margin:18px 0 16px}
  .co-card{padding:18px 16px!important}
  .cart-group{padding:16px 14px!important}
  .co-thumb{width:66px;height:66px;flex-basis:66px}
  .co-item{gap:12px}
  .cart-group-foot{gap:10px}
  .cart-group-foot .co-btn{width:100%}
  .co-btn{width:100%;padding:15px!important}   /* nút thanh toán full-width, vùng chạm lớn */
  .co-btn.ghost{width:auto}
  .coupon{flex-wrap:wrap}

  /* ---------- E. FOOTER → ACCORDION ---------- */
  .footer-payment-wrap{display:none!important}      /* logo Visa/Paypal/Stripe — bỏ trên mobile */
  .footer-columns{display:block!important}
  .footer-nav{border-top:1px solid #ececec;padding:4px 0}
  .footer-menu-title{cursor:pointer;display:flex!important;align-items:center;justify-content:space-between;
    margin:0!important;padding:14px 2px!important;font-size:15px!important;user-select:none}
  .footer-menu-title::after{content:"⌄";font-size:18px;color:#888;transition:transform .2s;line-height:1}
  .footer-nav.ckd-open .footer-menu-title::after{transform:rotate(180deg)}
  .footer-menu-list{overflow:hidden;max-height:0;transition:max-height .28s ease;margin:0!important;padding:0!important}
  .footer-nav.ckd-open .footer-menu-list{max-height:640px;padding-bottom:12px!important}
  .footer-about-us{margin-bottom:6px!important}

  /* ---------- F. THANH ĐÁY CỐ ĐỊNH (kiểu app) ---------- */
  .ckd-tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:1300;background:#fff;
    border-top:1px solid #ececec;box-shadow:0 -3px 16px rgba(0,0,0,.07);
    padding-bottom:env(safe-area-inset-bottom);height:calc(var(--ckd-tabh) + env(safe-area-inset-bottom))}
  .ckd-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
    background:none;border:none;cursor:pointer;text-decoration:none;color:#6b7280;font:inherit;
    font-size:10.5px;font-weight:600;padding:7px 2px;position:relative;-webkit-tap-highlight-color:transparent}
  .ckd-tab svg{width:23px;height:23px;stroke:currentColor;stroke-width:1.7;fill:none;
    stroke-linecap:round;stroke-linejoin:round}
  .ckd-tab.on{color:var(--ckd-g)}
  .ckd-tab.on svg{stroke:var(--ckd-g)}
  .ckd-tab-ic{position:relative;line-height:0}
  .ckd-tab-badge{position:absolute;top:-6px;right:-9px;min-width:16px;height:16px;padding:0 4px;border-radius:999px;
    background:var(--ckd-acc);color:#fff;font-size:10px;font-weight:800;line-height:16px;text-align:center;display:none}
  /* chừa chỗ cho thanh đáy để không che nội dung/footer */
  body{padding-bottom:calc(var(--ckd-tabh) + env(safe-area-inset-bottom))}

  /* ---------- G. BOTTOM-SHEET DANH MỤC ---------- */
  .ckd-sheet-ov{display:block;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:1400;opacity:0;
    visibility:hidden;transition:opacity .25s}
  .ckd-sheet-ov.on{opacity:1;visibility:visible}
  .ckd-sheet{display:block;position:fixed;left:0;right:0;bottom:0;z-index:1401;background:#fff;
    border-radius:20px 20px 0 0;max-height:78vh;overflow:hidden;transform:translateY(100%);
    transition:transform .28s cubic-bezier(.4,0,.2,1);padding-bottom:env(safe-area-inset-bottom)}
  .ckd-sheet.on{transform:translateY(0)}
  .ckd-sheet-h{display:flex;align-items:center;justify-content:space-between;padding:16px 18px 10px;
    font-weight:800;font-size:17px;border-bottom:1px solid #f1f1f3}
  .ckd-sheet-h span{font-size:26px;line-height:1;color:#999;cursor:pointer;padding:0 4px}
  .ckd-sheet-body{overflow-y:auto;max-height:calc(78vh - 56px);padding:8px 12px 16px}
  .ckd-sheet-grp{border-bottom:1px solid #f4f4f5;padding:10px 6px}
  .ckd-sheet-grp:last-child{border-bottom:none}
  .ckd-sheet-grp>a.h{display:flex;align-items:center;justify-content:space-between;font-weight:800;
    color:var(--ckd-g);font-size:14.5px;text-decoration:none;padding:6px 4px}
  .ckd-sheet-grp .subs{display:flex;flex-wrap:wrap;gap:7px;margin-top:6px}
  .ckd-sheet-grp .subs a{font-size:12.5px;color:#444;text-decoration:none;background:#f4f4f5;
    border-radius:999px;padding:6px 12px}
  .ckd-sheet-grp .subs a:active{background:#eee}
  .ckd-sheet-all{display:block;text-align:center;font-weight:800;color:var(--ckd-acc);
    text-decoration:none;padding:14px;margin:6px 6px 2px;border:1.5px solid rgba(244,124,46,.35);border-radius:12px}

  /* ---------- H. TRANG SẢN PHẨM: thanh hành động cố định đáy ---------- */
  /* Trên PDP ẩn thanh đáy toàn cục, thay bằng [Thêm giỏ]/[Mua ngay] cố định */
  body.ckd-pdp .ckd-tabbar{display:none}
  body.ckd-pdp{padding-bottom:calc(70px + env(safe-area-inset-bottom))}
  body.ckd-pdp .pd-act{position:fixed;left:0;right:0;bottom:0;z-index:1300;margin:0!important;
    background:#fff;border-top:1px solid #ececec;box-shadow:0 -3px 16px rgba(0,0,0,.08);
    padding:10px 12px calc(10px + env(safe-area-inset-bottom))!important;gap:10px;display:flex}
  body.ckd-pdp .pd-act>*{flex:1;padding:14px 10px!important}
  body.ckd-pdp .pd-act .ckd-pdp-cart{flex:0 0 52px;display:flex;align-items:center;justify-content:center;
    border:1.5px solid var(--ckd-g);border-radius:12px;color:var(--ckd-g);text-decoration:none;position:relative}
  body.ckd-pdp .pd-act .ckd-pdp-cart svg{width:24px;height:24px;stroke:currentColor;stroke-width:1.7;fill:none;stroke-linecap:round;stroke-linejoin:round}
  body.ckd-pdp .pd-act .ckd-pdp-cart .ckd-tab-badge{display:none}
}

/* ============================================================
   ĐIỆN THOẠI  (≤599px) — siết chặt thêm
   ============================================================ */
@media (max-width:599px){
  .shop-category-wrap .category-title{font-size:11.5px!important}
  .cat-grid{gap:10px!important}
  .pd-info h1{font-size:20px!important}
  .co-thumb{width:58px;height:58px;flex-basis:58px}
  /* thu nhỏ nút thanh hành động PDP cho vừa 1 hàng */
  body.ckd-pdp .pd-act .btn-g,body.ckd-pdp .pd-act .btn-o{font-size:14px!important;padding:13px 6px!important}
}

/* ============================================================
   TABLET  (600–991px) — "mobile phóng to": lưới 3 cột, card lớn hơn
   ============================================================ */
@media (min-width:600px) and (max-width:991px){
  .cat-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:18px!important}
  .ckd-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}        /* trang /tim-kiem/ */
  .best-deal-for-you-area .swiper-wrapper{grid-template-columns:repeat(3,1fr)!important;gap:16px!important}
  .shop-category-wrap{grid-template-columns:repeat(6,1fr)!important}         /* 6 nhóm 1 hàng */
  .most-selling-product-area .product-single-item.swiper-slide{width:34vw!important;max-width:260px}
  .trending-single-item{flex-basis:40vw!important;max-width:320px}
  .rel-carousel .product-single-item{flex:0 0 34vw!important;width:34vw!important}
  /* PDP: gallery + info 2 cột cân đối trên tablet */
  .pd{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:28px!important}
  .pd-info h1{font-size:24px!important}
  .product-single-item .product-title{font-size:14.5px!important}
}
