/**
 * Shield Demo Grid
 * CSS nền + 5 preset giao diện. Màu sắc / typography do control Elementor ghi đè;
 * phần này lo cấu trúc lưới, khối ảnh, overlay, chuyển động và phong cách từng preset.
 *
 * Preset: Minimal (clean) · Card (boxed) · Overlay · Elevated · Frame
 */

/* ============================================================
 * BASE (dùng chung, mặc định là kiểu Minimal)
 * ============================================================ */
.sdg-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px 24px;
	width: 100%;
}

.sdg-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background-color: transparent;
	border-radius: 10px;
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
		box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
		border-color 0.25s ease;
	will-change: transform;
}

.sdg-lift-yes .sdg-card:hover {
	transform: translateY(-6px);
}

/* ---------- Khối ảnh ---------- */
.sdg-media {
	position: relative;
	width: 100%;
	padding-bottom: 75%; /* 4:3, bị control image_ratio ghi đè */
	overflow: hidden;
	background-color: #f3f4f6;
	border-radius: inherit;
}

.sdg-media-inner {
	position: absolute;
	inset: 0;
}

.sdg-media-inner img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.sdg-zoom-yes .sdg-card:hover .sdg-media-inner img {
	transform: scale(1.06);
}

/* ---------- Nhãn góc ---------- */
.sdg-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 5;
	padding: 4px 11px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.02em;
	color: #111827;
	background-color: #fff;
	border-radius: 999px;
	box-shadow: 0 2px 8px rgba(17, 24, 39, 0.14);
}

/* ---------- Overlay + nút hover ---------- */
.sdg-overlay {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: rgba(17, 24, 39, 0.55);
	opacity: 0;
	transition: opacity 0.35s ease;
	text-decoration: none;
	border-radius: inherit;
}

.sdg-card:hover .sdg-overlay {
	opacity: 1;
}

.sdg-overlay--plain {
	background-color: transparent !important;
	opacity: 1;
}

.sdg-overlay .sdg-btn {
	transform: translateY(10px);
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.sdg-card:hover .sdg-overlay .sdg-btn {
	transform: translateY(0);
}

/* ---------- Nút ---------- */
.sdg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	background-color: #2563eb;
	border-radius: 10px;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.25s ease, transform 0.15s ease;
}

.sdg-btn:active {
	transform: scale(0.97);
}

.sdg-btn-icon {
	display: inline-flex;
	align-items: center;
	line-height: 1;
}

.sdg-btn-icon svg { width: 1em; height: 1em; }
.sdg-btn-icon i { font-size: 1em; }

.sdg-actions {
	margin-top: auto;
	padding-top: 16px;
}

.sdg-btn--below { width: 100%; }

/* ---------- Nội dung ---------- */
.sdg-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 16px 2px 0;
}

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

.sdg-title {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	color: #111827;
	min-width: 0;
}

.sdg-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.sdg-price {
	flex: none;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	color: #2563eb;
	white-space: nowrap;
}

.sdg-desc {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.6;
	color: #6b7280;
}

/* ============================================================
 * PRESET 2 — CARD (boxed): khung trắng + viền + bóng nhẹ
 * ============================================================ */
.sdg-style-boxed .sdg-card {
	background-color: #ffffff;
	border: 1px solid #e9eaee;
	box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}
.sdg-style-boxed .sdg-media { border-radius: 0; }
.sdg-style-boxed .sdg-body { padding: 16px 18px 20px; }
.sdg-style-boxed .sdg-card:hover {
	box-shadow: 0 18px 40px -14px rgba(17, 24, 39, 0.22);
}

/* ============================================================
 * PRESET 3 — OVERLAY: tên/giá đè ảnh trên nền gradient tối
 * ============================================================ */
.sdg-style-overlay .sdg-card { border-radius: 14px; }
.sdg-style-overlay .sdg-media::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(to top, rgba(2, 6, 14, 0.85) 0%, rgba(2, 6, 14, 0.35) 38%, rgba(2, 6, 14, 0) 72%);
	pointer-events: none;
}
.sdg-style-overlay .sdg-body {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 4;
	padding: 18px 18px 18px;
}
.sdg-style-overlay .sdg-head { margin-bottom: 4px; }
.sdg-style-overlay .sdg-title,
.sdg-style-overlay .sdg-title a { color: #ffffff; font-weight: 700; }
.sdg-style-overlay .sdg-desc { color: rgba(255, 255, 255, 0.82); }
.sdg-style-overlay .sdg-price {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.2);
	padding: 3px 11px;
	border-radius: 999px;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

/* ============================================================
 * PRESET 4 — ELEVATED: ảnh lồng khung bo tròn, bóng nổi mềm
 * ============================================================ */
.sdg-style-elevated .sdg-card {
	background-color: #ffffff;
	border-radius: 16px;
	padding: 10px;
	box-shadow: 0 12px 30px -14px rgba(17, 24, 39, 0.22), 0 2px 6px -2px rgba(17, 24, 39, 0.08);
}
.sdg-style-elevated .sdg-media { border-radius: 10px; }
.sdg-style-elevated .sdg-body { padding: 14px 8px 8px; }
.sdg-style-elevated .sdg-card:hover {
	box-shadow: 0 24px 50px -16px rgba(17, 24, 39, 0.30), 0 3px 8px -2px rgba(17, 24, 39, 0.10);
}

/* ============================================================
 * PRESET 5 — FRAME: viền mảnh, góc vuông, danh mục in hoa
 * ============================================================ */
.sdg-style-frame .sdg-card {
	background-color: #ffffff;
	border: 1px solid #d9dde3;
	border-radius: 0;
}
.sdg-style-frame .sdg-media { border-radius: 0; }
.sdg-style-frame .sdg-body { padding: 16px 16px 18px; }
.sdg-style-frame .sdg-card:hover { border-color: #111827; }
.sdg-style-frame .sdg-desc {
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 12px;
	color: #8a8f98;
}

/* ============================================================
 * CĂN LỀ NỘI DUNG
 * ============================================================ */
.sdg-align-center .sdg-body { text-align: center; }
.sdg-align-center .sdg-head { justify-content: center; }
.sdg-align-right .sdg-body { text-align: right; }
.sdg-align-right .sdg-head { justify-content: flex-end; }

/* ============================================================
 * VỊ TRÍ NHÃN GÓC (mặc định trên-trái)
 * ============================================================ */
.sdg-badge-tr .sdg-badge { left: auto; right: 12px; }
.sdg-badge-bl .sdg-badge { top: auto; bottom: 12px; }
.sdg-badge-br .sdg-badge { top: auto; left: auto; right: 12px; bottom: 12px; }

/* ============================================================
 * TỐI ƯU MOBILE (mặc định 2 item / hàng)
 * ============================================================ */
@media (max-width: 767px) {
	.sdg-btn { font-size: 13px; }
	.sdg-title { font-size: 15px; }
	.sdg-price { font-size: 13px; }
	.sdg-desc { font-size: 13px; }
	.sdg-body { padding-top: 12px; }
	.sdg-style-boxed .sdg-body,
	.sdg-style-frame .sdg-body { padding: 12px 13px 14px; }
	.sdg-style-overlay .sdg-body { padding: 13px; }
	.sdg-style-elevated .sdg-card { padding: 7px; }
	.sdg-style-elevated .sdg-body { padding: 12px 6px 6px; }
	.sdg-badge { font-size: 11px; padding: 3px 9px; top: 9px; left: 9px; }
}

/* Máy rất nhỏ: cho tiêu đề & giá xuống dòng gọn gàng nếu chật */
@media (max-width: 479px) {
	.sdg-head { flex-wrap: wrap; gap: 2px 8px; }
	.sdg-price { font-size: 12.5px; }
}

/* ============================================================
 * Tôn trọng prefers-reduced-motion
 * ============================================================ */
@media (prefers-reduced-motion: reduce) {
	.sdg-card,
	.sdg-media-inner img,
	.sdg-overlay,
	.sdg-overlay .sdg-btn,
	.sdg-btn {
		transition: none !important;
	}
	.sdg-lift-yes .sdg-card:hover,
	.sdg-zoom-yes .sdg-card:hover .sdg-media-inner img,
	.sdg-card:hover .sdg-overlay .sdg-btn {
		transform: none !important;
	}
}
