/* =====================================================================
   PAGE: TRANG CHỦ — chỉ tải ở front page (is_front_page)
   Gồm: hero + banner, lưới danh mục, flash sale, tiêu đề section, tab pills.
   Markup sinh bởi scripts dựng trang (class gv-*). Thẻ sản phẩm / thẻ bài viết
   nằm ở components/ (không viết lại ở đây).
   ===================================================================== */

/* ---- Hero + banner (CSS grid) ---- */
.gv-hero-grid { display: grid; grid-template-columns: 929fr 461fr; gap: 12px; align-items: stretch; }
.gv-hero-main { min-width: 0; border-radius: 12px; overflow: hidden; }
.gv-hero-main .slider-wrapper, .gv-hero-main .flickity-viewport { border-radius: 12px; }
.gv-hero-main .img, .gv-hero-main .img-inner { margin: 0; }
.gv-hero-main img { display: block; width: 100%; height: auto; }
.gv-hero-side { display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 12px; min-width: 0; }
.gv-hero-side img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; border-radius: 12px; }
.gv-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.gv-pair img { display: block; width: 100%; height: auto; border-radius: 12px; }

/* Desktop (hero có cột banner phụ): ảnh slider lấp đầy chiều cao bằng cột phụ */
@media (min-width: 850px) {
	.gv-hero-grid:not(.gv-hero-grid--one) .gv-hero-main, .gv-hero-grid:not(.gv-hero-grid--one) .gv-hero-main .slider-wrapper, .gv-hero-grid:not(.gv-hero-grid--one) .gv-hero-main .slider, .gv-hero-grid:not(.gv-hero-grid--one) .gv-hero-main .flickity-viewport, .gv-hero-grid:not(.gv-hero-grid--one) .gv-hero-main .flickity-slider, .gv-hero-grid:not(.gv-hero-grid--one) .gv-hero-main .slider > .img, .gv-hero-grid:not(.gv-hero-grid--one) .gv-hero-main .img-inner { height: 100% !important; }
	.gv-hero-grid:not(.gv-hero-grid--one) .gv-hero-main .slider > .img { margin-bottom: 0; }
	.gv-hero-grid:not(.gv-hero-grid--one) .gv-hero-main img { height: 100%; object-fit: cover; }
}

/* ---- Flash sale ---- */
.gv-flash { background: linear-gradient(90deg, var(--gv-primary-dark), var(--gv-primary)); border-radius: 14px; padding: 14px 16px 16px; }
.gv-flash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; color: var(--gv-white); }
.gv-flash-title { font-size: 22px; font-weight: 800; letter-spacing: .5px; color: var(--gv-yellow); }
/* Đếm ngược: mỗi đơn vị (ngày/giờ/phút/giây) là một ô bo tròn nền đen */
.gv-flash-head .ux-timer-text { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.gv-flash-head .ux-timer-text > span { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 5px 12px; border-radius: 99px; background: var(--gv-text); color: var(--gv-white); font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap; }
.gv-flash-head .ux-timer-text > span strong { margin: 0; font-size: 15px; font-weight: 800; color: var(--gv-white); }
.gv-flash-btn { display: inline-flex; align-items: center; gap: 2px; background: var(--gv-yellow); color: var(--gv-on-yellow); border-radius: 99px; padding: 6px 12px 6px 16px; font-size: 13px; font-weight: 700; }
.gv-flash-btn .gv-ico { color: var(--gv-on-yellow); font-size: 18px; }

/* ---- Tiêu đề section + tab pills ---- */
.section > .section-content > .row > .col { padding-bottom: 0; }
.gv-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--gv-border-soft); }
.gv-sec-head h2 { position: relative; margin: 0; padding-left: 16px; font-size: 24px; font-weight: 800 !important; letter-spacing: -.2px; color: var(--gv-text); text-transform: none; }
.gv-sec-head h2:before { content: ''; position: absolute; left: 0; top: 50%; width: 6px; height: 1.1em; transform: translateY(-50%); border-radius: 4px; background: linear-gradient(180deg, var(--gv-yellow), var(--gv-primary)); }
.gv-sec-head a { display: inline-flex; align-items: center; white-space: nowrap; padding: 6px 8px 6px 16px; border-radius: 99px; background: var(--gv-primary-soft); color: var(--gv-accent); font-size: 13px; font-weight: 700; transition: background .15s, color .15s; }
.gv-sec-head a:hover { background: var(--gv-primary); color: var(--gv-white); }
.gv-sec-head a .gv-ico { color: inherit; font-size: 18px; }
.tabbed-content .nav-pills { margin: 0 0 12px; }
.tabbed-content .tab-panels { padding: 0; }
.tabbed-content .tab-panels .panel { padding: 0; }
.nav-pills > li { margin-right: 8px; }
.nav-pills > li > a { border-radius: 99px; background: var(--gv-bg); color: var(--gv-text-2); font-size: 13px; font-weight: 500; text-transform: none; padding: 4px 14px; margin: 0; }
.nav-pills > li.active > a, .nav-pills > li > a:hover { background: var(--gv-primary); color: var(--gv-white); }

/* ---- Lưới danh mục nổi bật (shortcode [gv_category_grid], inc/home-sections.php) ---- */
.gv-cat-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; margin: 0 !important; padding: 0; list-style: none; }
.gv-cat-grid li { margin: 0; list-style: none; }
.gv-cat-grid a { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; padding: 12px 8px 10px; background: var(--gv-white); border: 1px solid var(--gv-border); border-radius: 12px; text-align: center; transition: border-color .15s, box-shadow .15s; }
.gv-cat-grid a:hover { border-color: var(--gv-primary); box-shadow: 0 4px 14px rgb(29 98 193 / 14%); }
.gv-cat-thumb { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 3; }
.gv-cat-thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.gv-cat-thumb .gv-cat-noimg { font-size: 40px; color: var(--gv-border-3); }
.gv-cat-name { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--gv-ink); }
.gv-cat-grid a:hover .gv-cat-name { color: var(--gv-accent); }
@media (max-width: 1023px) { .gv-cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---- Mobile / tablet ---- */
@media (max-width: 849px) {
	.gv-hero-grid { grid-template-columns: 1fr; }
	.gv-hero-side { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
	.gv-hero-side img { height: auto; aspect-ratio: 16 / 9; }
	.gv-pair { grid-template-columns: 1fr; }
	.gv-flash { padding: 12px; }
	.gv-flash-title { font-size: 18px; }
	/* Flash sale mobile: hàng 1 = tiêu đề + nút, hàng 2 = đếm ngược dàn đều */
	.gv-flash-head { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'title btn' 'timer timer'; align-items: center; gap: 10px 8px; margin-bottom: 10px; }
	.gv-flash-head > .gv-flash-title { grid-area: title; }
	.gv-flash-head > .gv-flash-btn { grid-area: btn; padding: 5px 8px 5px 14px; font-size: 12px; }
	.gv-flash-head > .ux-timer-text { grid-area: timer; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
	.gv-flash-head .ux-timer-text > span { justify-content: center; padding: 6px 4px; }
	.gv-flash-head .ux-timer-text > span { font-size: 12px; }
	.gv-flash-head .ux-timer-text > span strong { font-size: 13px; }
	.gv-sec-head h2 { font-size: 19px; padding-left: 13px; }
	.gv-sec-head h2:before { width: 5px; }
	.gv-sec-head a { padding: 5px 6px 5px 12px; font-size: 12px; }
	.nav-pills { overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; }
	.gv-cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
	.gv-cat-grid a { padding: 8px 4px 8px; gap: 4px; border-radius: 10px; }
	.gv-cat-name { font-size: 11px; }
}

/* Hero một cột (chỉ slider, không có banner phụ bên phải) */
.gv-hero-grid--one { grid-template-columns: minmax(0, 1fr); }

/* ---- Nền xám toàn trang + mỗi khối sản phẩm là một thẻ trắng bo góc (.gv-block) ---- */
.home #main, .home #wrapper { background: var(--gv-bg); }
.gv-block { padding: 16px 18px 18px; background: var(--gv-white); border: 1px solid var(--gv-border); border-radius: 14px; }
.gv-block .gv-child-cats { margin-bottom: 12px; }
@media (max-width: 849px) { .gv-block { padding: 12px; border-radius: 12px; } }
