/* Trang giảm giá (page-templates/sale.php) — màu & kích thước theo xixa.vn/sale (Web XIXA/public/css/styles.css:
   .page-hero, .sale-marquee, .flash-sale-bar, .sale-stock-bar, .sale-buy-now-btn) */
.gcb-sale { --fs-orange: #e44c0f; --fs-red: #ff4e50; }

/* Banner: tràn ngang, tỉ lệ ảnh 3810 × 688, nhiều ảnh thì mờ dần sang ảnh sau */
.gcb-sale-hero { position: relative; width: 100%; aspect-ratio: 3810 / 688; overflow: hidden; background: #f3ece4; }
.gcb-sale-hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.gcb-sale-hero__slide.is-active { opacity: 1; z-index: 1; }
.gcb-sale-hero__slide a { display: block; height: 100%; }
.gcb-sale-hero__img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Header đè lên banner (main.css): khung cao thêm đúng bằng header để chữ trên banner không bị che */
.gcb-overlay-header .gcb-sale-hero { aspect-ratio: auto; height: calc(100vw * 688 / 3810 + var(--gcb-header-h, 80px)); }

/* Dải chữ chạy nền cam, dính ngay dưới header khi cuộn */
.gcb-sale-mq { position: sticky; top: var(--gcb-top-h, 0px); z-index: 30; width: 100%; padding: 9px 0; overflow: hidden; background: var(--fs-orange); }
.gcb-sale-mq__track { display: flex; flex-wrap: nowrap; width: max-content; animation: gcb-sale-mq var(--mq-duration, 22.5s) linear infinite; will-change: transform; }
.gcb-sale-mq__group { display: flex; flex: 0 0 auto; align-items: center; gap: 24px; padding-right: 24px; }
.gcb-sale-mq__group > * { flex: 0 0 auto; }
.gcb-sale-mq__logo { display: block; width: 94px; height: 22px; object-fit: contain; }
.gcb-sale-mq__img2 { display: block; width: 31px; height: 34px; object-fit: contain; }
.gcb-sale-mq__img3 { display: block; width: 59px; height: 21px; object-fit: contain; }
.gcb-sale-mq__text { color: #fff; font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: .3px; white-space: nowrap; }
@keyframes gcb-sale-mq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .gcb-sale-mq__track { animation-duration: 60s; } }

.gcb-sale__body { padding-top: 28px; padding-bottom: 20px; }

/* Thanh XIXA FLASH SALE + đồng hồ */
.gcb-fs-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px; border-radius: 12px; background: var(--fs-orange); color: #fff; }
.gcb-fs-bar[hidden] { display: none; }
.gcb-fs-bar p { margin: 0; }
.gcb-fs-bar__title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; animation: gcb-fs-pulse 1.5s infinite; }
.gcb-fs-bar__title svg { width: 20px; height: 20px; fill: #fff; }
.gcb-fs-bar__clock { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.gcb-fs-bar__clock b { min-width: 30px; padding: 3px 0; border-radius: 6px; background: rgba(0, 0, 0, .18); font-size: 15px; text-align: center; font-variant-numeric: tabular-nums; }
@keyframes gcb-fs-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }

/* Lưới sản phẩm flash */
.gcb-fs { margin: 20px 0 40px; }
.gcb-fs[hidden] { display: none; }
.gcb-fs__title { display: flex; align-items: center; gap: 6px; margin: 0 0 20px; padding-left: 12px; border-left: 4px solid var(--fs-orange); color: var(--fs-red); font-size: 20px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.gcb-fs__title--plain { color: var(--gcb-ink); }
.gcb-fs__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 20px; }
@media (max-width: 1024px) { .gcb-fs__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .gcb-fs__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; } }

.gcb-fcard { display: flex; flex-direction: column; min-width: 0; }
.gcb-fcard[hidden] { display: none; }
.gcb-fcard__media { position: relative; display: block; overflow: hidden; border-radius: 16px; background: var(--gcb-soft, #f6f6f6); aspect-ratio: 1; }
.gcb-fcard__img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gcb-fcard__media:hover .gcb-fcard__img { transform: scale(1.04); }
.gcb-fcard__tag { position: absolute; top: 10px; left: 10px; z-index: 2; padding: 3px 6px; border-radius: 4px; background: var(--fs-orange); color: #fff; font-size: 10px; font-weight: 800; }
.gcb-fcard__off { position: absolute; right: 8px; bottom: 8px; z-index: 2; padding: 4px 8px; border-radius: 4px; background: var(--fs-orange); color: #fff; font-size: 11px; font-weight: 800; }
.gcb-fcard__sw { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; }
.gcb-fcard__sw a { width: 34px; height: 34px; overflow: hidden; border: 1.5px solid transparent; border-radius: 8px; background: var(--gcb-soft, #f6f6f6); }
.gcb-fcard__sw a.is-active { border-color: var(--gcb-green-2, #6abf3a); }
.gcb-fcard__sw img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gcb-fcard__sw span { font-size: 12px; color: var(--gcb-muted); }
.gcb-fcard__name { margin: 10px 0 0; font-size: 15px; font-weight: 500; line-height: 1.4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gcb-fcard__name a { color: inherit; }
.gcb-fcard__price { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin: 6px 0 0; }
.gcb-fcard__now { color: var(--fs-red); font-size: 18px; font-weight: 800; }
.gcb-fcard__price del { color: var(--gcb-muted); font-size: 14px; }
/* Thanh “Đã bán” kiểu Shopee */
.gcb-fcard__bar { position: relative; display: flex; align-items: center; justify-content: center; height: 14px; margin: 8px 0 12px; overflow: hidden; border-radius: 10px; background: #ffe3e3; }
.gcb-fcard__bar i { position: absolute; top: 0; left: 0; height: 100%; border-radius: 10px; background: var(--fs-orange); }
.gcb-fcard__bar span { position: relative; z-index: 1; color: var(--fs-red); font-size: 9.5px; font-weight: 700; }
.gcb-fcard__buy { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: auto; padding: 9px 12px; border: 0; border-radius: 8px; background: var(--fs-orange); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .2s, transform .2s; }
.gcb-fcard__buy svg { flex: none; width: 16px; height: 16px; }
.gcb-fcard__buy:hover { background: #c93f08; transform: translateY(-2px); }

.gcb-fs__more { display: flex; justify-content: center; margin-top: 28px; }
.gcb-fs__more-btn { padding: 12px 40px; border: 1px solid var(--fs-orange); border-radius: 30px; background: var(--fs-orange); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.gcb-fs__more-btn:hover { border-color: #e07b00; background: #e07b00; }

/* Bài viết SEO cuối trang */
.gcb-sale-seo { margin: 40px 0 20px; padding-top: 28px; border-top: 1px solid var(--gcb-line, #eee); }
.gcb-sale-seo__body { position: relative; max-height: 260px; overflow: hidden; }
.gcb-sale-seo__body::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(rgba(255, 255, 255, 0), #fff); }
.gcb-sale-seo__body.is-open { max-height: none; }
.gcb-sale-seo__body.is-open::after { display: none; }
.gcb-sale-seo__more { display: block; margin: 16px auto 0; padding: 10px 36px; border: 1px solid var(--gcb-line, #ddd); border-radius: 30px; background: #fff; color: var(--gcb-green); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.gcb-sale-seo__more[hidden] { display: none; }

@media (max-width: 768px) {
	.gcb-sale-mq { padding: 7px 0; }
	.gcb-sale-mq__group { gap: 16px; padding-right: 16px; }
	.gcb-sale-mq__logo { width: 73px; height: 17px; }
	.gcb-sale-mq__img2 { width: 25px; height: 27px; }
	.gcb-sale-mq__img3 { width: 45px; height: 16px; }
	.gcb-sale-mq__text { font-size: 20px; }
	.gcb-fs-bar { padding: 12px 16px; }
	.gcb-fcard__now { font-size: 16px; }
	.gcb-fcard__price { flex-wrap: wrap; }
	.gcb-fcard__price del { font-size: 12.5px; }
}
