/* ==========================================================================
   GIALOP.VN — Lớp chuẩn hoá giao diện
   Nạp sau cùng (priority 99, inc/core/enqueue.php) để đưa CSS riêng của từng
   trang về cùng một bộ token trong core/theme.css:
     1. Màu riêng của từng trang → màu thương hiệu
     2. Chữ: Be Vietnam Pro, chữ đứng, H1 40–52px, H2 28–36px, body 15–16px
     3. Khoảng cách section: 72–96px desktop, 48–56px mobile
     4. Nút, ô nhập, ô tìm, bộ lọc: bo 8px, không bóng phát sáng
     5. Thẻ: bo 12px, bóng nhẹ, không nhấc khi rê chuột
     6. Ảnh sản phẩm: khung 1:1, nền xám sáng
     7. Banner: lớp tối chuyển màu nhẹ, khung ảnh demo khi chưa có ảnh
   Phần lớn quy tắc có tiền tố :root để thắng bộ chọn hai lớp của CSS trang.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Màu riêng của từng trang → token chung
   -------------------------------------------------------------------------- */
:root {
	/* Tin tức */
	--nw-navy: var(--gl-navy);
	--nw-deep: var(--gl-navy-d);
	--nw-blue: var(--gl-navy);
	--nw-yellow: var(--gl-yellow);
	--nw-line: var(--gl-line);
	--nw-muted: var(--gl-muted);
	/* Rửa xe */
	--rx-blue: var(--gl-navy);
	--rx-blue-d: var(--gl-navy-d);
	--rx-blue-l: var(--gl-navy-l);
	--rx-deep: var(--gl-navy-d);
	--rx-deep-2: var(--gl-navy);
	/* Bảo dưỡng */
	--bd-green: var(--gl-navy);
	--bd-green-d: var(--gl-navy-d);
	--bd-green-l: var(--gl-navy-l);
	--bd-ink: var(--gl-navy-d);
	/* Dịch vụ tận nơi (giữ màu đỏ SOS) */
	--tn-ink: var(--gl-navy-d);
	--tn-ink-2: var(--gl-navy);
	--tn-orange: var(--gl-yellow);
	--tn-orange-d: var(--gl-yellow-d);
	--tn-orange-l: var(--gl-navy-l);
	/* Thu cũ đổi mới */
	--td-paper: var(--gl-bg-soft);
}

.pb-page {
	--pb-navy: var(--gl-navy);
	--pb-blue: var(--gl-navy);
	--pb-yellow: var(--gl-yellow);
	--pb-text: var(--gl-navy-d);
	--pb-muted: var(--gl-muted);
	--pb-line: var(--gl-line);
	--pb-soft: var(--gl-bg-soft);
}

.pt-page {
	--pt-navy: var(--gl-navy);
	--pt-blue: var(--gl-navy);
	--pt-ink: var(--gl-navy-d);
	--pt-muted: var(--gl-muted);
	--pt-yellow: var(--gl-yellow);
}

.tl-page {
	--tl-blue: var(--gl-navy);
	--tl-blue-d: var(--gl-navy-d);
	--tl-soft: var(--gl-bg-soft);
	--tl-line: var(--gl-line);
	--tl-ink: var(--gl-navy-d);
}

/* Trang Lốp theo nhu cầu (khác bộ --tn-* của Dịch vụ tận nơi ở :root). */
.tn-page {
	--tn-blue: var(--gl-navy);
	--tn-navy: var(--gl-navy);
	--tn-deep: var(--gl-navy-d);
	--tn-yellow: var(--gl-yellow);
	--tn-ink: var(--gl-navy-d);
	--tn-muted: var(--gl-muted);
	--tn-soft: var(--gl-bg-soft);
	--tn-line: var(--gl-line);
}

.ts-page {
	--ts-navy: var(--gl-navy);
	--ts-blue: var(--gl-navy);
	--ts-yellow: var(--gl-yellow);
	--ts-ink: var(--gl-navy-d);
	--ts-muted: var(--gl-muted);
	--ts-line: var(--gl-line);
}

.cv-page {
	--cv-navy: var(--gl-navy);
	--cv-yellow: var(--gl-yellow);
}

/* Nền section: phụ #F8F9FC, nhấn #1E3666. */
:root :is(.gl-section--cream, .pb-section--soft, .tb-section--soft, .tv-section--soft, .ts-section--soft, .tl-section--soft, .nw-section--soft) {
	background: var(--gl-bg-soft);
}

:root :is(.gl-section--navy, .tl-section--navy, .ts-section--navy, .ts-section--black) {
	background: var(--gl-navy);
}

/* --------------------------------------------------------------------------
   2. Chữ
   -------------------------------------------------------------------------- */
body {
	font-family: var(--gl-font);
	font-size: 16px;
	line-height: 1.6;
}

/* Tiêu đề luôn đứng; phần nhấn trong tiêu đề là dòng phụ thanh mảnh hơn. */
:root :is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--gl-font-head);
	font-style: normal;
}

:root :is(h1, h2, h3, h4, [class*="__title"]) :is(em, i) {
	font-style: normal;
	font-weight: 400;
	color: inherit;
}

/* H1 — 40–52px desktop, 32px trên điện thoại hẹp để không tràn dòng. */
:root :is(
	h1,
	.gl-hero__title,
	.gl-hero2__title,
	.gl-phead__title,
	.gl-bkhero__title,
	.gl-svhero__title,
	.lx-pagehero__title,
	.lx-cat__title,
	.rx-hero__title,
	.td-hero__title,
	.tn-hero__title,
	.bd-hero__title,
	.tb-hero__title,
	.tl-hero__title,
	.tv-hero__title
) {
	font-size: clamp(32px, 2.6vw + 18px, 52px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -.02em;
	text-transform: none;
}

:root :is(.gl-hero__title, .gl-svhero__title, .rx-hero__title, .td-hero__title, .tn-hero__title, .bd-hero__title, .tb-hero__title, .tl-hero__title, .tv-hero__title) :is(span, small) {
	font-weight: 400;
	color: inherit;
}

/* Tên sản phẩm và tiêu đề bài viết dài: cỡ vừa. */
:root :is(.gl-pdp__title, .gl-pdinfo__title) {
	font-size: clamp(24px, 1vw + 18px, 32px);
	font-weight: 700;
	text-transform: none;
}

:root .single-post .lx-pagehero__title {
	font-size: clamp(28px, 1.4vw + 18px, 40px);
}

/* H2 — 28–36px desktop. */
:root :is(
	.gl-h2,
	.pt-section__title,
	.td-section-head h2,
	.tl-section-head h2,
	.pb-section h2,
	.tb-section h2,
	.tv-section h2,
	.ts-section h2,
	.nw-section h2,
	.tn-section h2,
	.gl-svcta__title,
	.bd-cta__title,
	.rx-cta__title,
	.tl-cta__title,
	.tn-cta__title,
	.tv-cta__title,
	.tb-cta__title
) {
	font-size: clamp(26px, 1.2vw + 18px, 36px);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.01em;
	text-transform: none;
}

/* H3 — đứng, đậm vừa (giữ cỡ của từng thẻ). */
:root h3 {
	font-weight: 600;
}

/* Thẻ nội dung của trang hãng dùng kiểu đứng như bản thiết kế. */
.pb-page h2 {
	font-weight: 700;
}

.gl-lede {
	font-size: 16px;
	line-height: 1.6;
}

/* Giá chính */
.gl-buy__amount,
.gl-sum__price,
.gl-plan__price,
.bd-combo__price,
.rx-ticket__price {
	font-family: var(--gl-font-head);
	font-size: 28px;
	font-weight: 700;
}

/* Giá phụ (thẻ, thanh dính) */
.gl-card__now,
.gl-sticky__price,
.gl-bkbar__price,
.gl-cmp__price,
.gl-qprice__main,
.rx-row__price,
.rx-table__price,
.bd-part__price,
.bd-item__price,
.bd-oil__now,
.tn-svc__price,
.td-grade__price b {
	font-family: var(--gl-font-head);
	font-weight: 700;
}

/* Nhãn nhỏ */
.gl-eyebrow,
.gl-hero2__eyebrow,
.gl-bkhero__eyebrow,
.gl-panel__eyebrow,
.gl-sum__eyebrow,
.gl-info__eyebrow,
.gl-pdinfo__eyebrow,
.gl-svhero__eyebrow,
.bd-hero__eyebrow,
.bd-hero-booking__eyebrow,
.td-hero__eyebrow,
.td-form__eyebrow,
.gl-field__label,
.gl-filter__row .gl-field__label,
.td-form__grid .gl-field__label,
.gl-block__label,
.gl-bkbar__label,
.gl-sum__totlabel,
.gl-sum__quotelabel,
.gl-qprice__label,
.gl-qnote__label,
.gl-pdstate__label,
.gl-quotebar__label,
.gl-savebar__label,
.gl-buy__label,
.gl-active__label,
.gl-sort__label,
.gl-tray__label,
.gl-tray2__label,
.gl-svstats__label,
.bd-stat__label,
.bd-step__label,
.rx-hour__label,
.tn-call__label,
.td-estimate__label {
	font-family: var(--gl-font);
	font-size: 13px;
	font-weight: 600;
}

/* Chú thích: chữ đứng, nhạt màu. */
.gl-note,
.tn-note,
.gl-buy__note,
.gl-sum__note,
.gl-sum__quotenote,
.gl-qprice__note,
.gl-qnote__text,
.gl-pdstate__note,
.gl-listhead__note,
.gl-gal__note,
.gl-pricing__note,
.gl-intro__note,
.bd-intro__note,
.bd-result__note,
.rx-intro__note,
.rx-clock__note,
.tn-eta__note,
.td-estimate__note {
	font-family: var(--gl-font);
	font-size: 15px;
	font-weight: 400;
	font-style: normal;
}

:root .nw-post h3,
:root .bd-spec__soft {
	font-style: normal;
}

/* --------------------------------------------------------------------------
   3. Khoảng cách section
   -------------------------------------------------------------------------- */
:root :is(.gl-section, .pb-section, .tb-section, .tv-section, .ts-section, .tl-section, .td-section, .tn-section, .nw-section, .pt-page .pt-section) {
	padding-block: var(--gl-section-y) !important;
}

:root .gl-section--tight {
	padding-block: var(--gl-section-y-tight) !important;
}

/* --------------------------------------------------------------------------
   4. Nút, ô nhập, ô tìm, bộ lọc
   -------------------------------------------------------------------------- */
:root :is(
	.gl-btn,
	.tv-btn,
	.tn-button,
	.cv-button,
	.pt-button,
	.td-btn-ghost,
	.tb-btn--light,
	.lca-button,
	[class*="-btn"]:is(a, button):not([class*="close"]):not([class*="nav"]):not([class*="arrow"]):not([class*="burger"]):not([class*="icon"]),
	[class*="-button"]:is(a, button):not([class*="close"]):not([class*="nav"]):not([class*="arrow"]):not([class*="burger"]):not([class*="icon"])
) {
	border-radius: var(--gl-radius-sm) !important;
	box-shadow: none !important;
}

:root :is(.gl-btn, .tv-btn, .tn-button, .cv-button, .pt-button, .lca-button) {
	min-height: 44px;
	font-weight: 600;
}

:root :is(.gl-btn, .tv-btn, .tn-button, .cv-button, .pt-button, .lca-button, [class*="-btn"], [class*="-button"]):hover {
	transform: none !important;
}

:root :is(
	input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="file"]):not([type="color"]),
	select,
	textarea,
	.gc-search,
	.gl-search
) {
	border-radius: var(--gl-radius-sm) !important;
}

:root :is(
	input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="file"]):not([type="color"]),
	select,
	textarea
):focus {
	border-color: var(--gl-navy);
}

/* --------------------------------------------------------------------------
   5. Thẻ và khối nội dung
   -------------------------------------------------------------------------- */
:root :is(
	.gl-card,
	.gl-qcard,
	.gl-pp-card,
	.gl-svcard,
	.gc-product-card,
	.gc-other-card,
	.gc-knowledge-card,
	.gc-filter,
	.gl-panel,
	.gl-sum,
	.lca-card,
	.tl-card,
	.tl-find-card,
	.tn-card,
	.pt-article-card,
	.pt-category-card,
	.ts-feature-card,
	.ts-info-card,
	.ts-knowledge-card,
	.ts-way-card,
	.cv-card,
	.cv-brand-card,
	.cv-need-card,
	.cv-recommend-card,
	.cv-size-card
) {
	border-radius: var(--gl-radius) !important;
	box-shadow: var(--gl-shadow) !important;
}

:root :is(
	.gl-card,
	.gl-qcard,
	.gl-pp-card,
	.gl-svcard,
	.gc-product-card,
	.gc-other-card,
	.gc-knowledge-card,
	.tl-card,
	.tn-card,
	.pt-article-card,
	.pt-category-card,
	.ts-feature-card,
	.ts-info-card,
	.ts-knowledge-card,
	.ts-way-card,
	.cv-card,
	.cv-brand-card,
	.cv-need-card,
	.cv-recommend-card,
	.cv-size-card
):hover {
	transform: none !important;
	box-shadow: var(--gl-shadow) !important;
}

/* Bỏ trang trí: nhịp nhấp nháy, hoạ tiết lưới và quầng sáng của banner Dịch vụ tận nơi. */
:root .tn-hero__pulse,
:root .tn-hero__pulse::before,
:root .tn-hero__pulse::after {
	animation: none !important;
}

:root .tn-hero--has-background::after {
	display: none;
}

:root .tn-hero:not(.tn-hero--has-background)::before {
	display: none;
}

/* --------------------------------------------------------------------------
   6. Ảnh sản phẩm: khung 1:1, nền xám sáng
   -------------------------------------------------------------------------- */
:root :is(
	.gl-card__media,
	.gc-product-card__media,
	.gc-other-card__media,
	.tl-card__media,
	.gl-bkprod .gl-ph,
	.gl-sum__thumb .gl-ph
) {
	aspect-ratio: 1 / 1;
	background: var(--gl-img-bg);
}

:root :is(.gl-card__media, .gc-product-card__media, .gc-other-card__media, .tl-card__media) img {
	width: 100%;
	height: 100%;
	aspect-ratio: 1 / 1;
	object-fit: contain;
}

:root :is(.gl-gal__stage, .pb-tire, .pb-product__tire, .tl-tire) {
	background: var(--gl-img-bg);
}

/* --------------------------------------------------------------------------
   7. Banner
   -------------------------------------------------------------------------- */
/* Một lớp tối chuyển màu nhẹ ở phía có chữ cho mọi banner có ảnh nền.
   Phần tử giả (::before) không đặt được trong :is() nên liệt kê riêng. */
:root .gl-hero__veil,
:root .gl-svhero__veil,
:root .rx-hero__veil,
:root .ts-hero--has-background::before,
:root .tn-hero--has-background::before {
	background: linear-gradient(90deg, rgba(14, 26, 50, .74) 0%, rgba(14, 26, 50, .48) 50%, rgba(14, 26, 50, .12) 100%) !important;
}

@media (max-width: 768px) {
	:root .gl-hero__veil,
	:root .gl-svhero__veil,
	:root .rx-hero__veil,
	:root .ts-hero--has-background::before,
	:root .tn-hero--has-background::before {
		background: rgba(14, 26, 50, .62) !important;
	}
}

/* Banner gọn: bỏ dải USP, huy hiệu và chỉ số phụ. */
:root :is(.gl-svhero__usp, .bd-hero__stats, .rx-hero__badge, .tn-hero__badge, .tl-hero__badge) {
	display: none !important;
}

/* Khung ảnh demo khi banner chưa có ảnh nền: thay bằng ảnh thực tế ô tô, lốp, garage. */
:root :is(
	.gl-hero:not(:has(.gl-hero__bg)),
	.gl-svhero:not(:has(.gl-svhero__bg)),
	.rx-hero:not(:has(.rx-hero__bg)),
	.tn-hero:not(.tn-hero--has-background),
	.ts-hero:not(.ts-hero--has-background)
) {
	position: relative;
	background: var(--gl-navy-d);
}

:root :is(
	.gl-hero:not(:has(.gl-hero__bg)),
	.gl-svhero:not(:has(.gl-svhero__bg)),
	.rx-hero:not(:has(.rx-hero__bg)),
	.tn-hero:not(.tn-hero--has-background),
	.ts-hero:not(.ts-hero--has-background)
)::after {
	content: "Khung ảnh banner 1920 × 720 · ảnh thực tế ô tô, lốp, garage";
	position: absolute;
	inset: 14px;
	z-index: 0;
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	width: auto;
	height: auto;
	padding: 10px 14px;
	border: 1.5px dashed rgba(255, 255, 255, .26);
	border-radius: var(--gl-radius);
	background: none;
	color: rgba(255, 255, 255, .5);
	font-size: 12px;
	font-weight: 500;
	filter: none;
	opacity: 1;
	transform: none;
	animation: none;
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
	body {
		font-size: 15px;
	}

	.gl-buy__amount,
	.gl-sum__price,
	.gl-plan__price,
	.bd-combo__price,
	.rx-ticket__price {
		font-size: 24px;
	}

	.gl-eyebrow,
	.gl-hero2__eyebrow,
	.gl-bkhero__eyebrow,
	.gl-panel__eyebrow,
	.gl-sum__eyebrow,
	.gl-info__eyebrow,
	.gl-pdinfo__eyebrow,
	.gl-svhero__eyebrow,
	.bd-hero__eyebrow,
	.bd-hero-booking__eyebrow,
	.td-hero__eyebrow,
	.td-form__eyebrow,
	.gl-field__label,
	.gl-filter__row .gl-field__label,
	.td-form__grid .gl-field__label,
	.gl-block__label,
	.gl-bkbar__label,
	.gl-sum__totlabel,
	.gl-sum__quotelabel,
	.gl-qprice__label,
	.gl-qnote__label,
	.gl-pdstate__label,
	.gl-quotebar__label,
	.gl-savebar__label,
	.gl-buy__label,
	.gl-active__label,
	.gl-sort__label,
	.gl-tray__label,
	.gl-tray2__label,
	.gl-svstats__label,
	.bd-stat__label,
	.bd-step__label,
	.rx-hour__label,
	.tn-call__label,
	.td-estimate__label {
		font-size: 12px;
	}

	.gl-note,
	.tn-note,
	.gl-buy__note,
	.gl-sum__note,
	.gl-sum__quotenote,
	.gl-qprice__note,
	.gl-qnote__text,
	.gl-pdstate__note,
	.gl-listhead__note,
	.gl-gal__note,
	.gl-pricing__note,
	.gl-intro__note,
	.bd-intro__note,
	.bd-result__note,
	.rx-intro__note,
	.rx-clock__note,
	.tn-eta__note,
	.td-estimate__note {
		font-size: 14px;
	}
}
