/* Bổ sung cho giao diện V2 - không sửa style.css của template (ui-template-v2) để dễ cập nhật lại khi template đổi.
   CSS riêng từng trang đặt ở themes/v2/pages/<trang>.css, nạp qua @section Head của view. */

/* Template chỉ khai báo --mockup-* ở chế độ tối -> các khối dùng biến này (thông tin liên hệ) mất nền ở chế độ sáng */
:root:not([data-theme="dark"]) {
  --mockup-bg: #F1F6FD;
  --mockup-border: rgba(0, 161, 255, .22);
  --mockup-header: #E6F0FB;
  --mockup-text: #1E293B;
  --mockup-sub: #64748B;
}

/* Tiêu đề hero thống nhất mọi trang (người phụ trách yêu cầu 13/10/2026): desktop 2.25rem, tablet 1.875rem, mobile 1.625rem.
   Không ghi đè font-size hero-title trong pages/*.css để các trang giữ cùng cỡ */
.hero-title,
.hero-subpage .hero-title { font-size: 2.25rem; }
@media (max-width: 768px) {
  .hero-title,
  .hero-subpage .hero-title { font-size: 1.875rem; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 1.625rem; }
  .hero-subpage .hero-title { font-size: 1.5rem; }
}

/* Hero trang con trên mobile: gọn hơn template (72px/92px, mô tả 1.15rem) */
@media (max-width: 768px) {
  .hero-subpage { padding: 40px 0 44px; }
  .hero-subpage .hero-title { margin-bottom: 10px; }
  .hero-subpage .hero-desc { font-size: 1rem; line-height: 1.6; }
}
@media (max-width: 480px) {
  .hero-subpage { padding: 32px 0 36px; }
  .hero-subpage .hero-desc { font-size: .9375rem; }
}

/* FAQ: template giới hạn 300px, câu trả lời dài trên mobile bị cắt */
.faq-item.active .faq-answer { max-height: 1200px; }

/* Mũi tên nối thẻ .arch-card khi xếp dọc: template đặt right:50%/bottom:-22px nhưng không bỏ left, top:50% của desktop
   -> mũi tên lệch, đè lên viền thẻ. Khe 56px (template 36px, quá sát mũi tên 32px), tâm mũi tên đúng giữa khe, xoay xuống */
@media (max-width: 1024px) {
  .arch-grid { gap: 56px; }
  .arch-card:not(:last-child)::after { left: 50%; right: auto; top: calc(100% + 28px); bottom: auto; transform: translate(-50%, -50%) rotate(90deg); }
  .arch-card:hover:not(:last-child)::after { transform: translate(-50%, -50%) rotate(90deg) scale(1.1); }
}

/* Mũi tên nối thẻ .step-guide-card (3 bước đại lý): template đặt right:-24px trong khe 32px nên vòng tròn đè lên viền thẻ.
   Làm như .arch-card: khe 64px, mũi tên nằm chính giữa khe; xếp dọc thì nằm giữa khe dưới thẻ, xoay xuống */
.step-guide-grid { gap: 64px; }
.step-guide-card:not(:last-child)::after { left: calc(100% + 32px); right: auto; transform: translate(-50%, -50%); }
.step-guide-card:hover:not(:last-child)::after { transform: translate(-50%, -50%) scale(1.1); }
@media (max-width: 1024px) {
  .step-guide-grid { gap: 56px; max-width: 560px; margin-left: auto; margin-right: auto; }
  .step-guide-card:not(:last-child)::after { left: 50%; right: auto; top: calc(100% + 28px); bottom: auto; transform: translate(-50%, -50%) rotate(90deg); }
  .step-guide-card:hover:not(:last-child)::after { transform: translate(-50%, -50%) rotate(90deg) scale(1.1); }
}
@media (max-width: 480px) {
  .step-guide-card { padding: 28px 22px; }
}

/* Nút có chữ dài (vd. "Gọi tư vấn 0906 489 647") không được tràn ngang trên màn hẹp */
@media (max-width: 480px) {
  .btn { white-space: normal; text-align: center; }
}

/* Header: menu con (CMS) trong drawer mobile */
.cz-mobile-menu a.cz-mobile-sub { padding-left: 32px; font-size: .9375rem; opacity: .85; }

/* Footer */
.footer-contact { margin-top: 10px; font-size: .8125rem; color: var(--footer-text); }
.footer-contact a { color: inherit; }
.footer-contact strong { color: var(--footer-heading); }
.footer-contact strong.footer-hotline { color: var(--cz-blue-primary); }
.footer-address { font-size: .875rem; line-height: 1.6; color: var(--footer-text); margin-bottom: 8px; }
.footer-social { display: flex; gap: 8px; margin-top: 12px; }
.footer-social a { padding: 6px 12px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .06); color: var(--footer-heading); font-size: .8125rem; font-weight: 600; }
.footer-social a:hover { background: rgba(255, 255, 255, .12); }

/* Nút lên đầu trang: góc phải dưới cùng, ngay dưới bong bóng chat (widget đặt right 40px, bottom 10%, 60x60) - canh giữa theo bong bóng, cách 10px, tối thiểu 8px từ đáy */
.cz-scroll-top { position: fixed; right: 47px; bottom: max(8px, calc(10% - 56px)); z-index: 80; width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--cz-blue-primary); color: #fff; box-shadow: 0 6px 18px rgba(0, 161, 255, .35); cursor: pointer; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity var(--transition-normal), transform var(--transition-normal), background var(--transition-normal); }
.cz-scroll-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.cz-scroll-top:hover { background: var(--cz-blue-dark); }
.cz-scroll-top:focus-visible { outline: 2px solid var(--cz-blue-primary); outline-offset: 3px; }
/* Mobile: nút chat (chat.cloudzone.vn, tự chèn <style> theo id, mặc định 60px, right 40px, bottom 10%) và nút lên đầu trang
   thu nhỏ, sát viền phải, xếp dọc cùng trục để ít che nội dung. 'body #id' để thắng style của widget */
@media (max-width: 768px) {
  body #myChatWidgetButton { right: 12px; bottom: calc(68px + env(safe-area-inset-bottom, 0px)); width: 48px; height: 48px; box-shadow: 0 3px 8px rgba(0, 0, 0, .18); }
  .cz-scroll-top { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 40px; height: 40px; }
  .cz-scroll-top svg { width: 18px; height: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .cz-scroll-top { transition: none; }
}

/* Ảnh màn hình thật trong khung cửa sổ (partial _Screenshot) */
.cz-shot { overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--bg-card-border); background: var(--bg-card); box-shadow: var(--shadow-lg); }
.cz-shot-bar { display: flex; align-items: center; gap: 6px; padding: 9px 14px; border-bottom: 1px solid var(--bg-card-border); background: var(--bg-surface); }
.cz-shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); opacity: .35; }
.cz-shot-bar span { margin-left: 6px; font-family: var(--font-mono); font-size: .6875rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cz-shot img { display: block; width: 100%; height: auto; }

/* Class tiện ích chỉ áp dụng trên mobile (<=560px), gắn thêm vào phần tử cần gọn lại:
   m-btn-sm: nút nhỏ hơn (kể cả btn-lg) · m-btn-row: nhóm nút giữ 1 hàng, chia đều
   m-eyebrow-sm: nhãn eyebrow nhỏ · m-channel-sm: khối kênh liên hệ (icon, số điện thoại) gọn */
@media (max-width: 560px) {
  .btn.m-btn-sm { padding: 10px 16px; font-size: .9375rem; gap: 8px; }
  .btn.m-btn-sm svg { width: 16px; height: 16px; }
  .m-btn-row { display: flex; flex-wrap: nowrap; gap: 10px; }
  .m-btn-row > .btn { flex: 1 1 auto; width: auto; white-space: nowrap; }
  .eyebrow.m-eyebrow-sm { font-size: .6875rem; padding: 4px 10px; gap: 6px; }
  .eyebrow.m-eyebrow-sm::before { width: 6px; height: 6px; }
  .m-channel-sm .contact-channel-item { gap: 12px; margin-bottom: 18px; }
  .m-channel-sm .channel-icon { width: 38px; height: 38px; }
  .m-channel-sm .channel-icon svg { width: 18px; height: 18px; }
  .m-channel-sm .channel-label { font-size: .6875rem; }
  .m-channel-sm .channel-value { font-size: 1rem; }
  .m-channel-sm .channel-value.is-phone { font-size: 1.125rem; }
  .m-channel-sm .channel-links { gap: 12px; font-size: .8125rem; }
  .m-channel-sm .channel-text { font-size: .875rem; }
}

/* Breadcrumb dùng chung (partial Views/V2/Shared/_Breadcrumb.cshtml): khung pill, icon trang chủ, phân cách ›, mục hiện tại đậm và cắt … */
.cz-breadcrumb { max-width: 100%; margin-bottom: 18px; }
.cz-breadcrumb ol { display: inline-flex; flex-wrap: wrap; align-items: center; row-gap: 2px; max-width: 100%; margin: 0; padding: 4px 14px 4px 4px; list-style: none; border: 1px solid var(--bg-card-border); border-radius: var(--radius-full); background: var(--bg-card); box-shadow: 0 1px 3px rgba(15, 23, 42, .05); font-size: .8125rem; font-weight: 500; line-height: 1.4; color: var(--text-muted); }
.cz-breadcrumb li { display: inline-flex; align-items: center; min-width: 0; }
.cz-breadcrumb li + li::before { content: ''; flex-shrink: 0; width: 14px; height: 14px; margin: 0 4px; background-color: currentColor; opacity: .55; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.cz-breadcrumb a { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--radius-full); color: var(--text-body); transition: background var(--transition-fast), color var(--transition-fast); }
.cz-breadcrumb a:hover { background: var(--cz-blue-soft); color: var(--cz-blue-primary); }
.cz-breadcrumb-home svg { flex-shrink: 0; color: var(--cz-blue-primary); }
.cz-breadcrumb li > span { padding: 3px 2px; }
.cz-breadcrumb li.is-current > span { max-width: 42ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text-heading); }
@media (max-width: 560px) {
  .cz-breadcrumb ol { flex-wrap: nowrap; font-size: .75rem; padding-right: 12px; }
  .cz-breadcrumb li { flex: 0 1 auto; }
  .cz-breadcrumb a { min-width: 0; }
  .cz-breadcrumb a span, .cz-breadcrumb li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cz-breadcrumb-home { padding: 5px 8px; }
  .cz-breadcrumb-home span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cz-breadcrumb li.is-current { flex-shrink: 0; max-width: 45%; }
  .cz-breadcrumb li.is-current > span { max-width: 100%; }
}

/* Nền section xanh đậm có chấm lưới (tham khảo khối CTA tối): gắn thêm class section-dots-dark vào <section>.
   Chữ tiêu đề/ghi chú chuyển trắng; thẻ bên trong giữ nền --bg-card để nổi lên */
.section-dots-dark {
  position: relative;
  background-color: #0B4A8B;
  background-image:
    radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.6px),
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(0, 161, 255, .28) 0%, transparent 70%),
    linear-gradient(135deg, #0B56A3 0%, #0A4588 55%, #0A3A73 100%);
  background-size: 22px 22px, 100% 100%, 100% 100%;
}
.section-dots-dark .section-title { color: #FFFFFF; }
.section-dots-dark .section-subtitle, .section-dots-dark .home-note { color: rgba(226, 238, 255, .82); }
.section-dots-dark .eyebrow { color: #FFFFFF; background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .28); box-shadow: none; }
.section-dots-dark .eyebrow::before { background: #5EEAD4; }
.section-dots-dark .home-note svg { color: #5EEAD4; }
.section-dots-dark .arch-card,
.section-dots-dark .feature-card { border-color: rgba(255, 255, 255, .25); box-shadow: 0 12px 32px -8px rgba(2, 12, 32, .45); }
html[data-theme="dark"] .section-dots-dark {
  background-color: #081A33;
  background-image:
    radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.6px),
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(0, 161, 255, .18) 0%, transparent 70%),
    linear-gradient(135deg, #0B2747 0%, #081D38 55%, #06162B 100%);
}

/* Icon thẻ nhiều màu: mỗi thẻ trong lưới lấy 1 tông theo thứ tự (xoay vòng 6 màu) - nền nhạt + viền + icon cùng tông */
.features-grid > :nth-child(6n+1), .api-price-grid > :nth-child(6n+1), .home-audience-grid > :nth-child(6n+1), .ldl-gain-grid > :nth-child(6n+1) { --tone: #0A8BEB; --tone-dark: #38BDF8; --tone-rgb: 10, 139, 235; }
.features-grid > :nth-child(6n+2), .api-price-grid > :nth-child(6n+2), .home-audience-grid > :nth-child(6n+2), .ldl-gain-grid > :nth-child(6n+2) { --tone: #059669; --tone-dark: #34D399; --tone-rgb: 16, 185, 129; }
.features-grid > :nth-child(6n+3), .api-price-grid > :nth-child(6n+3), .home-audience-grid > :nth-child(6n+3), .ldl-gain-grid > :nth-child(6n+3) { --tone: #D97706; --tone-dark: #FBBF24; --tone-rgb: 245, 158, 11; }
.features-grid > :nth-child(6n+4), .api-price-grid > :nth-child(6n+4), .home-audience-grid > :nth-child(6n+4), .ldl-gain-grid > :nth-child(6n+4) { --tone: #7C3AED; --tone-dark: #A78BFA; --tone-rgb: 139, 92, 246; }
.features-grid > :nth-child(6n+5), .api-price-grid > :nth-child(6n+5), .home-audience-grid > :nth-child(6n+5), .ldl-gain-grid > :nth-child(6n+5) { --tone: #E11D48; --tone-dark: #FB7185; --tone-rgb: 244, 63, 94; }
.features-grid > :nth-child(6n+6), .api-price-grid > :nth-child(6n+6), .home-audience-grid > :nth-child(6n+6), .ldl-gain-grid > :nth-child(6n+6) { --tone: #0D9488; --tone-dark: #2DD4BF; --tone-rgb: 20, 184, 166; }
.features-grid .feature-icon-square, .api-price-grid .feature-icon-square, .home-audience-grid .feature-icon-square, .ldl-gain-grid .arch-icon-box { color: var(--tone, var(--cz-blue-primary)); background: rgba(var(--tone-rgb, 0, 161, 255), .1); border: 1px solid rgba(var(--tone-rgb, 0, 161, 255), .24); transition: all var(--transition-normal); }
.features-grid > :hover .feature-icon-square, .api-price-grid > :hover .feature-icon-square, .home-audience-grid > :hover .feature-icon-square, .ldl-gain-grid .arch-card:hover .arch-icon-box { background: var(--tone, var(--cz-blue-primary)); border-color: var(--tone, var(--cz-blue-primary)); color: #FFFFFF; }
html[data-theme="dark"] .features-grid .feature-icon-square, html[data-theme="dark"] .api-price-grid .feature-icon-square, html[data-theme="dark"] .home-audience-grid .feature-icon-square, html[data-theme="dark"] .ldl-gain-grid .arch-icon-box { color: var(--tone-dark, var(--tone)); background: rgba(var(--tone-rgb, 0, 161, 255), .14); }
