/**
 * IDN — Trang chi tiết sản phẩm (single product).
 * Tone màu theo --primary-color (#2496ea). Font Lexend kế thừa từ body.
 * Khối: 1) Gallery + Thông tin · 2) Mô tả sản phẩm · 3) Sản phẩm liên quan.
 */

.idn-product {
	--idn-pc: var(--primary-color, #2496ea);
	--idn-ink: #1f2a37;
	--idn-muted: #8a94a6;
	--idn-line: #e6eaf0;
	--idn-soft: #f5f7fa;
}
.idn-product__wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 20px 60px;
}

/* =========================================================
 * KHỐI 1 — Gallery + Thông tin
 * ====================================================== */
.idn-product__top {
	display: grid;
	grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
	gap: 40px;
	align-items: start;
}

/* ---------- Gallery: thumbnail NẰM NGANG dưới ảnh chính ---------- */
.idn-product__gallery { min-width: 0; }
.idn-product__gallery .product-images { margin-bottom: 0; }
.idn-product__gallery .woocommerce-product-gallery__wrapper,
.idn-product__gallery .product-gallery-slider {
	width: 100% !important;
	margin-bottom: 12px;
}
.idn-product__gallery .woocommerce-product-gallery__image img {
	border-radius: 12px;
	border: 1px solid var(--idn-line);
}
/* Hàng thumbnail ngang */
.idn-product__gallery .product-thumbnails {
	display: flex !important;
	flex-flow: row wrap;
	gap: 10px;
	width: 100% !important;
	margin: 0 !important;
}
.idn-product__gallery .product-thumbnails .col {
	flex: 0 0 auto;
	width: 76px !important;
	max-width: 76px;
	margin: 0 !important;
	padding: 0 !important;
}
.idn-product__gallery .product-thumbnails img {
	border-radius: 8px;
	border: 1px solid var(--idn-line);
	transition: border-color .2s ease;
}
.idn-product__gallery .product-thumbnails .is-nav-selected img,
.idn-product__gallery .product-thumbnails .col:hover img {
	border-color: var(--idn-pc);
}

/* ---------- Cột thông tin ---------- */
.idn-product__info { min-width: 0; }
.idn-product__title {
	margin: 0 0 14px;
	font-size: clamp(22px, 2.4vw, 30px);
	line-height: 1.3;
	font-weight: 800;
	color: var(--idn-ink);
}
.idn-product__price {
	margin-bottom: 18px;
	font-size: 26px;
	font-weight: 800;
	line-height: 1;
	color: var(--idn-pc);
}
.idn-product__price .price,
.idn-product__price .amount { color: var(--idn-pc); }
.idn-product__price del {
	color: var(--idn-muted);
	font-weight: 500;
	font-size: 17px;
	margin-left: 8px;
}
.idn-product__price ins { text-decoration: none; }

/* ---------- Thông số kỹ thuật ---------- */
.idn-product__specs {
	margin: 0 0 22px;
	padding: 0;
	list-style: none;
}
.idn-product__specs li {
	position: relative;
	padding-left: 20px;
	margin-bottom: 10px;
	color: #46505f;
	font-size: 15.5px;
	line-height: 1.6;
}
.idn-product__specs li::before {
	content: "";
	position: absolute;
	left: 0; top: .62em;
	width: 7px; height: 7px;
	border-radius: 50%;
	background: var(--idn-pc);
}
.idn-product__spec-label { font-weight: 600; color: var(--idn-ink); }
.idn-product__specs--raw { padding-left: 0; }
.idn-product__specs--raw p { margin: 0 0 8px; }

/* ---------- Xem thêm (mô tả ngắn bổ sung) ---------- */
.idn-product__shortmore { margin: -6px 0 20px; }
.idn-product__shortmore-body {
	overflow: hidden;
	max-height: 0;
	transition: max-height .3s ease;
	color: #46505f;
	font-size: 15px;
	line-height: 1.7;
}
.idn-product__shortmore.is-open .idn-product__shortmore-body { max-height: 600px; }
.idn-product__shortmore-toggle {
	margin-top: 6px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--idn-pc);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.idn-product__shortmore-toggle:hover { text-decoration: underline; }

/* ---------- Nút CTA ---------- */
.idn-product__cta {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-bottom: 22px;
}
.idn-product__btn {
	flex: 1 1 0;
	min-width: 160px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 14px 22px;
	border-radius: 8px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: .02em;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.idn-product__btn--outline {
	background: #fff;
	color: var(--idn-pc);
	border: 2px solid var(--idn-pc);
}
.idn-product__btn--outline:hover {
	background: var(--idn-pc);
	color: #fff;
}
.idn-product__btn--solid {
	background: var(--idn-pc);
	color: #fff;
	border: 2px solid var(--idn-pc);
	box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--idn-pc) 75%, transparent);
}
.idn-product__btn--solid:hover {
	background: color-mix(in srgb, var(--idn-pc) 88%, #000);
	border-color: color-mix(in srgb, var(--idn-pc) 88%, #000);
	color: #fff;
}

/* ---------- Accordion ---------- */
.idn-product__accordion {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 8px;
}
.idn-product__acc-item {
	border: 1px solid var(--idn-line);
	border-radius: 12px;
	background: #fff;
	overflow: hidden;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.idn-product__acc-item:hover {
	border-color: color-mix(in srgb, var(--idn-pc) 45%, var(--idn-line));
}
.idn-product__acc-item:has(.idn-product__acc-head[aria-expanded="true"]) {
	border-color: var(--idn-pc);
	box-shadow: 0 12px 26px -16px color-mix(in srgb, var(--idn-pc) 70%, transparent);
}
.idn-product__acc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 16px 18px;
	border: 0;
	background: var(--idn-soft);
	color: var(--idn-ink);
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	text-align: left;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}
.idn-product__acc-head > span {
	position: relative;
	padding-left: 14px;
}
.idn-product__acc-head > span::before {
	content: "";
	position: absolute;
	left: 0; top: 50%;
	transform: translateY(-50%);
	width: 4px; height: 18px;
	border-radius: 3px;
	background: var(--idn-pc);
}
.idn-product__acc-ico {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px; height: 28px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid var(--idn-line);
	color: var(--idn-pc);
	transition: transform .25s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.idn-product__acc-head:hover { background: color-mix(in srgb, var(--idn-pc) 8%, #fff); }
.idn-product__acc-head[aria-expanded="true"] {
	background: var(--idn-pc);
	color: #fff;
}
.idn-product__acc-head[aria-expanded="true"] > span::before { background: #fff; }
.idn-product__acc-head[aria-expanded="true"] .idn-product__acc-ico {
	transform: rotate(180deg);
	background: #fff;
	border-color: #fff;
	color: var(--idn-pc);
}
.idn-product__acc-body {
	overflow: hidden;
	max-height: 0;
	transition: max-height .3s ease;
}
.idn-product__acc-inner {
	padding: 16px 18px 18px;
	color: #46505f;
	font-size: 15px;
	line-height: 1.75;
}
.idn-product__acc-inner > *:first-child { margin-top: 0; }
.idn-product__acc-inner > *:last-child { margin-bottom: 0; }

/* =========================================================
 * KHỐI 2 — Mô tả sản phẩm
 * ====================================================== */
.idn-product__desc { margin-top: 46px; }
.idn-product__heading {
	position: relative;
	margin: 0 0 22px;
	padding-bottom: 14px;
	font-size: 21px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .01em;
	color: var(--idn-ink);
	border-bottom: 1px solid var(--idn-line);
}
.idn-product__heading::after {
	content: "";
	position: absolute;
	left: 0; bottom: -1px;
	width: 64px; height: 3px;
	background: var(--idn-pc);
	border-radius: 3px;
}
.idn-product__desc-body {
	position: relative;
	color: #38414f;
	font-size: 16px;
	line-height: 1.8;
}
.idn-product__desc-body.is-collapsed {
	max-height: 320px;
	overflow: hidden;
}
.idn-product__desc-body.is-collapsed::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: 110px;
	background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 92%);
	pointer-events: none;
}
.idn-product__desc-inner > *:first-child { margin-top: 0; }
.idn-product__desc-inner p { margin: 0 0 16px; }
.idn-product__desc-inner h2 { font-size: 22px; }
.idn-product__desc-inner h3 { font-size: 19px; }
.idn-product__desc-inner h2,
.idn-product__desc-inner h3,
.idn-product__desc-inner h4 {
	color: var(--idn-ink);
	font-weight: 700;
	line-height: 1.35;
	margin: 26px 0 12px;
}
.idn-product__desc-inner img { max-width: 100%; height: auto; border-radius: 10px; }
.idn-product__desc-inner table { width: 100%; border-collapse: collapse; margin: 0 0 18px; }
.idn-product__desc-inner th,
.idn-product__desc-inner td { border: 1px solid var(--idn-line); padding: 9px 12px; text-align: left; }
.idn-product__desc-inner th { background: var(--idn-soft); font-weight: 700; color: var(--idn-ink); }

.idn-product__desc-toggle-wrap { text-align: center; margin-top: 18px; }
.idn-product__desc-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 5px 26px;
	border: 1px solid var(--idn-pc);
	border-radius: 8px;
	background: #fff;
	color: var(--idn-pc);
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}
.idn-product__desc-toggle:hover { background: var(--idn-pc); color: #fff; }
.idn-product__desc-toggle-ico {
	font-size: 18px;
	line-height: 1;
	font-weight: 700;
}

/* =========================================================
 * KHỐI 3 — Sản phẩm liên quan
 * ====================================================== */
.idn-product__related,
.idn-product__viewed { margin-top: 50px; }
/* Thẻ sản phẩm dùng chung "idn-lib" (giống hệt trang danh mục) */
.idn-product__related .idn-lib--archive,
.idn-product__viewed .idn-lib--archive { margin: 0; }

/* =========================================================
 * Responsive
 * ====================================================== */
@media (max-width: 849px) {
	.idn-product__top {
		grid-template-columns: 1fr;
		gap: 26px;
	}
	.idn-product__price { font-size: 23px; }
}
@media (max-width: 560px) {
	.idn-product__wrap { padding: 16px 16px 44px; }
	.idn-product__cta { flex-direction: column; }
	.idn-product__btn { width: 100%; }
	.idn-product__gallery .product-thumbnails .col { width: 64px !important; max-width: 64px; }
}
