/**
 * Điện máy Shop — Flatsome Child
 * Màu chính: #dd3333
 */

:root {
	--dienmay-primary: #dd3333;
	--dienmay-primary-dark: #c42b2b;
	--dienmay-primary-light: #fff5f5;
	--primary-color: var(--dienmay-primary);
	--fs-color-primary: var(--dienmay-primary);
	--dienmay-radius: 8px;
	--dienmay-shadow: 0 2px 12px rgba(0, 0, 0, 0.09);
	--dienmay-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
	--dienmay-transition: 0.22s ease;
}

body.dienmay-theme {
	font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* —— Top bar —— */
.dienmay-topbar {
	background: var(--dienmay-primary);
	color: #fff;
	font-size: 13px;
	line-height: 1.4;
}

.dienmay-topbar__inner {
	min-height: 36px;
	padding: 6px 0;
	gap: 12px;
	flex-wrap: wrap;
}

.dienmay-topbar__promo i {
	margin-right: 6px;
}

.dienmay-topbar__phone {
	color: #fff;
	text-decoration: none;
	white-space: nowrap;
}

.dienmay-topbar__phone:hover {
	color: #fff;
	opacity: 0.9;
}

.dienmay-topbar__phone i {
	margin-right: 6px;
}

/* —— Buttons & links —— */
.button.primary:not(.is-outline),
.single_add_to_cart_button,
.checkout-button,
.woocommerce-mini-cart__buttons .checkout,
input[type="submit"].button {
	background-color: var(--dienmay-primary) !important;
	border-color: var(--dienmay-primary) !important;
}

.button.primary:not(.is-outline):hover,
.single_add_to_cart_button:hover,
.checkout-button:hover {
	background-color: var(--dienmay-primary-dark) !important;
	border-color: var(--dienmay-primary-dark) !important;
}

a:hover,
.widget a:hover,
.breadcrumbs a:hover {
	color: var(--dienmay-primary);
}

/* —— Giá & badge sale —— */
.woocommerce .price ins,
.woocommerce .price ins .amount,
.product-summary .price ins {
	color: var(--dienmay-primary) !important;
	font-weight: 700;
}

.woocommerce .price del {
	opacity: 0.55;
}

.product-small .box-text .price ins,
.product-small .box-text .price ins .amount {
	color: var(--dienmay-primary) !important;
}

/* Flatsome: .badge-container { margin: 30px 0 0 } — gây badge tụt xuống */
body.dienmay-theme .col-inner > .badge-container,
body.dienmay-theme .product-small .badge-container,
body.dienmay-theme .product-gallery .badge-container {
	top: 0 !important;
	left: 0 !important;
	margin: 0 !important;
}

.dienmay-badge-sale {
	position: static;
	z-index: 3;
	pointer-events: none;
}

.dienmay-badge-sale span {
	display: inline-block;
	background: var(--dienmay-primary);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	padding: 6px 10px;
	border-radius: 0 0 8px 0;
	box-shadow: 0 2px 8px rgba(221, 51, 51, 0.35);
}

.product-small .box-image,
.product-gallery {
	position: relative;
}

/* Ẩn badge sale mặc định khi đã có % */
.product-small .onsale,
.product-gallery .onsale {
	display: none !important;
}

/* —— Thuộc tính trên card sản phẩm —— */
.dienmay-card-attrs {
	margin: 4px 0 8px;
	padding: 0;
}

.dienmay-card-attrs__row {
	margin: 0 0 2px;
	font-size: 13px;
	line-height: 1.45;
	color: #333;
}

.dienmay-card-attrs__row:last-child {
	margin-bottom: 0;
}

.dienmay-card-attrs__label {
	font-weight: 700;
	color: #222;
}

.dienmay-card-attrs__value {
	font-weight: 400;
}

/* —— Card sản phẩm: bóng đổ + căn giá —— */
body.dienmay-theme .product-small.col > .col-inner {
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.07);
	border-radius: 8px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.09);
	overflow: hidden;
}

body.dienmay-theme .product-small.col .product-small.box {
	display: flex;
	flex-direction: column;
	height: 100%;
}

body.dienmay-theme .product-small.col .box-text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 10px 12px 12px;
}

body.dienmay-theme .product-small.col .title-wrapper {
	flex: 1 1 auto;
}

body.dienmay-theme .product-small.col .product-title,
body.dienmay-theme .product-small.col .woocommerce-loop-product__title {
	display: -webkit-box;
	overflow: hidden;
	min-height: 2.7em;
	max-height: 2.7em;
	line-height: 1.35;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

body.dienmay-theme .product-small.col .product-title a {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
}

body.dienmay-theme .product-small.col .price-wrapper {
	margin-top: auto;
	padding-top: 6px;
}

/* Slider: Flickity tự tính chiều cao */
body.dienmay-theme .row-slider .product-small.col {
	height: auto;
}

/*
 * Ảnh card: min-height cố định + căn giữa (upload size khác nhau vẫn hiện, không dùng absolute/aspect-ratio).
 */
body.dienmay-theme .product-small.col .box-image {
	position: relative;
	min-height: 260px;
	padding-top: 0 !important;
	background: #f7f7f7;
}

body.dienmay-theme .product-small.col .box-image > .image-fade_in_back,
body.dienmay-theme .product-small.col .box-image > .image-none,
body.dienmay-theme .product-small.col .box-image > .image-zoom,
body.dienmay-theme .product-small.col .box-image > .image-zoom-in,
body.dienmay-theme .product-small.col .box-image > .image-fade,
body.dienmay-theme .product-small.col .box-image > .image-slide {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 260px;
	padding: 12px;
	box-sizing: border-box;
}

body.dienmay-theme .product-small.col .box-image .image-fade_in_back > a,
body.dienmay-theme .product-small.col .box-image .image-none > a {
	display: block;
	line-height: 0;
	max-width: 100%;
}

body.dienmay-theme .product-small.col .box-image img:not(.back-image) {
	position: relative !important;
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 236px;
	margin: 0 auto;
	object-fit: contain;
	object-position: center;
}

body.dienmay-theme .products.equalize-box .product-small.col > .col-inner {
	height: 100%;
}

/* Shop mobile: nút mở sidebar danh mục (Flatsome ẩn cột trái < 850px) */
@media (max-width: 849px) {
	body.dienmay-theme.woocommerce .category-filtering.category-filter-row {
		display: block !important;
		margin-bottom: 12px;
	}

	body.dienmay-theme.woocommerce .category-filtering .filter-button {
		font-size: 13px;
	}

	/* —— Card SP mobile: ảnh full width card —— */
	body.dienmay-theme .product-small.col .box-image {
		min-height: 0;
		padding: 0;
		background: #f7f7f7;
	}

	body.dienmay-theme .product-small.col .box-image > .image-fade_in_back,
	body.dienmay-theme .product-small.col .box-image > .image-none,
	body.dienmay-theme .product-small.col .box-image > .image-zoom,
	body.dienmay-theme .product-small.col .box-image > .image-zoom-in,
	body.dienmay-theme .product-small.col .box-image > .image-fade,
	body.dienmay-theme .product-small.col .box-image > .image-slide {
		display: block;
		min-height: 0;
		padding: 0;
		width: 100%;
	}

	body.dienmay-theme .product-small.col .box-image .image-fade_in_back > a,
	body.dienmay-theme .product-small.col .box-image .image-none > a {
		display: block;
		width: 100%;
		max-width: none;
	}

	body.dienmay-theme .product-small.col .box-image img:not(.back-image) {
		width: 100%;
		max-width: none;
		height: auto;
		max-height: 185px;
		margin: 0;
		object-fit: contain;
		object-position: center;
	}

	body.dienmay-theme .product-small.col .box-text {
		padding: 8px 10px 10px;
	}

	body.dienmay-theme .product-small.col .title-wrapper {
		flex: 0 1 auto;
	}

	/* Flatsome equalize-box set height inline — bỏ trên mobile */
	body.dienmay-theme .product-small.col .product-title,
	body.dienmay-theme .product-small.col .woocommerce-loop-product__title {
		height: auto !important;
		min-height: 0 !important;
		max-height: 2.6em;
		line-height: 1.3;
		font-size: 13px;
	}

	body.dienmay-theme .product-small.col .product-cat {
		display: -webkit-box;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 1;
		line-clamp: 1;
		margin-bottom: 2px;
		font-size: 11px;
	}

	/* Thuộc tính: tối đa 2 dòng, chữ nhỏ */
	body.dienmay-theme .dienmay-card-attrs {
		margin: 2px 0 4px;
		max-height: 2.8em;
		overflow: hidden;
	}

	body.dienmay-theme .dienmay-card-attrs__row {
		font-size: 11px;
		line-height: 1.35;
		margin-bottom: 1px;
	}

	body.dienmay-theme .dienmay-card-attrs__row:nth-child(n + 3) {
		display: none;
	}

	body.dienmay-theme .product-small.col .price-wrapper {
		padding-top: 4px;
	}

	body.dienmay-theme .product-small.col .price {
		font-size: 14px;
	}

	/* Slider trang chủ: ẩn thuộc tính */
	body.dienmay-theme .row-slider .product-small.col .dienmay-card-attrs {
		display: none;
	}

	body.dienmay-theme .row-slider .product-small.col .box-image img:not(.back-image) {
		max-height: 165px;
	}
}

@media (max-width: 549px) {
	body.dienmay-theme .product-small.col .box-image img:not(.back-image) {
		max-height: 155px;
	}

	body.dienmay-theme .row-slider .product-small.col .box-image img:not(.back-image) {
		max-height: 140px;
	}
}

/* —— Tab thông số —— */
.dienmay-specs-table {
	width: 100%;
	border-collapse: collapse;
}

.dienmay-specs-table th,
.dienmay-specs-table td {
	padding: 12px 14px;
	border-bottom: 1px solid #eee;
	text-align: left;
	vertical-align: top;
}

.dienmay-specs-table th {
	width: 35%;
	background: #fafafa;
	font-weight: 600;
	color: #333;
}

.dienmay-specs-table tr:last-child th,
.dienmay-specs-table tr:last-child td {
	border-bottom: none;
}

/* —— Woo tabs active —— */
.woocommerce-tabs .tabs li.active a {
	color: var(--dienmay-primary);
	border-color: var(--dienmay-primary);
}

/* —— Footer accent —— */
.footer-wrapper a:hover,
.absolute-footer a:hover {
	color: var(--dienmay-primary);
}

/* —— Sticky bar mobile —— */
.dienmay-sticky-bar {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999;
	background: #fff;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
	padding-bottom: env(safe-area-inset-bottom, 0);
}

.dienmay-sticky-bar__item {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 10px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	color: #fff;
}

.dienmay-sticky-bar__item--call {
	background: var(--dienmay-primary);
}

.dienmay-sticky-bar__item--call:hover {
	background: var(--dienmay-primary-dark);
	color: #fff;
}

.dienmay-sticky-bar__item--zalo {
	background: #0068ff;
}

.dienmay-sticky-bar__item--zalo:hover {
	background: #0056d6;
	color: #fff;
}

body.dienmay-has-sticky-bar {
	padding-bottom: 56px;
}

@media (max-width: 849px) {
	.dienmay-sticky-bar {
		display: flex;
	}

	.dienmay-topbar__promo {
		font-size: 12px;
	}
}

/* Section Ly do - icon + text tren mobile (trang chu) */
@media (max-width: 549px) {
	body.home .row-collapse.row-full-width,
	body.page-id-16 .row-collapse.row-full-width {
		display: flex !important;
		flex-wrap: nowrap !important;
		align-items: flex-start;
	}

	body.home .row-collapse.row-full-width > .col.medium-2,
	body.home .row-collapse.row-full-width > .col.large-2,
	body.page-id-16 .row-collapse.row-full-width > .col.medium-2,
	body.page-id-16 .row-collapse.row-full-width > .col.large-2 {
		flex: 0 0 52px !important;
		max-width: 52px !important;
		width: 52px !important;
	}

	body.home .row-collapse.row-full-width > .col.medium-10,
	body.home .row-collapse.row-full-width > .col.large-10,
	body.page-id-16 .row-collapse.row-full-width > .col.medium-10,
	body.page-id-16 .row-collapse.row-full-width > .col.large-10 {
		flex: 1 1 auto !important;
		max-width: calc(100% - 52px) !important;
		width: auto !important;
	}

	body.home .row-collapse.row-full-width .img.has-hover,
	body.page-id-16 .row-collapse.row-full-width .img.has-hover {
		width: 40px !important;
		max-width: 40px !important;
		margin: 0 !important;
	}

	body.home .row-collapse.row-full-width .img.has-hover .img-inner,
	body.home .row-collapse.row-full-width .img.has-hover img,
	body.page-id-16 .row-collapse.row-full-width .img.has-hover .img-inner,
	body.page-id-16 .row-collapse.row-full-width .img.has-hover img {
		width: 100% !important;
		max-width: 40px !important;
		height: auto !important;
	}
}

/* —— Nhân viên hỗ trợ (trang sản phẩm) —— */
.dienmay-staff {
	margin: 20px 0 10px;
	padding-top: 16px;
	border-top: 1px solid #eee;
}

.dienmay-staff__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px 12px;
	margin-bottom: 12px;
}

.dienmay-staff__title {
	font-size: 15px;
	font-weight: 700;
	color: #222;
}

.dienmay-staff__hours {
	font-size: 12px;
	color: #999;
	white-space: nowrap;
}

.dienmay-staff__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.dienmay-staff__card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	background: #f5f5f5;
	border-radius: 8px;
	min-width: 0;
}

.dienmay-staff__qr {
	flex: 0 0 68px;
	width: 68px;
}

.dienmay-staff__qr-img,
.dienmay-staff__qr-placeholder {
	display: block;
	width: 68px;
	height: 68px;
	object-fit: contain;
	border-radius: 6px;
	background: #fff;
	border: 1px solid #eee;
}

.dienmay-staff__qr-placeholder {
	border-style: dashed;
}

.dienmay-staff__body {
	flex: 1 1 auto;
	min-width: 0;
}

.dienmay-staff__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 8px;
	margin: 0 0 10px;
	line-height: 1.4;
}

.dienmay-staff__name {
	font-size: 15px;
	font-weight: 700;
	color: var(--dienmay-primary);
}

.dienmay-staff__phone {
	font-size: 14px;
	color: #666;
	font-weight: 400;
}

.dienmay-staff__actions {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.dienmay-staff__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	border: 1px solid transparent;
	white-space: nowrap;
	transition: background 0.2s, color 0.2s;
}

.dienmay-staff__btn i {
	font-size: 11px;
	flex-shrink: 0;
}

.dienmay-staff__btn--call {
	color: var(--dienmay-primary);
	border-color: var(--dienmay-primary);
	background: #fff;
}

.dienmay-staff__btn--call:hover {
	background: var(--dienmay-primary-light);
	color: var(--dienmay-primary-dark);
}

.dienmay-staff__btn--zalo {
	color: #0068ff;
	border-color: #0068ff;
	background: #fff;
}

.dienmay-staff__btn--zalo:hover {
	background: #eef4ff;
	color: #0056d6;
}

@media (max-width: 549px) {
	.dienmay-staff__grid {
		grid-template-columns: 1fr;
	}

	.dienmay-staff__head {
		flex-direction: column;
		align-items: flex-start;
	}

	.dienmay-staff__actions {
		flex-direction: row;
	}

	.dienmay-staff__btn {
		flex: 1 1 0;
		width: auto;
	}
}

/* ============================================================
   UI polish — chỉ giao diện, không đụng chức năng
   ============================================================ */

body.dienmay-theme {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Nút: bo góc + hover mượt */
body.dienmay-theme .button,
body.dienmay-theme button,
body.dienmay-theme input[type="submit"].button {
	border-radius: 6px;
	transition: background-color var(--dienmay-transition), border-color var(--dienmay-transition), transform var(--dienmay-transition), box-shadow var(--dienmay-transition);
}

body.dienmay-theme .button.primary:not(.is-outline):hover,
body.dienmay-theme .single_add_to_cart_button:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(221, 51, 51, 0.28);
}

/* Card sản phẩm: hover nhẹ */
body.dienmay-theme .product-small.col > .col-inner {
	transition: box-shadow var(--dienmay-transition), transform var(--dienmay-transition);
}

body.dienmay-theme .product-small.col:hover > .col-inner {
	box-shadow: var(--dienmay-shadow-hover);
	transform: translateY(-3px);
}

body.dienmay-theme .product-small.col .box-image img:not(.back-image) {
	transition: transform 0.35s ease;
}

body.dienmay-theme .product-small.col:hover .box-image img:not(.back-image) {
	transform: scale(1.03);
}

/* Tiêu đề section trang chủ */
body.dienmay-theme .section h2.uppercase strong,
body.dienmay-theme .section h2.uppercase {
	letter-spacing: 0.02em;
}

/* Danh mục nhỏ trên card */
body.dienmay-theme .product-small .product-cat {
	color: #888;
	letter-spacing: 0.03em;
}

/* Breadcrumb */
body.dienmay-theme .woocommerce-breadcrumb {
	font-size: 13px;
	color: #777;
}

body.dienmay-theme .woocommerce-breadcrumb a {
	color: #555;
	text-decoration: none;
}

body.dienmay-theme .woocommerce-breadcrumb a:hover {
	color: var(--dienmay-primary);
}

/* Trang sản phẩm: khung thông tin gọn hơn */
body.dienmay-theme .product-summary {
	padding-top: 4px;
}

body.dienmay-theme .product-summary .product_title {
	line-height: 1.3;
}

body.dienmay-theme .product-summary .price {
	font-size: 1.35em;
}

/* Tab WooCommerce */
body.dienmay-theme .woocommerce-tabs .tabs {
	border-bottom: 2px solid #eee;
}

body.dienmay-theme .woocommerce-tabs .tabs li a {
	padding-bottom: 10px;
	transition: color var(--dienmay-transition);
}

/* Form nhập liệu (liên hệ, checkout) */
body.dienmay-theme input[type="text"],
body.dienmay-theme input[type="email"],
body.dienmay-theme input[type="tel"],
body.dienmay-theme input[type="number"],
body.dienmay-theme input[type="password"],
body.dienmay-theme textarea,
body.dienmay-theme select {
	border-radius: 6px;
	transition: border-color var(--dienmay-transition), box-shadow var(--dienmay-transition);
}

body.dienmay-theme input:focus,
body.dienmay-theme textarea:focus,
body.dienmay-theme select:focus {
	border-color: rgba(221, 51, 51, 0.45);
	box-shadow: 0 0 0 3px rgba(221, 51, 51, 0.1);
	outline: none;
}

/* Slider sản phẩm: nút prev/next */
body.dienmay-theme .flickity-prev-next-button {
	border-radius: 50%;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
	transition: background var(--dienmay-transition), box-shadow var(--dienmay-transition);
}

body.dienmay-theme .flickity-prev-next-button:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
}

/* Footer */
body.dienmay-theme .footer-wrapper {
	border-top: 1px solid #eee;
}

/* Giảm chuyển động nếu người dùng bật accessibility */
@media (prefers-reduced-motion: reduce) {
	body.dienmay-theme .product-small.col > .col-inner,
	body.dienmay-theme .product-small.col .box-image img,
	body.dienmay-theme .button {
		transition: none;
	}

	body.dienmay-theme .product-small.col:hover > .col-inner {
		transform: none;
	}

	body.dienmay-theme .product-small.col:hover .box-image img {
		transform: none;
	}
}
