/* =========================================================================
   Shop archive — /shop + trang danh mục sản phẩm
   Template: woocommerce/archive-product.php
   ========================================================================= */

.at-shop {
	--shop-orange: #f26522;
	--shop-orange-dark: #e04f16;
	--shop-orange-soft: #fff4ed;
	--shop-orange-line: #fed7c3;
	--shop-text: #181d27;
	--shop-text-2: #414651;
	--shop-muted: #667085;
	--shop-line: #eaecf0;
	--shop-bg: #f9fafb;
	--shop-dark: #0c111d;
	--shop-radius: 16px;
	--shop-shadow: 0 1px 2px rgba(16, 24, 40, .05);
	--shop-shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .16);
	--g-awareness: #2563eb;
	--g-awareness-bg: #eff6ff;
	--g-conversion: #ea580c;
	--g-conversion-bg: #fff7ed;
	--g-retention: #16a34a;
	--g-retention-bg: #f0fdf4;
	--g-referral: #7c3aed;
	--g-referral-bg: #f5f3ff;

	color: var(--shop-text);
	background: #fff;
	-webkit-font-smoothing: antialiased;
}

.at-shop *,
.at-shop *::before,
.at-shop *::after { box-sizing: border-box; }

.at-shop h1, .at-shop h2, .at-shop h3 {
	font-family: inherit;
	color: var(--shop-text);
	margin: 0;
	letter-spacing: -0.02em;
}
.at-shop p { margin: 0; }
.at-shop ul, .at-shop ol { margin: 0; padding: 0; list-style: none; }
.at-shop li { margin: 0; }
.at-shop button {
	font-family: inherit;
	text-transform: none;
	letter-spacing: normal;
	margin: 0;
	min-height: 0;
	line-height: 1.3;
}
.at-shop .at-shop-ico { flex-shrink: 0; }

.at-shop-wrap {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ---------- Buttons ---------- */

.at-shop-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 22px;
	border-radius: 999px;
	border: 1px solid transparent;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.at-shop-btn:hover { text-decoration: none; }
.at-shop-btn:focus-visible { outline: 3px solid rgba(242, 101, 34, .35); outline-offset: 2px; }
.at-shop-btn--sm { min-height: 40px; padding: 0 16px; font-size: 14px; }

.at-shop-btn--primary { background: var(--shop-orange); color: #fff; box-shadow: 0 1px 2px rgba(224, 79, 22, .3); }
.at-shop-btn--primary:hover { background: var(--shop-orange-dark); color: #fff; }

.at-shop-btn--outline { background: #fff; color: var(--shop-text); border-color: #d0d5dd; }
.at-shop-btn--outline:hover { border-color: var(--shop-orange); color: var(--shop-orange-dark); }

.at-shop-btn--ghost { background: var(--shop-orange-soft); color: var(--shop-orange-dark); }
.at-shop-btn--ghost:hover { background: #ffe6d5; color: var(--shop-orange-dark); }

.at-shop-btn--light { background: #fff; color: var(--shop-text); }
.at-shop-btn--light:hover { background: var(--shop-orange-soft); color: var(--shop-orange-dark); }

.at-shop-btn--on-dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.at-shop-btn--on-dark:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, .08); }

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

.at-shop-hero {
	position: relative;
	overflow: hidden;
	padding: 28px 0 48px;
	background:
		radial-gradient(900px 420px at 100% 0%, #ffe6d5 0%, rgba(255, 230, 213, 0) 60%),
		linear-gradient(180deg, #fff8f3 0%, #fff 100%);
	border-bottom: 1px solid var(--shop-line);
}
.at-shop-hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: 48px;
	align-items: center;
}

.at-shop-crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 28px;
	font-size: 14px;
	color: var(--shop-muted);
}
.at-shop-crumbs a { color: var(--shop-muted); }
.at-shop-crumbs a:hover { color: var(--shop-orange-dark); }
.at-shop-crumbs__sep { color: #d0d5dd; }

.at-shop-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	background: #fff;
	border: 1px solid var(--shop-orange-line);
	color: var(--shop-orange-dark);
	font-size: 13px;
	font-weight: 600;
}
.at-shop-hero__title {
	margin-top: 16px !important;
	font-size: 44px;
	line-height: 1.15;
	font-weight: 700;
}
.at-shop-hero__lede {
	margin-top: 16px !important;
	max-width: 560px;
	font-size: 18px;
	line-height: 1.6;
	color: var(--shop-text-2);
}
.at-shop-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 28px;
}

.at-shop-hero__goals {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}
.at-shop-goal-tile {
	height: 100%;
	color: inherit;
	text-decoration: none;
	transition: border-color .15s, box-shadow .15s, transform .15s;
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 20px;
	background: #fff;
	border: 1px solid var(--shop-line);
	border-radius: var(--shop-radius);
	box-shadow: var(--shop-shadow);
}
.at-shop-goal-tile:hover {
	color: inherit;
	text-decoration: none;
	border-color: var(--g-c);
	box-shadow: var(--shop-shadow-lg);
	transform: translateY(-2px);
}
.at-shop-goal-tile.is-empty { opacity: .55; pointer-events: none; box-shadow: none; }
.at-shop-goal-tile:focus-visible { outline: 3px solid rgba(242, 101, 34, .35); outline-offset: 2px; }
.at-shop-goal-tile__count {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 6px;
	font-size: 13px;
	font-style: normal;
	font-weight: 600;
	color: var(--g-c);
}

.at-shop-goal-tile__ico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	flex-shrink: 0;
	color: var(--g-c);
	background: var(--g-bg);
}
.at-shop-goal-tile__text { display: flex; flex-direction: column; gap: 4px; }
.at-shop-goal-tile__text strong { font-size: 16px; line-height: 1.3; color: var(--shop-text); }
.at-shop-goal-tile__text small { font-size: 13px; line-height: 1.45; color: var(--shop-muted); }

.at-goal--awareness  { --g-c: var(--g-awareness);  --g-bg: var(--g-awareness-bg); }
.at-goal--conversion { --g-c: var(--g-conversion); --g-bg: var(--g-conversion-bg); }
.at-goal--retention  { --g-c: var(--g-retention);  --g-bg: var(--g-retention-bg); }
.at-goal--referral   { --g-c: var(--g-referral);   --g-bg: var(--g-referral-bg); }

/* ---------- Catalog ---------- */

.at-shop-catalog {
	padding: 40px 0 64px;
	background: var(--shop-bg);
}

.at-shop-toolbar { padding-bottom: 20px; border-bottom: 1px solid var(--shop-line); }

.at-shop-subbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 16px;
	margin: 20px 0 24px;
}

.at-shop-tabs {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 2px;
	margin: -2px;
}
.at-shop-tabs::-webkit-scrollbar { display: none; }

.at-shop .at-shop-tab {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	height: 42px;
	padding: 0 16px;
	border-radius: 999px;
	border: 1px solid #d0d5dd;
	background: #fff;
	color: var(--shop-text-2);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
}
.at-shop .at-shop-tab .at-shop-ico { color: var(--g-c, currentColor); }
.at-shop .at-shop-tab:hover { border-color: var(--g-c, var(--shop-orange)); color: var(--shop-text); }
.at-shop .at-shop-tab:focus-visible { outline: 3px solid rgba(242, 101, 34, .35); outline-offset: 2px; }
.at-shop-tab__count {
	min-width: 22px;
	padding: 2px 7px;
	border-radius: 999px;
	background: #f2f4f7;
	color: var(--shop-muted);
	font-size: 12px;
	font-weight: 600;
	text-align: center;
}
.at-shop .at-shop-tab.is-active {
	background: var(--shop-text);
	border-color: var(--shop-text);
	color: #fff;
}
.at-shop .at-shop-tab.is-active .at-shop-ico { color: #fff; }
.at-shop .at-shop-tab.is-active .at-shop-tab__count { background: rgba(255, 255, 255, .18); color: #fff; }

.at-shop-filters { display: flex; flex-wrap: wrap; gap: 10px; }

.at-shop-select { position: relative; margin: 0; }
.at-shop-select .woocommerce-ordering { margin: 0 !important; float: none; }
.at-shop-select select {
	height: 42px;
	margin: 0;
	padding: 0 38px 0 14px;
	min-width: 190px;
	max-width: 260px;
	border: 1px solid #d0d5dd;
	border-radius: 10px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 16px;
	box-shadow: var(--shop-shadow);
	color: var(--shop-text-2);
	font-size: 14px;
	font-weight: 500;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}
.at-shop-select select:focus { border-color: var(--shop-orange); outline: none; box-shadow: 0 0 0 3px rgba(242, 101, 34, .18); }

.at-shop-result {
	margin: 0 !important;
	font-size: 14px;
	color: var(--shop-muted);
}
.at-shop-result strong { color: var(--shop-text); }

/* ---------- Grid & card ---------- */

.at-shop-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}

.at-shop-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--shop-line);
	border-radius: var(--shop-radius);
	overflow: hidden;
	box-shadow: var(--shop-shadow);
	transition: box-shadow .2s, transform .2s, border-color .2s;
}
.at-shop-card:hover {
	transform: translateY(-3px);
	border-color: var(--shop-orange-line);
	box-shadow: var(--shop-shadow-lg);
}
.at-shop-card[hidden] { display: none; }

.at-shop-card__media {
	display: block;
	aspect-ratio: 1 / 1;
	background: #f2f4f7;
	overflow: hidden;
}
.at-shop .at-shop-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .4s ease;
}
.at-shop-card:hover .at-shop-card__img { transform: scale(1.03); }

/* Mỗi dòng nội dung có chiều cao cố định (cắt bớt chữ dư) để các thẻ cùng hàng thẳng hàng nhau */
.at-shop-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 18px 18px 20px;
}

.at-shop-card__badges {
	display: flex;
	flex-wrap: nowrap;
	gap: 6px;
	height: 24px;
	overflow: hidden;
}
.at-shop-badge {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	gap: 5px;
	height: 24px;
	padding: 0 9px;
	border-radius: 999px;
	background: #f2f4f7;
	color: var(--shop-text-2);
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}
.at-shop-badge[class*="at-goal--"] { background: var(--g-bg); color: var(--g-c); }
.at-shop-badge.is-primary { box-shadow: inset 0 0 0 1px currentColor; }

.at-shop .at-shop-card__title {
	margin: 12px 0 0 !important;
	font-size: 17px;
	line-height: 1.4;
	font-weight: 700;
	height: 2.8em; /* luôn chiếm đúng 2 dòng */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.at-shop-card__title a { color: inherit; text-decoration: none; }
.at-shop-card__title a:hover { color: var(--shop-orange-dark); }
.at-shop-card__title a::after {
	/* Cả thẻ bấm được, nút hành động vẫn nằm trên lớp này */
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.at-shop .at-shop-card__desc {
	margin: 8px 0 16px !important;
	font-size: 14px;
	line-height: 1.55;
	height: 4.65em; /* luôn chiếm đúng 3 dòng */
	color: var(--shop-muted);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.at-shop-card__price {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: auto;
	padding-top: 14px;
	border-top: 1px dashed var(--shop-line);
}
.at-shop-card__price-label { font-size: 12px; line-height: 18px; color: var(--shop-muted); }
.at-shop-card__price-value {
	font-size: 17px;
	line-height: 24px;
	font-weight: 700;
	color: var(--shop-orange-dark);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.at-shop-card__price-value .woocommerce-Price-amount { color: inherit; }
.at-shop-card__price-note {
	min-height: 20px;
	font-size: 13px;
	line-height: 20px;
	color: var(--shop-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.at-shop-card__actions {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
	margin-top: 16px;
}
.at-shop-card__actions .at-shop-btn--sm { padding: 0 14px; }

.at-shop-empty {
	padding: 48px 24px;
	text-align: center;
	background: #fff;
	border: 1px dashed #d0d5dd;
	border-radius: var(--shop-radius);
	color: var(--shop-muted);
}
.at-shop-empty[hidden] { display: none; }
.at-shop-empty p { margin-bottom: 16px !important; }

.at-shop .woocommerce-pagination { margin-top: 32px; }

/* ---------- Process ---------- */

.at-shop-process { padding: 64px 0; background: #fff; }
.at-shop-section-title {
	font-size: 30px;
	line-height: 1.25;
	font-weight: 700;
	text-align: center;
}
.at-shop-steps {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
	margin-top: 36px !important;
	counter-reset: none;
}
.at-shop-step {
	position: relative;
	padding: 24px;
	border-radius: var(--shop-radius);
	background: var(--shop-bg);
	border: 1px solid var(--shop-line);
}
.at-shop-step__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--shop-orange);
	color: #fff;
	font-weight: 700;
	font-size: 15px;
}
.at-shop-step strong { display: block; margin-top: 16px; font-size: 17px; color: var(--shop-text); }
.at-shop-step p { margin-top: 6px !important; font-size: 14px; line-height: 1.55; color: var(--shop-muted); }

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

.at-shop-cta { padding: 0 0 72px; background: #fff; }
.at-shop-cta__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
	padding-top: 44px;
	padding-bottom: 44px;
	border-radius: 24px;
	background:
		radial-gradient(600px 300px at 100% 100%, rgba(242, 101, 34, .45) 0%, rgba(242, 101, 34, 0) 70%),
		var(--shop-dark);
	color: #fff;
}
.at-shop-cta .at-shop-wrap.at-shop-cta__inner { padding-left: 48px; padding-right: 48px; max-width: 1232px; }
.at-shop .at-shop-cta__title { color: #fff; font-size: 28px; line-height: 1.3; font-weight: 700; }
.at-shop-cta__text { margin-top: 10px !important; max-width: 620px; color: #d0d5dd; font-size: 16px; line-height: 1.6; }
.at-shop-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; flex-shrink: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
	.at-shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
	.at-shop-hero__inner { grid-template-columns: 1fr; gap: 32px; }
	.at-shop-hero__goals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.at-shop-goal-tile { flex-direction: column; gap: 12px; }
	.at-shop-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
	.at-shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
	.at-shop-hero__goals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.at-shop-goal-tile { flex-direction: row; }
	.at-shop-cta__inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
	.at-shop-wrap { padding: 0 16px; }
	.at-shop-hero { padding: 16px 0 32px; }
	.at-shop-crumbs { margin-bottom: 18px; }
	.at-shop-hero__title { font-size: 30px; }
	.at-shop-hero__lede { font-size: 16px; }
	.at-shop-hero__actions .at-shop-btn { flex: 1 1 100%; }
	/* Trên mobile, tab lọc mục tiêu đã thay vai trò của các ô này */
	.at-shop-hero__goals { display: none; }
	.at-shop-hero__actions { margin-top: 22px; }

	.at-shop-catalog { padding: 28px 0 44px; }
	.at-shop-toolbar { padding-bottom: 16px; }
	.at-shop-subbar { margin: 16px 0 18px; }
	.at-shop-tabs { width: calc(100% + 32px); margin: -2px -16px; padding: 2px 16px; }
	.at-shop-filters { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
	.at-shop-select select { min-width: 0; width: 100%; max-width: none; }
	.at-shop-filters > :only-child { grid-column: 1 / -1; }

	.at-shop-grid { grid-template-columns: 1fr; gap: 16px; }

	.at-shop-process { padding: 44px 0; }
	.at-shop-section-title { font-size: 24px; }
	.at-shop-steps { grid-template-columns: 1fr; gap: 12px; margin-top: 24px !important; }
	.at-shop-step { display: grid; grid-template-columns: 36px 1fr; column-gap: 14px; padding: 18px; }
	.at-shop-step__num { grid-row: span 2; }
	.at-shop-step strong { margin-top: 6px; }

	.at-shop-cta { padding-bottom: 48px; }
	.at-shop-cta .at-shop-wrap.at-shop-cta__inner { margin: 0 16px; padding: 32px 22px; border-radius: 20px; }
	.at-shop .at-shop-cta__title { font-size: 22px; }
	.at-shop-cta__actions, .at-shop-cta__actions .at-shop-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.at-shop-card, .at-shop .at-shop-card__img { transition: none; }
	.at-shop-card:hover { transform: none; }
	.at-shop-card:hover .at-shop-card__img { transform: none; }
}
