html, body{
  margin:0;
  padding:0;
  height:100%;
  background:#fff;
  font-family: Arial, Helvetica, sans-serif;
  color: #222;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}

a { text-decoration: none; color: inherit; }

/* ===== TITLE HEADER ===== */
.site-title{
  text-align:center;      /* Căn giữa */
  font-size:26px;         /* 🔼 To hơn */
  font-weight:800;
  margin:12px 0 4px;     /* ⬇️ Cách top xuống, cách search 1 chút */
  line-height:1.25;
}

.site-title a{
  display:inline-block;
}


/* ===== MAIN MENU ===== */
.main-nav{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:22px;

  padding:0;      /* 🔥 giảm tối đa khoảng dưới */
  margin:0;             /* bỏ mọi margin dư */
  line-height:1;        /* chữ không chiếm thêm chiều cao */

  font-weight:500;
  font-size:15px;
}

/* Link menu */
.main-nav a{
  padding:0;        /* 🔥 cực sát */
  margin:0;
  line-height:1;
  color:#333;
}

/* Hiệu ứng chạm mobile */
.main-nav a:active{
  transform:scale(.96);
}
/* Hover desktop */
@media (hover:hover){
  .main-nav a:hover{
    color:#d32f2f;
  }
  .main-nav a::after{
    content:"";
    position:absolute;
    left:0;
    bottom:-3px;
    width:0;
    height:2px;
    background:#d32f2f;
    transition:width .25s ease;
  }
  .main-nav a:hover::after{
    width:100%;
  }
}
.site-header .main-nav{
  margin-top: 6px;
  padding-bottom: 1px;
}
/* ===== GẠCH NGANG DƯỚI MENU ===== */
.header-divider{
  height:1px;
  background:#e5e5e5;

  margin-top:2px;
  margin-bottom:0;      /* ✅ sát bottom */
  margin-left:-16px;
  margin-right:-16px;
}

/* ===== CONTAINER CHUNG ===== */
.container{
  max-width:1100px;
  margin:auto;
  padding:16px;
}


/* ===== HEADER GỐC ===== */
.site-header{
  background:#fff;
  position:relative;
  z-index:1000;
}

/* Bọc nội dung header */
.header-wrap{
  display:flex;
  flex-direction:column;
  gap:12px;
  max-width:100%;
  padding:0 16px;
}
.fixed-search{
  top:0;
  left:0;
  width:100%;
  z-index:9999;
  border-radius:0;
  box-shadow:0 2px 8px rgba(0,0,0,.08);
}

.site-header,
.header-wrap,
.container{
  overflow: visible !important;
}
.site-header.sticky-search .site-title,
.site-header.sticky-search .main-nav{
  display:none;
}

.site-header.sticky-search .header-wrap{
  padding:8px 0 12px;
  gap:0;
}


/* ===================================== */
/* ========== KHUNG STICKY WRAP ========= */
/* ===== TRẠNG THÁI BÌNH THƯỜNG ===== */
.search-sticky-wrap{
  position:relative;         /* 🔥 MẶC ĐỊNH */
  z-index:9999;

  background:transparent;    /* ❌ không nền */
  padding:0 !important;
  border-bottom:none;
  
  transition:background .2s ease;
  
  height: 37px;
}

/* ===== KHI DÍNH (JS add .stuck) ===== */
.search-sticky-wrap.stuck{
  position:fixed;            /* 🔥 QUAN TRỌNG */
  top:0;
  left:0;
  right:0;

  background:#fff;           /* nền trắng */
  padding:6px 0;             /* khoảng thở nhẹ */
  border-bottom:1px solid #eee;

  z-index:9999;
  height: 37px;
}

/* ===== KHI ĐANG GÕ (KHÔNG ĐỔI POSITION) ===== */
.search-sticky-wrap.input-focus{

  background:#fff;
  /*
  position: relative !important;
  top: auto !important;
  */
}

/* ===== HEADER FLEX ===== */

.search-header{
  display:flex;
  align-items:center;
  gap:10px;

  width:100%;                 /* 🔥 QUAN TRỌNG */
  padding:0 !important;
  box-sizing:border-box;
}
/* ===== BUTTON CHUNG ===== */

.back-btn,
.sort-btn-search
  flex-shrink:0;

  width:32px;
  height:32px;

  display:flex;
  align-items:center;
  justify-content:center;

  border:none;
  background:none;

  font-size:22px;
  font-weight:700;

  padding:0;
  margin:0;

  cursor:pointer;
}

/* ===== SORT BUTTON RIÊNG ===== */

.sort-btn-search{
  color:#c62828;     /* 🔥 giữ màu đỏ */
  font-size:20px;
  font-weight:600;
}

/* ===== BACK BUTTON RIÊNG ===== */

.back-btn{
  width:32px;
  height:32px;
  flex-shrink:0;

  font-size:22px;
  font-weight:700;
  color:#8f8f8f;
}

/* ===== ACTIVE EFFECT ===== */

.back-btn:active,
.sort-btn-search:active{
  transform:scale(.95);
}

/* ============================= */
/* SEARCH WRAP */
/* ============================= */

.search-sticky-wrap{
  width:100%;
}


/* ============================= */
/* SEARCH BAR – CHUNG */
/* ============================= */

.search-bar{
  flex:1;                     /* 🔥 Quan trọng nhất */
  min-width:0;
  
  display:flex;
  align-items:center;
  gap:8px;

  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:8px;

  height:35px;                /* ✅ cố định chiều cao */
  padding:0 12px;             /* ✅ KHÔNG dùng padding dọc */

  box-sizing:border-box;
  margin:0;
  position:relative; 
  
  --search-padding:12px;
}

/* 🔥 FIX iOS FLEX BUG */
.search-bar input{
  flex:1;
  min-width:0;
  border:none;
  outline:none;
  font-size:16px;
}

/* ============================= */
/* TRANG CHỦ */
/* ============================= */

.home .search-bar:not(.stuck){
  width:100%;
}

/* ============================= */
/* TRANG KHÁC */
/* ============================= */

body:not(.home) .search-bar:not(.stuck){
  max-width:560px;
  margin:0 auto;
}



/* ============================= */
/* MOBILE */
/* ============================= */

@media (max-width:768px){

  .search-header{
    padding:0 10px;
  }

  .search-bar,
  .search-bar.stuck{
    width:100%;
    max-width:none;
    height:38px;
    padding:8px 12px;
  }

  .search-bar input{
    font-size:16px;
  }
}



/* Ẩn Back + Sort ở trang chủ */

.home .back-btn,
.home .sort-btn-search{
  visibility:hidden;
  pointer-events:none;
  display:none;
}

.home .search-header{
  gap:6px;   /* giảm khoảng trống dư */
}
.home .search-bar{
  flex:1;
}
.clear-btn{
  display:none !important;               /* mặc định ẩn */
  border:none;
  background:none;
  font-size:18px;
  color:#999;
  cursor:pointer;

  padding:0;
  margin-left:6px;

  touch-action: manipulation;   /* 🔥 fix iOS */
  pointer-events:auto;          /* 🔥 đảm bảo nhận click */
  z-index:5;                    /* 🔥 nổi hơn input */
}

/* 👉 Khi input có giá trị thì hiện nút ✕ */
.search-bar.has-value .clear-btn{
  display:flex !important;
  align-items:center;
}

/* hover nhẹ cho desktop */
.clear-btn:hover{
  color:#333;
}

.search-toolbar{
  display:flex;
  align-items:center;
  gap:8px;
  margin:10px 0 14px;
  font-size:14px;
}

.search-toolbar select{
  padding:6px 10px;
  border:1px solid #e5e7eb;
  border-radius:6px;
  font-size:14px;
  background:#fff;
}
/* Input */
.search-bar input{
  flex:1;
  border:none;
  background:transparent;
  font-size:16px;
  outline:none;
  color:#111;                 /* ✅ chữ đen */
  caret-color:#111; 
  
  scroll-margin-top: 120px;
  
  height: 24px;
  line-height: 24px;
}

.search-bar input::placeholder{
  color:#9aa0a6;
}


/* Icon button */
.search-bar button{
  background:none;
  border:none;
  padding:0;
  display:flex;
  align-items:center;
  
}


/* Focus trạng thái thường */
.search-bar:focus-within{
  background:#fff;
  border-color:#c62828;
  box-shadow:0 0 0 1px #c62828;
  color:#111;
}

/* ===== SEARCH SUGGEST ===== */

.search-suggest{
  position:fixed;
  left:0;
  right:0;
  top:60px;

  background:#fff;
  border-radius:0 0 12px 12px;
  box-shadow:0 10px 30px rgba(0,0,0,.08);

  display:none;
  z-index:99999;
}

.search-suggest.show{
  display:block;   /* 🔥 FIX DUY NHẤT CẦN */
}

/* ITEM SUGGEST */
.search-suggest-item{
  padding:10px 14px;
  font-size:15px;
  cursor:pointer;

  display:flex;
  align-items:center;

  border-bottom:1px solid #f1f1f1;   /* 🔥 gạch chân */
  white-space:nowrap;          /* 🔥 1 dòng */
  overflow:hidden;             /* 🔥 chặn tràn */
  text-overflow:ellipsis;
}

/* Bỏ gạch chân item cuối */
.search-suggest-item:last-child{
  border-bottom:none;
}

/* Hover giống sàn */
.search-suggest-item:hover{
  background:#f8f8f8;
}

/* Hiệu ứng tap mobile */
.search-suggest-item:active{
  background:#f2f2f2;
}

/* ===================================== */
/* ========== KHI THANH BỊ DÍNH ========= */
/* ===================================== */



/* Thanh search khi sticky */
.search-bar.stuck{
  position: fixed;
  top: 3px;
  right: 0;
  left: 50%;                     /* 🔥 chìa khóa fix lệch */
  transform: translateX(-50%);   /* 🔥 */

  width: calc(100% - 32px);      /* 🔥 kiểm soát chiều ngang */

  display:flex;
  align-items:center;
  gap:8px;

  background:#fff;
  border-radius:0;

  height:33px;
  padding:0;
  margin: 0;
  border: none;
  box-shadow: none;
  box-sizing:border-box;
  z-index:999;
}


/* Icon  */
.search-bar svg{
  width:22px;
  height:22px;
  color:#8f8f8f;
}
/* Khi dính */
.search-bar.stuck svg{
  width:22px;
  height:22px;
  color:#8f8f8f;
  }
/* Focus khi sticky */
.search-bar.stuck:focus-within{
  border: none;
  box-shadow: none;
  background:#fff;
  color:#111;
}




/* ===== STICKY BUY BAR ===== */
.sticky-buy-bar{
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 45px;
  display: flex;
  z-index: 1000;
  background:#fff;
}

.sticky-buy-bar a{
  display:flex;
  align-items:center;
  justify-content:center;
  height:100%;
  width:100%;
  text-decoration:none;
  font-size:13px;
}
.sticky-buy-bar.show{
  transform: translateY(0);
}
.sticky-chat{
  flex: 0 0 25%;
  background:#fff;
  border-right:1px solid #eee;
}

.sticky-cart{
  flex: 0 0 25%;
  background:#fff;
  border-right:1px solid #eee;
}

.sticky-buy{
  flex: 0 0 50%;
  background:#c62828;
  color:#fff;
  font-size:13px;

}
.sticky-buy-bar svg{
  width:18px;          /* icon nhỏ lại */
  height:24px;
  margin-bottom:2px;
}

/* ===================================== */
/* ========== SORT TOOLBAR UI ========== */
/* ===================================== */

.sort-btn{
  border:none;
  background:none;

  font-size:15px;
  font-weight:600;

  color:#666;
  padding:6px 4px;

  cursor:pointer;

  position:relative;
  white-space:nowrap;
  flex-shrink:0;
}

/* hover nhẹ */
.sort-btn:hover{
  color:#111;
}

/* ===== ACTIVE ===== */
.sort-btn.active{
  color:#c62828;
  font-weight:700;
}

.sort-btn.active::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-6px;

  width:100%;
  height:2px;

  background:#c62828;
  border-radius:2px;
}

/* animation mượt */
.sort-btn::after{
  transition:all .2s ease;
}

/* ===== ARROW ===== */
.sort-btn .arrow{
  font-size:13px;
  margin-left:2px;
}

/* ===== MOBILE ===== */
@media (max-width:768px){


  .sort-btn{
    font-size:14.5px;
  }
}

/* ================= SCROLL TO TOP ================= */

.scroll-top-btn{
  position:fixed;

  bottom: 38px;
  right:16px;

  width:42px;
  height:42px;
  border-radius:50%;
  border:none;
  background:#fff;

  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;

  box-shadow:0 12px 28px rgba(0,0,0,.18);
  z-index:7000; /* cao hơn sticky bar */
  transition:transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.scroll-top-btn:hover{
  transform:translateY(-3px);
  box-shadow:0 16px 32px rgba(0,0,0,.22);
}

.scroll-top-btn svg{
  width:18px;
  height:30px;
}

.scroll-top-btn svg path{
  stroke-width:3;
}


/* ===============================
   FOOTER KEYWORDS – CLS FIX TRIỆT ĐỂ
   =============================== */

.shop-footer-keywords {
  padding: 24px 16px;
  background: #f5f5f5;
  border-top: 1px solid #e5e5e5;
  box-sizing: border-box;

  /* 🔒 FIX CLS 100% */
  height: 560px;           /* desktop FIXED */
  overflow: hidden;
}

@media (max-width: 768px) {
  .shop-footer-keywords {
    height: 650px;         /* mobile FIXED */
  }
}

/* ===== BLOCK ===== */
.sf-block {
  margin-bottom: 28px;
}

/* ===== TITLE ===== */
.sf-title {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin: 0 0 12px;
  line-height: 1.3;
}

/* ===== LINKS ===== */
.sf-links {
  font-size: 13px;
  line-height: 1.55;
  color: #222222;

  /* 🔒 CHỐT CLS */
  max-height: 185px;
  overflow: hidden;
}

/* ===== LINKS WRAP ===== */
.sf-links {
  font-size: 13px;
  line-height: 1.85;
  color: #222222;

  max-height: 175px;
  overflow: hidden;
}

/* ===== LINK ===== */
.sf-links a {
  color: #222222;
  display: inline-block;

  /* ❌ bỏ underline mặc định */
  text-decoration: none;

  margin-right: 6px;
  margin-bottom: 2px;

  white-space: nowrap;
  vertical-align: baseline;
}

/* hover */
.sf-links a:hover {
  color: #ee4d2d;
  border-bottom-color: #ee4d2d;
}

/* ===== DẤU | NGĂN CÁCH ===== */
.sf-links a:not(:last-child)::after {
  content: " |";
  color: #bbb;
  margin-left: 2px;

  /* ❗ QUAN TRỌNG: không cho gạch */
  border-bottom: none;
}

/* ===== KHÔNG GẠCH – CÓ THỂ BẠN ĐANG TÌM ===== */
.sf-links.light a {
  border-bottom: none;
  color: #222222;
}

.sf-links.light a:hover {
  color: #ee4d2d;
  border-bottom: 1px solid #ee4d2d;
}


/* ===== FOOTER ===== */
.site-footer{
  background:#fff;
  padding:10px 16px 60px;
  border-top:1px solid #eee;
}

.footer-inner{
  max-width:1000px;
  margin:auto;
  text-align:center;
  color:#444;
}

/* Dòng bản quyền */
.footer-copy{
  font-size:16px;
  margin-bottom:18px;
  color:#555;
}

/* Đoạn mô tả */
.footer-desc{
  font-size:15px;
  line-height:1.6;
  margin:10px 0;
}

/* Tên shop in đậm */
.footer-desc strong{
  font-weight:700;
  color:#222;
}

/* MENU FOOTER */
.footer-menu{
  margin-top:10px;
  display:flex;
  justify-content:center;
  gap:36px;
  flex-wrap:wrap;
}

/* Link menu dưới cùng */
.footer-menu a{
  font-size:16px;
  font-weight:500;      /* 🔥 chữ mỏng hơn */
  color:#333;
  text-decoration:none; /* ❌ không gạch chân */
  transition:opacity .2s ease;
}

.footer-menu a:hover{
  opacity:.6;
}

.grid{
  display:grid;
 grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap:14px;
  margin-top:20px;
}
.card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0,0,0,0.06);
  transition: transform .15s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
}

/* ==== KHUNG ẢNH VUÔNG ==== */
.card-img {
  width: 100%;
  aspect-ratio: 1 / 1;   /* Vuông 100% */
  background: #f5f5f5;
  overflow: hidden;
}

/* ==== ẢNH FULL KHUNG ==== */
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;     /* CẮT ẢNH như Lazada */
  display: block;
}

/* ==== TEXT ==== */
.card h3 {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  margin: 10px 8px 2px;
  height: 36px;
  min-height: 36px;
  overflow: hidden;
  flex-grow: 1;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card .price {
  margin: 0 8px 8px;
  font-size: 15px;
  font-weight: 600;
  color: #d32f2f;
  margin-top: -2px;
}
.img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;   /* ✅ Google biết trước kích thước */
  overflow: hidden;
  background: #f5f5f5;
  border-radius: 8px;
}

.img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;     /* cắt ảnh giữa */
  display: block;
}
.related-title{
  font-size:20px;
  font-weight:700;
  margin:30px 0 12px;
}


/* TRANG CHI TIẾT */
/* ===== PRODUCT TITLE ===== */
.product-page h1{
  font-size:17px;        /* nhỏ lại */
  font-weight:500;       /* chữ mỏng hơn */
  text-transform:none;   /* đảm bảo không bị viết HOA */
  line-height:1.5;
  margin:12px 0 14px;
}



/* ===== ẢNH FULL MÀN HÌNH (MOBILE FIRST) ===== */
.product-image-full{
  width:100%;
}

.product-image-full img{
  display:block;
  width:100%;
  height:auto;
}

/* Desktop thu nhỏ lại cho đẹp */
@media (min-width:769px){
  .product-image-full{
    max-width:520px;
    margin:18px auto 12px;
    border-radius:14px;
    overflow:hidden;
  }
}

/* ===== KHỐI GIÁ SẢN PHẨM ===== */

.product-price{
  display:flex;
  align-items:center;
  gap:10px;

  /* Tràn full giống nút Mua ngay */
  margin:12px -16px 6px;   /* kéo ra khỏi container */
  padding:0 25px;          /* khoảng cách chữ so với mép màn hình */

  flex-wrap:wrap;
}

.price-new{
  margin:0;
  font-size:18px;
  font-weight:600;
  color:#c62828;
}

.price-old{
  margin:0;
  font-size:14px;
  color:#9e9e9e !important;     /* ÉP màu xám */
  text-decoration:line-through;
  font-weight:200;
}

.discount-badge{
  background:#ffe8e8;
  color:#ee4d2d;
  font-weight:200;
  font-size:12px;
  padding:2px 6px;
  border-radius:6px;
}
.price{
  color:#c62828;
  font-size:15px;
  font-weight:500;
}

.discount{
  color:#ff5722;
  font-size:14px;
  font-weight:300;
}

/* BUY BUTTON */

.btn-buy{
  display:block;                 /* đổi từ flex sang block để margin auto hoạt động chuẩn */
  width:82%;                     /* nhỏ hơn 100% để không sát mép */
  max-width:480px;               /* giới hạn trên màn lớn */

  margin:18px auto;              /* auto trái phải = cân giữa */

  padding:14px 20px;
  border-radius:12px;

  background:#c62828;
  color:#fff;
  font-weight:800;
  font-size:20px;
  text-align:center;

  border:0;
  cursor:pointer;
  box-shadow:0 12px 30px rgba(198,58,51,.25);
}

.btn-buy:active{
  transform:translateY(1px);
}

.desc {
  margin-top: 16px;
  white-space: pre-line;
  line-height: 1.6;
}

/* Nút xem thêm */
#load-more {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;

  padding: 8px 10px;
  border-radius: 8px;

  background: #fff;
  color: #d32f2f;
  font-size: 16px;
  font-weight: 300;

  border: 1.5px solid #d32f2f;             /* Viền trong */
  cursor: pointer;
  transition: all 0.2s ease;
}

#load-more:hover {
  background: #fff5f5;
  box-shadow: 0 0 0 3px rgba(211,47,47,.35);
  transform: translateY(-1px);
}

/* Spinner */
.loader {
  border: 4px solid #eee;
  border-top: 4px solid #333;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.load-more-wrap {
  margin: 40px 0 55px;
  padding: 0 14px;
}

.load-more-btn {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;

  padding: 8px 10px;
  border-radius: 8px;

  background: #fff;
  color: #d32f2f;
  font-size: 16px;
  font-weight: 300;

  border: 1.5px solid #d32f2f;             /* Viền trong */
  cursor: pointer;
  transition: all 0.2s ease;
}

.load-more-btn:hover {
  background: #fff5f5;
  box-shadow: 0 0 0 3px rgba(211,47,47,.35);
  transform: translateY(-1px);
}

.load-more-btn:active {
  transform: scale(0.98);
}

.load-more-btn .arrow {
  font-size: 20px;
}

.load-more-btn.loading .arrow {
  transform: rotate(90deg);
}


 
/* SHARE BUTTONS */
.share-wrap{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:6px;
  margin-top:24px;
}
.share-btn{
  background:none;border:none;cursor:pointer;padding:0;
  width:62px;
  display:flex;flex-direction:column;align-items:center;
}
.share-icon{
  width:42px;
  height:42px;
  border-radius:50%;
  background:#f6f6f6;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 4px 10px rgba(0,0,0,.06);
}
.share-btn span{margin-top:6px;font-size:12px;color:#222}
.share-icon svg{
  width:38px;
  height:38px;
}
/* Facebook */
.share-icon.fb svg{ fill:#1877F2; }

/* Threads (đen) */
.share-icon.threads svg{ fill:#000000; }

/* X (Twitter mới) */
.share-icon.x svg{ fill:#000000; }

/* Blogger */
.share-icon.blogger svg{ fill:#FF5722; }

/* WordPress */
.share-icon.wp svg{ fill:#21759B; }

/* Messenger */
.share-icon.messenger svg{ fill:#0084FF; }

/* Zalo */
.share-icon.zalo svg{ fill:#0068FF; }

/* WhatsApp */
.share-icon.wa svg{ fill:#25D366; }

/* Copy buttons */
.share-icon.copy svg{ fill:#555; }


/* ===============================
   404 PAGE
================================ */

.page-404{
  text-align:center;
  padding:70px 20px 90px;
}

.error-code{
  font-size:52px;
  margin:0;
  color:#c62828;
  font-weight:800;
}

.error-title{
  font-size:20px;
  margin:10px 0 0;
  font-weight:600;
}

.error-desc{
  margin-top:10px;
  color:#777;
  line-height:1.6;
}




