/* ==========================================================================
   Bed — Khối B: tab sản phẩm · voucher · banner ngang · slider sản phẩm
   Nguồn: reference/css-js/custom.css (quy đổi rem → px, 1rem = 10px)
   ========================================================================== */

/* ---------- Reset nhẹ cho nút/input của Flatsome bên trong các khối này ---------- */
.bed-ptabs__pill, .coupon-ticket__copy-btn {
	text-transform: none;
	letter-spacing: -0.064px;
	margin: 0;
	min-height: 0;
	box-shadow: none;
	text-shadow: none;
}
/* chữ của mẫu có letter-spacing -0.004em (body) */
.bed-ptabs, .bed-coupons, .bed-banner, .bed-pslider, .coupon-modal-content, .bed-coupon-list, .coupon-group { letter-spacing: -0.064px; }

/* nút "Xem tất cả ›" (tab sản phẩm + slider sản phẩm): rộng 100% dưới 1024, tự co từ 1024 — như mẫu */
body.bed-theme .bed-viewall--b .bed-btn {
	display: inline-flex; width: 100%; min-width: 0; min-height: 0; margin: 24px 0 0; padding: 12px 23px;
	gap: 8px; font-size: 16px; font-weight: 600; line-height: 24px; letter-spacing: normal; text-transform: none;
}
@media (min-width: 1024px) { body.bed-theme .bed-viewall--b .bed-btn { width: auto; } }
.bed-viewall--b .bed-btn .bed-icon { display: block; width: 16px; height: 16px; flex: none; }

/* ==========================================================================
   1. TAB SẢN PHẨM  (section-product-tabs)
   ========================================================================== */
.bed-ptabs { --bed-pt-cols: 4; --bed-pt-cols-sm: 2; --bed-pt-gap: 16px; --bed-pt-gap-sm: 12px; }
.bed-ptabs__head {
	display: flex; align-items: center; justify-content: space-between;
	gap: 12px 20px; margin-bottom: 32px; flex-wrap: wrap;
}
.bed-ptabs__head .bed-heading-bar { margin: 0; }
.bed-ptabs__head .bed-heading { margin: 0; }
.bed-ptabs__head.is-center { flex-direction: column; justify-content: center; }
.bed-ptabs__nav {
	display: flex; align-items: center; gap: 0; flex-shrink: 0;
	background: var(--bed-pt-bg, var(--bed-n50)); border-radius: 9999px; padding: 4px;
}
.bed-ptabs .bed-ptabs__pill {
	display: inline-flex; align-items: center; padding: 7px 20px; border: 0; border-radius: 9999px;
	margin: 0; min-height: 0; font-family: var(--bed-font-body); font-size: 14px; font-weight: 500; line-height: 20px; letter-spacing: -0.064px; white-space: nowrap;
	cursor: pointer; background: transparent; color: var(--bed-pt-color, var(--bed-fg)); user-select: none;
	transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.bed-ptabs .bed-ptabs__pill:hover { background: rgba(0, 0, 0, .05); color: var(--bed-pt-color, var(--bed-fg)); }
.bed-ptabs .bed-ptabs__pill.is-active {
	background: var(--bed-pt-active-bg, #fff); color: var(--bed-pt-active-color, var(--bed-fg));
	font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.bed-ptabs .bed-ptabs__pill:focus-visible { outline: 2px solid var(--bed-primary); outline-offset: 2px; }
.bed-ptabs__panel[hidden] { display: none; }
.bed-ptabs__panel { animation: bedTabSlideUp .4s ease; }
@keyframes bedTabSlideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.bed-ptabs__grid {
	display: grid; align-items: stretch;
	grid-template-columns: repeat(var(--bed-pt-cols-sm), minmax(0, 1fr));
	gap: var(--bed-pt-gap-sm);
}
@media (min-width: 768px) { .bed-ptabs__grid { gap: var(--bed-pt-gap); } }
@media (min-width: 1024px) { .bed-ptabs__grid { grid-template-columns: repeat(var(--bed-pt-cols), minmax(0, 1fr)); } }
.bed-ptabs__grid .bed-card { height: 100%; }
.bed-empty { text-align: center; color: var(--bed-n300); padding: 24px 0; }
@media (max-width: 767px) {
	.bed-ptabs__head { flex-direction: column; align-items: flex-start; gap: 15px; width: 100%; overflow: hidden; }
	.bed-ptabs__head .bed-heading { margin-bottom: 12px; }
	.bed-ptabs__head.is-center { align-items: center; }
	.bed-ptabs__nav { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; justify-content: flex-start; scrollbar-width: none; }
	.bed-ptabs__nav::-webkit-scrollbar { display: none; }
	.bed-ptabs .bed-ptabs__pill { flex-shrink: 0; }
}
/* UX Builder: tab con hiển thị lần lượt */
.bed-ptabs__builder-tab { margin-bottom: 24px; }
.bed-ptabs__builder-title { display: inline-block; padding: 4px 14px; border-radius: 9999px; background: var(--bed-n50); font-weight: 600; margin-bottom: 12px; }

/* ==========================================================================
   2. VOUCHER  (section-coupons) + modal + dải mã (coupon-group)
   ========================================================================== */
:root {
	--coupon-active-bg: #ffffff;
	--coupon-badge-color: var(--bed-primary);
	--coupon-active-title: #1a1a1a;
	--coupon-active-desc: #666666;
	--coupon-active-button-bg: #1a1a1a;
	--coupon-active-button-text: #ffffff;
}
.bed-coupons__wrap { position: relative; }

/* slider */
.bed-coupons__list.is-slider { margin: 0; --bed-dots-space: 16px; }
body.bed-theme .bed-coupons .bed-slider .flickity-page-dots { margin-top: 12px; } /* mẫu: .embla__dots.mt-3 */
.bed-coupons__slide { width: 80%; padding: 16px 12px 16px 8px; box-sizing: border-box; display: flex; }
@media (min-width: 768px) { .bed-coupons__slide { width: 50%; } }
@media (min-width: 1270px) { .bed-coupons__slide { width: calc(100% / var(--bed-cp-cols, 3)); } }
.bed-coupons__slide .coupon-item { width: 100%; display: flex; flex-direction: column; flex: 1; }
.bed-coupons__list.is-slider .flickity-viewport { overflow: hidden; }
/* dạng lưới */
.bed-coupons__list.is-grid { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 16px 0; }
@media (min-width: 768px) { .bed-coupons__list.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1270px) { .bed-coupons__list.is-grid { grid-template-columns: repeat(var(--bed-cp-cols, 3), minmax(0, 1fr)); } }
.bed-coupons__cell { display: flex; min-width: 0; }
.bed-coupons__cell .coupon-item { width: 100%; display: flex; flex-direction: column; flex: 1; }

/* vé */
.coupon-item { cursor: pointer; }
.coupon-item:focus-visible { outline: 2px solid var(--bed-primary); outline-offset: 2px; border-radius: 16px; }
.coupon-ticket {
	display: flex; flex-direction: row; align-items: center; gap: 12px;
	background: var(--coupon-active-bg, #fff); border-radius: 16px; padding: 16px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
	transition: box-shadow .2s ease, transform .2s ease;
	width: 100%; height: 100%; position: relative; box-sizing: border-box;
}
.coupon-ticket:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, .1); }
.coupon-ticket__icon {
	flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; background: var(--bed-n50);
	display: flex; align-items: center; justify-content: center; color: var(--coupon-active-title, #1a1a1a);
}
.coupon-ticket__icon-img, .coupon-ticket__icon-svg { width: 24px; height: 24px; object-fit: contain; }
.coupon-ticket__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.coupon-ticket__title { font-size: 15px; font-weight: 600; color: var(--coupon-active-title, #1a1a1a); line-height: 18px; margin: 0; padding: 0; text-transform: none; }
.coupon-ticket__desc { font-size: 13px; color: var(--coupon-active-desc, #666); line-height: 1.45; margin: 0; }
.coupon-ticket__meta { font-size: 12px; color: var(--coupon-active-desc, #666); opacity: .75; line-height: 1.4; margin: 0; }
.coupon-ticket__meta .coupon-expiry:not(:empty) { display: block; margin-top: 2px; }
.coupon-ticket__meta .text-error { color: var(--bed-error); opacity: 1; }
.coupon-ticket__action { flex: 0 0 auto; display: flex; flex-direction: column; align-items: stretch; gap: 8px; text-align: center; }
.coupon-ticket__code {
	display: inline-flex; align-items: center; justify-content: center; padding: 7px 14px;
	border: 1.5px dashed var(--coupon-badge-color, var(--bed-primary)); border-radius: 8px;
	font-size: 14px; font-weight: 700; letter-spacing: .04em; color: var(--coupon-badge-color, var(--bed-primary)); white-space: nowrap;
}
.coupon-ticket .coupon-ticket__copy-btn {
	display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%;
	background: var(--coupon-active-button-bg, #1a1a1a); color: var(--coupon-active-button-text, #fff);
	border: 0; padding: 8px 14px; font-size: 13px; font-weight: 600; line-height: 1.42857; font-family: var(--bed-font-body);
	border-radius: 8px !important; cursor: pointer; transition: opacity .2s ease, transform .15s ease; text-transform: none; min-height: 0; box-shadow: none; overflow: hidden;
}
.coupon-ticket .coupon-ticket__copy-btn:hover { opacity: .88; transform: scale(1.02); }
.coupon-ticket.expired { opacity: .85; }
.coupon-ticket.expired .coupon-ticket__code { border-color: #ccc; color: #aaa; }
.coupon-ticket.expired .coupon-ticket__copy-btn,
.copy-button.coupon-expired { background: transparent; border: 1.5px dashed #ccc; color: #aaa; cursor: not-allowed; }
.coupon-ticket.expired .coupon-ticket__copy-btn:hover { transform: none; opacity: 1; }
@media (max-width: 767px) {
	.coupon-ticket { flex-wrap: wrap; gap: 10px; padding: 14px; }
	.coupon-ticket__icon { width: 40px; height: 40px; }
	.coupon-ticket__action { flex: 1 1 100%; flex-direction: row; align-items: center; gap: 10px; }
	.coupon-ticket__code { flex: 1 1 auto; min-width: 0; }
	.coupon-ticket .coupon-ticket__copy-btn { width: auto; flex: 0 0 auto; }
}

/* modal chi tiết (dựng bằng Bed.modal) */
.bed-modal.bed-coupon-modal .bed-modal__box { max-width: 500px; padding: 0; border-radius: 16px; overflow: visible; }
.bed-coupon-modal .bed-modal__close { right: 12px; top: 12px; z-index: 2; background: var(--bed-n50);     margin: 0 !IMPORTANT;
    padding: 0 !important;
    width: 36px !important;
    height: 36px !important;
    min-height: unset !important;}
.coupon-modal-content { position: relative; padding: 32px; border-radius: 16px; background: #fff; }
.coupon-modal-header { text-align: center; margin-bottom: 24px; }
.coupon-modal-title { color: var(--bed-fg); font-size: 30px; font-weight: 700; letter-spacing: .5px; line-height: 1.2; margin: 0 0 8px; font-family: var(--bed-font-heading); text-transform: none; }
.coupon-modal-subtitle { color: var(--bed-n300); font-size: 14px; line-height: 1.5; margin: 0; }
.coupon-modal-code-box {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); border: 2px dashed var(--coupon-active-badge-from, #ff6b00);
	border-radius: 12px; padding: 20px; text-align: center; position: relative; overflow: hidden; margin-bottom: 24px;
}
.coupon-modal-code-box::before { content: ''; position: absolute; top: -50%; right: -50%; width: 100px; height: 100px; background: radial-gradient(circle, rgba(255, 107, 0, .1) 0%, transparent 70%); border-radius: 50%; }
.coupon-code-display { position: relative; z-index: 1; }
.coupon-code-text { font-size: 28px; font-weight: 700; color: var(--coupon-active-badge-from, #ff6b00); letter-spacing: 2px; font-family: 'Courier New', monospace; text-transform: uppercase; }
.coupon-desc-title { font-size: 13px; font-weight: 700; color: var(--coupon-active-title, #1a1a1a); margin: 0 0 6px; }
.coupon-desc { color: var(--bed-fg); line-height: 1.7; font-size: 14px; margin-bottom: 24px; }
.coupon-desc ul { margin: 0 0 0 18px; list-style: disc outside; }
.coupon-desc li { margin-bottom: 4px; padding-left: 2px; }
.coupon-desc li::marker { color: var(--coupon-badge-color, #ff6b00); }
.coupon-modal-expiry { font-size: 13px; color: var(--coupon-active-desc, #666); opacity: .85; margin: -16px 0 24px; }
.coupon-modal-actions { display: grid; gap: 12px; }
.coupon-modal-actions .bed-btn { width: 100%; font-size: 15px; border-radius: 12px; padding: 12px 24px; }
.coupon-modal-actions .bed-btn--primary { background: var(--coupon-active-button-bg, #1a1a1a); border-color: var(--coupon-active-button-bg, #1a1a1a); color: var(--coupon-active-button-text, #fff) !important; }
.coupon-modal-actions .bed-btn.coupon-expired { background: var(--bed-n50); border-color: var(--bed-n50); color: var(--bed-n400) !important; cursor: not-allowed; }
@media (max-width: 767px) {
	.coupon-modal-content { padding: 24px; }
	.coupon-modal-title { font-size: 20px; }
	.coupon-code-text { font-size: 22px; letter-spacing: 1px; }
	.coupon-modal-code-box { padding: 16px; }
}
/* danh sách tất cả mã (nút "›" trên dải mã) */
.bed-modal.bed-coupon-list-modal .bed-modal__box { max-width: 520px; padding: 20px; background: var(--bed-bg-body); }
.bed-coupon-list-title { font-family: var(--bed-font-heading); font-weight: 600; font-size: 20px; margin: 0 28px 16px 0; }
.bed-coupon-list { display: flex; flex-direction: column; gap: 16px; }

/* dải "Mã giảm giá" trên trang sản phẩm */
.coupon-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.coupon-group-header { flex: 0 0 auto; color: var(--bed-n400); }
.coupon-group-strip { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.coupon-group-list { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -ms-overflow-style: none; }
.coupon-group-list::-webkit-scrollbar { display: none; }
.coupon-group-item-wrap { flex: 0 0 auto; scroll-snap-align: start; }
.coupon-group-item, .bed-coupon-more {
	display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; cursor: pointer;
	color: #ff9d02; background: linear-gradient(180deg, rgba(238, 127, 25, .1) 0%, rgba(255, 255, 255, 0) 100%);
	border: 1px solid #fed7d7; white-space: nowrap; transition: transform .2s ease;
}
.coupon-group-item__code { font-weight: 600; }
.coupon-group-more { flex: 0 0 auto; }
@media (hover: hover) { .coupon-group-item:hover, .bed-coupon-more:hover { transform: scale(1.05); } }
@media (max-width: 767px) { .coupon-group { flex-direction: column; align-items: stretch; gap: 6px; } }
.coupon-group-item.expired { opacity: .6; text-decoration: line-through; }

/* ==========================================================================
   3. BANNER NGANG  (section-banner-image)
   ========================================================================== */
.bed-banner { position: relative; text-align: center; }
.bed-banner__link { position: relative; display: block; width: 100%; }
.bed-banner__img { display: block; width: 100%; height: auto; margin: 0 auto; }
.bed-banner--zoom .bed-banner__img { transition: transform .5s ease; }
.bed-banner--zoom:hover .bed-banner__img { transform: scale(1.03); }
.bed-banner--zoom { overflow: hidden; }

/* ==========================================================================
   4. SLIDER SẢN PHẨM  (section-products-slider)
   ========================================================================== */
.bed-pslider { --bed-ps-gap: 16px; --bed-ps-w-lg: 25%; --bed-ps-w-md: 27%; position: relative; overflow-x: clip; } /* clip = .embla__viewport: ô lệch trái không tràn ra ngoài khung */
.bed-pslider__top { margin-bottom: 32px; }
.bed-pslider__slider { margin-left: calc(var(--bed-ps-gap) * -1); --bed-slider-bleed: var(--bed-ps-gap); } /* bleed: mũi tên/chấm bù phần lệch để vẫn căn theo khung */
.bed-pslider .bed-slide { width: 57%; padding: 0 0 0 var(--bed-ps-gap); box-sizing: border-box; }
@media (min-width: 768px) { .bed-pslider .bed-slide { width: var(--bed-ps-w-md); } }
@media (min-width: 1270px) { .bed-pslider .bed-slide { width: var(--bed-ps-w-lg); } }
.bed-pslider .bed-slide .bed-card { height: 100%; }
.bed-pslider .flickity-viewport { overflow: hidden; }
/* biến thể trong bài viết */
.bed-products-slider--article { margin-left: 0; margin-right: 0; clear: both; }
.bed-products-slider--article .bed-heading { font-size: 22px; margin-bottom: 16px; }
body.bed-theme .bed-products-slider--article .bed-viewall .bed-btn { width: auto; margin-top: 12px; min-width: 0; font-size: 14px; line-height: 20px; padding: 10px 22px; }
