/* =============================================
   FRONTEND GÓI 5 — Additional sections + UI fixes
   (replaces previous frontend5.css)
   ============================================= */

/* ============ HERO CTA ============ */
.hero-cta {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-lg {
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
}
.btn-outline-light {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.45);
  text-decoration: none;
  border-radius: 8px;
}
.btn-outline-light:hover {
  background: rgba(255,255,255,0.22);
  color: #fff;
}

/* ============ TOP CATEGORIES ============ */
.top-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.top-cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: 10px;
  text-decoration: none;
  color: var(--n-900);
  transition: all .15s ease;
}
.top-cat-item:hover {
  border-color: var(--gold);
  background: #fff7e6;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(200, 160, 80, 0.15);
  color: var(--primary-700);
}
.top-cat-item .icon { font-size: 22px; flex-shrink: 0; }
.top-cat-item .info { flex: 1; min-width: 0; }
.top-cat-item .name { font-weight: 600; font-size: 14px; line-height: 1.3; margin-bottom: 2px; }
.top-cat-item .count { font-size: 11.5px; color: var(--n-500); }

/* ============ TESTIMONIALS ============ */
.testimonials-section {
  background: linear-gradient(180deg, transparent 0%, #fff7e6 50%, transparent 100%);
}
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.testimonial-card {
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all .15s ease;
}
.testimonial-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.testimonial-card .stars { font-size: 14px; margin-bottom: 8px; letter-spacing: 2px; }
.testimonial-card .content {
  font-size: 13.5px; line-height: 1.6; color: var(--n-700);
  margin: 0 0 14px; font-style: italic;
}
.testimonial-card .customer {
  display: flex; align-items: center; gap: 10px;
  padding-top: 12px; border-top: 1px dashed var(--n-200);
}
.testimonial-card .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0; background: var(--n-100);
}
.testimonial-card .avatar-letter {
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: #fff; font-weight: 700; font-size: 16px;
}
.testimonial-card .customer .info { flex: 1; min-width: 0; }
.testimonial-card .customer .name { font-weight: 700; font-size: 13px; color: var(--n-900); }
.testimonial-card .customer .title { font-size: 11.5px; color: var(--n-500); margin-top: 1px; }
.testimonial-card .customer .product { font-size: 11px; color: var(--gold-dark); margin-top: 1px; }

/* ============ WHY CHOOSE US ============ */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.why-item {
  text-align: center; padding: 22px 16px;
  background: #fff; border: 1px solid var(--n-200);
  border-radius: 12px; transition: all .15s ease;
}
.why-item:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(200, 160, 80, 0.12);
}
.why-item .icon { font-size: 40px; margin-bottom: 8px; }
.why-item h3 { font-size: 15px; color: var(--primary-700); margin: 0 0 8px; font-weight: 700; }
.why-item p { font-size: 13px; color: var(--n-600); line-height: 1.55; margin: 0; }

/* ============ BLOG PREVIEW ============ */
.blog-section { background: #fafaf7; }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.blog-card {
  background: #fff; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--n-200);
  text-decoration: none; color: inherit; display: block;
  transition: all .15s ease;
}
.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  border-color: var(--gold);
}
.blog-card .thumb {
  width: 100%; height: 150px; object-fit: cover;
  background: var(--n-100); display: block;
}
.blog-card .thumb-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-700));
  color: var(--gold-light);
}
.blog-card .body { padding: 12px 14px; }
.blog-card .body h3 {
  font-size: 14.5px; line-height: 1.35; color: var(--n-900);
  margin: 0 0 6px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card .excerpt {
  font-size: 12.5px; line-height: 1.5; color: var(--n-600);
  margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card .meta { display: flex; gap: 8px; font-size: 11px; color: var(--n-500); }

/* ============ STORE GRID ============ */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.store-card {
  background: #fff; border: 1px solid var(--n-200);
  border-radius: 10px; padding: 14px;
  transition: all .15s ease;
}
.store-card:hover {
  border-color: var(--gold);
  box-shadow: 0 6px 14px rgba(200,160,80,0.12);
}
.store-card .name { font-weight: 700; font-size: 14px; color: var(--primary-700); margin-bottom: 6px; }
.store-card .address { font-size: 12.5px; color: var(--n-600); line-height: 1.45; margin-bottom: 8px; }
.store-card .phone {
  display: inline-block; font-size: 13px; font-weight: 600;
  color: var(--success); text-decoration: none;
  padding: 4px 10px; background: #e8f5e9; border-radius: 12px;
}

/* ============ FIX: HIDE OLD FLOAT BUTTONS ============ */
/* Ẩn .float-contact cũ trong app.css để khỏi chồng */
.float-contact { display: none !important; }
/* Ẩn hết .float-btn riêng lẻ không thuộc .float-chat-stack */
body > .float-btn { display: none !important; }
body > a.float-btn { display: none !important; }

/* ============ FLOAT CHAT STACK ============ */
/* Desktop: hiện góc phải dưới */
.float-chat-stack {
  position: fixed;
  right: 14px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (min-width: 901px) {
  .float-chat-stack {
    bottom: 24px;
  }
  .float-chat-stack .float-btn {
    width: 52px; height: 52px;
    font-size: 22px;
  }
}
/* Mobile: ẨN HẲN vì đã có bottom-nav */
@media (max-width: 900px) {
  .float-chat-stack.desktop-only { display: none !important; }
}
.float-chat-stack .float-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  transition: transform .15s;
}
.float-chat-stack .float-btn:hover { transform: scale(1.08); color: #fff; }
.float-chat-stack .float-call { background: #16a34a; }
.float-chat-stack .float-zalo { background: #0068FF; font-weight: 700; }

/* ============ STOCK STATUS BADGE ============ */
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}
.stock-badge.in-stock {
  background: #d1fae5;
  color: #065f46;
}
.stock-badge.out-of-stock {
  background: #fee2e2;
  color: #991b1b;
}
.stock-badge.low-stock {
  background: #fef3c7;
  color: #92400e;
}

/* ============ MOBILE RESPONSIVE TWEAKS ============ */
@media (max-width: 900px) {
  .top-cat-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .why-item { padding: 14px 10px; }
  .why-item .icon { font-size: 32px; }
  .why-item h3 { font-size: 13.5px; }
  .why-item p { font-size: 12px; }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-card .thumb { height: 110px; }
  .blog-card .body h3 { font-size: 13px; }
  .store-grid { grid-template-columns: 1fr 1fr; }
  .store-card { padding: 10px; }
}

/* ============ PRODUCT CARD STOCK STATUS ============ */
.product-card.out-of-stock {
  opacity: 0.7;
  position: relative;
}
.product-card.out-of-stock .img-wrap {
  filter: grayscale(0.4);
}
.product-card .img-wrap {
  position: relative;
}
.stock-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  background: rgba(239, 68, 68, 0.92);
  color: white;
  font-weight: 700;
  font-size: 14px;
  padding: 5px 14px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 3;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ============ PRODUCT DETAIL: BUTTON DISABLED ============ */
.btn-buy-disabled {
  background: var(--n-200) !important;
  color: var(--n-500) !important;
  cursor: not-allowed !important;
  border: 1px solid var(--n-300) !important;
  pointer-events: none;
}

/* phase74fix: .section khong co max-width -> grid tran full man hinh desktop. Can giua 1200px (giong .container) */
.section {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 14px;
  padding-right: 14px;
  box-sizing: border-box;
}
@media (min-width: 768px) {
  .section { padding-left: 24px; padding-right: 24px; }
}
/* Hero banner van full-width nen (chi noi dung can giua) - khong gioi han */
.section.hero-banner { max-width: none; }

/* phase74fix3: gom 1 rule - moi khoi product detail (pd-section/explore/KH mua) can giua 1200, het tran */
.pd-section,
.pd-cats-explore,
.cp-section-product {
  max-width: 1200px;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}
@media (min-width: 641px) {
  .cp-item-overlay { opacity: 1 !important; }
}
