/*
 * Phân Phối Bản Quyền — CSS custom.
 *
 * Quy ước (.claude/rules/06-frontend.md):
 * - Class prefix .ppbq-, BEM nhẹ: .ppbq-block__element--modifier
 * - Mobile-first, breakpoint 767px / 1024px theo Kadence
 * - Dùng CSS custom property của Kadence (--global-palette*) cho màu
 * - KHÔNG dùng !important để đè Kadence
 */

/* Ẩn khỏi màn hình nhưng vẫn đọc được bằng screen reader. */
.ppbq-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ==========================================================================
   Thẻ sản phẩm trong danh sách (PPBQ-024)
   Số cột và breakpoint do Kadence quản lý — xem docs/DECISIONS.md ADR-009.
   Phần dưới chỉ lo phần bên trong thẻ: chiều cao đều nhau và nút luôn ở đáy.
   ========================================================================== */

.woocommerce ul.products li.product.ppbq-product-card {
	display: flex;
	flex-direction: column;
}

.ppbq-product-card .woocommerce-loop-product__title {
	/* Tên sản phẩm dài không được đẩy nút xuống lệch so với thẻ bên cạnh. */
	flex-grow: 1;
	overflow-wrap: anywhere;
}

.ppbq-product-card .button {
	margin-top: auto;
	align-self: flex-start;
}

.ppbq-price-quote {
	font-weight: 600;
}

/* ==========================================================================
   Form nhận báo giá (PPBQ-022)
   ========================================================================== */

.ppbq-quote-form {
	margin: 1.5rem 0;
	padding: 1.25rem;
	border: 1px solid var(--global-gray-400, #d8d8d8);
	border-radius: 4px;
	background: var(--global-palette9, #fbfbfb);
}

.ppbq-quote-form__title {
	margin-top: 0;
	font-size: 1.15rem;
}

.ppbq-quote-form__intro {
	margin-bottom: 1rem;
}

.ppbq-quote-form__contact {
	margin: 0.5rem 0 0;
	padding-left: 1.1rem;
}

.ppbq-quote-form__admin-note {
	margin-top: 1rem;
	padding-top: 0.75rem;
	border-top: 1px dashed var(--global-gray-400, #d8d8d8);
	font-size: 0.85rem;
	opacity: 0.8;
}

/* ==========================================================================
   Tab thông số bản quyền (PPBQ-025)
   ========================================================================== */

.ppbq-license-specs__table {
	width: 100%;
	border-collapse: collapse;
}

.ppbq-license-specs__table th,
.ppbq-license-specs__table td {
	padding: 0.6rem 0.75rem;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--global-gray-400, #e5e5e5);
}

.ppbq-license-specs__table th {
	width: 40%;
	font-weight: 600;
}

.ppbq-license-specs__datasheet {
	margin-top: 1rem;
}

/* ==========================================================================
   Widget sản phẩm cùng hãng (PPBQ-026)
   ========================================================================== */

.ppbq-same-brand__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ppbq-same-brand__item {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--global-gray-400, #e5e5e5);
}

.ppbq-same-brand__item:last-child {
	border-bottom: 0;
}

.ppbq-same-brand__link {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	text-decoration: none;
}

.ppbq-same-brand__link img {
	flex: 0 0 48px;
	width: 48px;
	height: auto;
}

.ppbq-same-brand__price {
	font-size: 0.9rem;
}

/* Trên mobile, danh sách widget nằm dưới nội dung nên không cần thu gọn thêm. */
@media (min-width: 1024px) {
	.ppbq-same-brand__link img {
		flex-basis: 56px;
		width: 56px;
	}
}

/* ==========================================================================
   Nút liên hệ cố định — hotline + Zalo (PPBQ-032)
   Ràng buộc: KHÔNG che nội dung ở 375px (QA.md F4).
   ========================================================================== */

.ppbq-sticky-contact {
	position: fixed;
	right: 0.75rem;
	bottom: 0.75rem;
	z-index: 900;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.ppbq-sticky-contact__item {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.55rem 0.85rem;
	border-radius: 999px;
	background: var(--global-palette1, #1c5fd6);
	color: var(--global-palette9, #fff);
	font-size: 0.9rem;
	line-height: 1.2;
	text-decoration: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.ppbq-sticky-contact__item--zalo {
	background: var(--global-palette2, #0068ff);
}

.ppbq-sticky-contact__item:hover,
.ppbq-sticky-contact__item:focus-visible {
	color: var(--global-palette9, #fff);
	text-decoration: none;
	filter: brightness(1.08);
}

.ppbq-sticky-contact__item:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ppbq-sticky-contact__icon {
	font-size: 1rem;
}

/*
 * Trên màn hình hẹp chỉ hiện biểu tượng: nhãn chữ chiếm ngang màn hình và
 * che mất nội dung sản phẩm. aria-label trên thẻ <a> vẫn mô tả đầy đủ.
 */
@media (max-width: 767px) {
	.ppbq-sticky-contact__label {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.ppbq-sticky-contact__item {
		padding: 0.7rem;
	}

	.ppbq-sticky-contact__icon {
		font-size: 1.15rem;
	}
}

/* ==========================================================================
   Section trang chủ (PPBQ-028)
   Mobile-first. Breakpoint 768/1024 theo Kadence.
   ========================================================================== */

.ppbq-section {
	margin: 0 0 3rem;
}

.ppbq-section__header {
	margin-bottom: 1.25rem;
}

.ppbq-section__title {
	margin: 0 0 0.35rem;
}

.ppbq-section__subtitle {
	margin: 0;
	opacity: 0.85;
}

.ppbq-section__more {
	margin-top: 1.25rem;
}

/* --- Lưới dùng chung ------------------------------------------------------ */

.ppbq-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.ppbq-grid--3,
	.ppbq-grid--4,
	.ppbq-grid--6 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.ppbq-grid--3 { grid-template-columns: repeat(3, 1fr); }
	.ppbq-grid--4 { grid-template-columns: repeat(4, 1fr); }
	.ppbq-grid--6 { grid-template-columns: repeat(6, 1fr); }
}

/* --- Nút dùng chung ------------------------------------------------------- */

.ppbq-button {
	display: inline-block;
	padding: 0.55rem 1.1rem;
	border: 1px solid var(--global-palette1, #1c5fd6);
	border-radius: 4px;
	font-size: 0.95rem;
	line-height: 1.3;
	text-decoration: none;
}

.ppbq-button--primary {
	background: var(--global-palette1, #1c5fd6);
	color: var(--global-palette9, #fff);
}

.ppbq-button--ghost {
	background: transparent;
	color: var(--global-palette1, #1c5fd6);
}

.ppbq-button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* --- Hero ----------------------------------------------------------------- */

.ppbq-hero {
	padding: 2rem 0;
	text-align: center;
}

.ppbq-hero__subtitle {
	max-width: 42rem;
	margin: 0 auto 1.25rem;
}

.ppbq-hero__search {
	max-width: 32rem;
	margin: 0 auto 1.25rem;
}

.ppbq-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	justify-content: center;
}

/* --- Danh mục ------------------------------------------------------------- */

.ppbq-category-list__link {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 1rem;
	border: 1px solid var(--global-gray-400, #e5e5e5);
	border-radius: 4px;
	text-decoration: none;
}

.ppbq-category-list__name {
	font-weight: 600;
}

.ppbq-category-list__count {
	font-size: 0.85rem;
	opacity: 0.75;
}

/* --- Thẻ sản phẩm dùng chung ---------------------------------------------- */

.ppbq-card {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	height: 100%;
}

.ppbq-card__thumb img {
	width: 100%;
	height: auto;
}

.ppbq-card__title {
	flex-grow: 1;
	margin: 0;
	font-size: 1rem;
	overflow-wrap: anywhere;
}

.ppbq-card__price {
	margin: 0;
	font-weight: 600;
}

.ppbq-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0;
}

/* --- Đối tác -------------------------------------------------------------- */

.ppbq-partner-grid__link {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 72px;
	padding: 0.75rem;
	border: 1px solid var(--global-gray-400, #e5e5e5);
	border-radius: 4px;
	text-align: center;
	text-decoration: none;
}

.ppbq-partner-grid__logo {
	max-width: 100%;
	height: auto;
}

.ppbq-partner-meta {
	margin-top: 2rem;
}

.ppbq-partner-meta__facts {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.35rem 1rem;
	margin: 0 0 1.5rem;
}

.ppbq-partner-meta__facts dt {
	font-weight: 600;
}

.ppbq-partner-meta__facts dd {
	margin: 0;
}

/* --- Cam kết / loại bản quyền / quy trình --------------------------------- */

.ppbq-commitments__item,
.ppbq-license-types__item,
.ppbq-process__step {
	padding: 1rem;
	border: 1px solid var(--global-gray-400, #e5e5e5);
	border-radius: 4px;
}

.ppbq-commitments__title,
.ppbq-license-types__title,
.ppbq-process__title {
	margin: 0 0 0.4rem;
	font-size: 1.05rem;
}

.ppbq-commitments__text,
.ppbq-license-types__text,
.ppbq-process__text {
	margin: 0;
	font-size: 0.95rem;
}

.ppbq-process {
	counter-reset: none;
}

.ppbq-process__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.8rem;
	height: 1.8rem;
	margin-bottom: 0.5rem;
	border-radius: 50%;
	background: var(--global-palette1, #1c5fd6);
	color: var(--global-palette9, #fff);
	font-weight: 700;
}

/* --- Blog ----------------------------------------------------------------- */

.ppbq-post-list__item {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.ppbq-post-list__thumb img {
	width: 100%;
	height: auto;
}

.ppbq-post-list__title {
	margin: 0;
	font-size: 1.05rem;
}

.ppbq-post-list__meta {
	margin: 0;
	font-size: 0.85rem;
	opacity: 0.75;
}

.ppbq-post-list__excerpt {
	margin: 0;
	font-size: 0.95rem;
}

/* --- FAQ ------------------------------------------------------------------ */

.ppbq-faq__item {
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--global-gray-400, #e5e5e5);
}

.ppbq-faq__question {
	cursor: pointer;
	font-weight: 600;
}

.ppbq-faq__question:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ppbq-faq__answer {
	padding-top: 0.6rem;
}

/* --- CTA ------------------------------------------------------------------ */

.ppbq-cta {
	padding: 2rem 1.25rem;
	border-radius: 6px;
	background: var(--global-palette8, #f2f5fa);
	text-align: center;
}

.ppbq-cta__title {
	margin-top: 0;
}

.ppbq-cta__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	justify-content: center;
	margin-bottom: 0;
}

/* ==========================================================================
   Modal "Gọi lại" (PPBQ-033) — dựa trên <dialog> gốc
   ========================================================================== */

.ppbq-modal {
	width: min(30rem, calc(100vw - 2rem));
	padding: 0;
	border: 0;
	border-radius: 6px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.ppbq-modal::backdrop {
	background: rgba(0, 0, 0, 0.5);
}

.ppbq-modal__inner {
	padding: 1.25rem;
}

.ppbq-modal__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
}

.ppbq-modal__title {
	margin: 0;
	font-size: 1.15rem;
}

.ppbq-modal__close {
	padding: 0 0.35rem;
	border: 0;
	background: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.ppbq-modal__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ppbq-modal__intro {
	margin: 0.5rem 0 1rem;
}

.ppbq-sticky-contact__item--callback {
	background: var(--global-palette3, #2f855a);
}

/* ==========================================================================
   Bản đồ nhúng (PPBQ-034)
   ========================================================================== */

.ppbq-map iframe {
	display: block;
	width: 100%;
	max-width: 100%;
}
