/* ============================================================
   หน้าสินค้า — ดีไซน์ใหม่
   ใช้กับ widget-product.php และ page-product.php
   ============================================================ */

/* ---------- แถบแนะนำร้าน (หน้าแรก) ---------- */
.pm-hero {
	background: radial-gradient(ellipse at top, #1c1c1c 0%, #000 70%);
	padding: 45px 0 50px;
	border-bottom: 4px solid #FFE500;
}

.pm-hero__inner {
	max-width: 940px;
	margin: 0 auto;
	text-align: center;
}

/* กล่องครอบโลโก้
   แผ่นรองสีขาวใส่ไว้ที่กล่องนี้ ไม่ได้ใส่ลงบน <img> โดยตรง
   เพราะธีมมีกฎจัดการ img อยู่หลายจุด อาจไปทับกันได้ */
/* จัดกึ่งกลางด้วย width:fit-content + margin auto
   ไม่พึ่ง text-align:center ที่สืบทอดมาจากตัวแม่
   เพราะธีมมีกฎ text-align อยู่หลายจุด อาจไปทับกันแล้วรูปเบี้ยวไปทางซ้าย */
.pm-hero__logo-wrap {
	display: block;
	width: fit-content;
	max-width: 100%;
	box-sizing: border-box;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 24px;
	line-height: 0;
	text-align: center;
}

/* คุมขนาดด้วย "ความสูง" ควบคู่ความกว้าง
   รองรับทั้งโลโก้แนวนอนยาว ๆ และโลโก้ทรงสี่เหลี่ยม/วงกลม */
/* หมายเหตุ : ห้ามใช้ max-width เป็น % หรือ min() ที่มี % ตรงนี้
   เพราะกล่องครอบเป็น inline-block ที่ความกว้างขึ้นกับรูป
   จะกลายเป็นการอ้างอิงวนกัน แล้วรูปจะยุบเหลือ 0 พิกเซล
   ใช้หน่วย px ตรง ๆ แล้วให้กล่องครอบเป็นตัวคุมไม่ให้ล้นจอแทน */
.pm-hero__logo {
	display: block;
	width: auto;
	max-width: 560px;
	height: auto;
	max-height: 300px;
	object-fit: contain;
	margin: 0 auto;   /* กันไว้อีกชั้น เผื่อเบราว์เซอร์เก่าไม่รองรับ fit-content */
}

/* เงาบาง ๆ ให้โลโก้ลอยจากพื้นดำเล็กน้อย */
.pm-hero__logo {
	filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .55));
}

.pm-hero__title {
	margin: 0 0 20px;
	color: #FFE500;
	font-size: 25px;
	font-weight: 600;
	line-height: 1.65;
}

.pm-hero__tel {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px 14px;
	margin-bottom: 22px;
	color: #cfcfcf;
	font-size: 17px;
}

.pm-hero__tel a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: rgba(255, 229, 0, .1);
	border: 1px solid rgba(255, 229, 0, .45);
	color: #FFE500 !important;
	border-radius: 30px;
	padding: 8px 22px;
	font-size: 20px;
	font-weight: 700;
	text-decoration: none !important;
	transition: all .2s ease;
}

.pm-hero__tel a:hover {
	background: #FFE500;
	color: #202020 !important;
	transform: translateY(-2px);
}

.pm-hero__owner { color: #9a9a9a; font-size: 15.5px; }

.pm-hero__desc {
	margin: 0 auto !important;
	max-width: 860px;
	color: #cdcdcd !important;
	font-size: 16px;
	line-height: 1.95 !important;
	text-align: left;
}

@media (max-width: 767px) {
	.pm-hero { padding: 30px 0 34px; }
	.pm-hero__logo-wrap { margin-bottom: 16px; }
	.pm-hero__logo { max-width: 280px; max-height: 180px; }
	.pm-hero__title { font-size: 19px; margin-bottom: 16px; }
	.pm-hero__tel { font-size: 15px; margin-bottom: 18px; }
	.pm-hero__tel a { font-size: 17px; padding: 7px 18px; }
	.pm-hero__desc { font-size: 14.5px; line-height: 1.85 !important; }
}

/* ---------- หัวข้อหมวด ---------- */
.pm-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 22px;
}

.pm-head__title {
	position: relative;
	margin: 0;
	padding-bottom: 10px;
	font-size: 26px;
	line-height: 1.35;
	color: #0066CF;
	font-weight: 700;
}

/* ขีดสีเหลืองใต้หัวข้อ */
.pm-head__title:after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 54px;
	height: 4px;
	border-radius: 4px;
	background: #FFE500;
}

.pm-head__sub {
	margin: 8px 0 0;
	color: #7a7a7a;
	font-size: 14.5px;
	line-height: 1.7;
	max-width: 780px;
}

/* ปุ่มของแอดมิน ชิดขวาเสมอ แม้ไม่มีหัวข้อ */
.pm-head__admin { margin-left: auto; }

.pm-head__count {
	display: inline-block;
	background: #eef5fc;
	color: #0066CF;
	border-radius: 20px;
	padding: 3px 13px;
	font-size: 13.5px;
	font-weight: 700;
	margin-left: 6px;
}

/* ---------- กริดสินค้า ---------- */
.pm-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 22px;
}

@media (max-width: 1199px) { .pm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 991px)  { .pm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } }
@media (max-width: 575px)  { .pm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

.pm-grid--home { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 991px) { .pm-grid--home { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- การ์ดสินค้า ---------- */
.pm-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 14px;
	overflow: hidden;
	height: 100%;
	text-decoration: none !important;
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.pm-card:hover,
.pm-card:focus-visible {
	transform: translateY(-6px);
	box-shadow: 0 14px 30px rgba(0, 0, 0, .13);
	border-color: #FFE500;
}

.pm-card:focus-visible { outline: 3px solid #0088cc; outline-offset: 2px; }

/* ---------- รูปสินค้า ---------- */
.pm-card__media {
	position: relative;
	width: 100%;
	padding-top: 75%; /* สัดส่วน 4:3 กันภาพยืด */
	background: #f4f4f4;
	overflow: hidden;
}

.pm-card__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .45s ease;
}

.pm-card:hover .pm-card__img { transform: scale(1.07); }

/* ป้ายมุมรูป */
.pm-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	background: #FFE500;
	color: #202020;
	font-size: 12px;
	font-weight: 700;
	padding: 4px 11px;
	border-radius: 20px;
	box-shadow: 0 2px 6px rgba(0,0,0,.18);
}

/* ไอคอนแว่นขยายตอน hover */
.pm-card__zoom {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 102, 207, .35);
	opacity: 0;
	transition: opacity .25s ease;
}

.pm-card:hover .pm-card__zoom { opacity: 1; }

.pm-card__zoom i {
	width: 46px;
	height: 46px;
	line-height: 46px;
	text-align: center;
	border-radius: 50%;
	background: #fff;
	color: #0066CF;
	font-size: 16px;
}

/* ---------- เนื้อหาในการ์ด ---------- */
.pm-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 14px 15px 15px;
}

.pm-card__title {
	margin: 0 0 8px;
	font-size: 16px;
	line-height: 1.5;
	font-weight: 700;
	color: #1f2b3a;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 48px;
}

.pm-card:hover .pm-card__title { color: #0066CF; }

.pm-card__price {
	margin: 0 0 10px;
	font-size: 19px;
	font-weight: 700;
	color: #d9534f;
	line-height: 1.3;
}

.pm-card__price small { font-size: 13px; font-weight: 400; color: #888; }

.pm-card__price--ask {
	font-size: 15.5px;
	color: #1a9c4c;
}

.pm-card__excerpt {
	margin: 0 0 10px;
	font-size: 13.5px;
	line-height: 1.65;
	color: #767676;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pm-card__meta {
	margin-top: auto;
	padding-top: 10px;
	border-top: 1px dashed #ececec;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	font-size: 12.5px;
	color: #8c8c8c;
}

.pm-card__meta i { color: #b5b5b5; }

.pm-card__cta {
	margin-top: 12px;
	display: block;
	text-align: center;
	background: #0088cc;
	color: #fff;
	border-radius: 8px;
	padding: 9px 10px;
	font-size: 14.5px;
	font-weight: 700;
	transition: background .2s ease;
}

.pm-card:hover .pm-card__cta { background: #0066CF; }

/* ---------- ไม่มีสินค้า ---------- */
.pm-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 55px 20px;
	border: 2px dashed #dcdcdc;
	border-radius: 14px;
	background: #fafafa;
	color: #8c8c8c;
}

.pm-empty i { font-size: 40px; color: #ccc; margin-bottom: 12px; display: block; }

/* ---------- แถบติดต่อท้ายหน้า ---------- */
.pm-contact {
	margin-top: 32px;
	background: linear-gradient(135deg, #202020 0%, #333 100%);
	border-radius: 16px;
	padding: 28px 25px;
	color: #fff;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	box-shadow: 0 8px 26px rgba(0,0,0,.18);
}

.pm-contact__text { flex: 1 1 320px; }

.pm-contact__text h4 {
	margin: 0 0 6px;
	color: #FFE500;
	font-size: 22px;
	font-weight: 700;
}

.pm-contact__text p { margin: 0; color: #d8d8d8; font-size: 15px; }

.pm-contact__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.pm-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border-radius: 30px;
	padding: 11px 24px;
	font-size: 16px;
	font-weight: 700;
	text-decoration: none !important;
	transition: all .2s ease;
	white-space: nowrap;
}

.pm-btn--call { background: #FFE500; color: #202020 !important; }
.pm-btn--call:hover { background: #fff; transform: translateY(-2px); }

.pm-btn--line { background: #06C755; color: #fff !important; }
.pm-btn--line:hover { background: #05a648; transform: translateY(-2px); }

/* ---------- ตารางอัตราค่าบริการ ---------- */
.pm-price {
	border: 1px solid #ececec;
	border-radius: 12px;
	overflow: hidden;
}

.pm-price__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	background: #202020;
	color: #FFE500;
	padding: 13px 20px;
	font-size: 15.5px;
	font-weight: 700;
}

.pm-price__head span:last-child { flex: 0 0 auto; text-align: right; }

.pm-price__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	padding: 13px 20px;
	border-top: 1px solid #f0f0f0;
	transition: background .18s ease;
}

.pm-price__row:nth-child(even) { background: #fafafa; }
.pm-price__row:hover { background: #fff9d6; }

.pm-price__name {
	display: flex;
	align-items: center;
	gap: 11px;
	font-size: 15.5px;
	font-weight: 500;
	color: #2b2b2b;
	min-width: 0;
}

.pm-price__name i {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	line-height: 32px;
	text-align: center;
	border-radius: 8px;
	background: #eef5fc;
	color: #0066CF;
	font-size: 14px;
}

.pm-price__value {
	flex: 0 0 auto;
	text-align: right;
	font-size: 15.5px;
	font-weight: 700;
	color: #d9534f;
	white-space: nowrap;
}

.pm-price__value--free {
	color: #1a9c4c;
	background: #e8f7ee;
	border-radius: 20px;
	padding: 4px 14px;
	font-size: 14.5px;
}

.pm-price__note {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	padding: 18px 20px;
	border-top: 2px solid #FFE500;
	background: linear-gradient(135deg, #202020 0%, #333 100%);
	color: #fff;
}

.pm-price__note-text { flex: 1 1 300px; min-width: 0; }
.pm-price__note-text strong { display: block; color: #FFE500; font-size: 16.5px; margin-bottom: 2px; }
.pm-price__note-text span { color: #d3d3d3; font-size: 14.5px; }

@media (max-width: 575px) {
	.pm-price__head,
	.pm-price__row { padding: 11px 13px; font-size: 14px; }
	.pm-price__name { font-size: 14px; gap: 8px; }
	.pm-price__name i { width: 27px; height: 27px; line-height: 27px; font-size: 12px; }
	.pm-price__value { font-size: 14px; }
	.pm-price__note { padding: 16px 14px; text-align: center; justify-content: center; }
	.pm-price__note-text { flex: 1 1 100%; }
}

/* ---------- ปุ่ม "ดูทั้งหมด" ---------- */
.pm-more {
	text-align: center;
	margin-top: 26px;
}

.pm-more a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 2px solid #0088cc;
	color: #0088cc;
	border-radius: 30px;
	padding: 10px 30px;
	font-weight: 700;
	text-decoration: none !important;
	transition: all .2s ease;
}

.pm-more a:hover { background: #0088cc; color: #fff; }

/* ---------- มือถือ ---------- */
@media (max-width: 575px) {
	.pm-head__title { font-size: 21px; }
	.pm-card__body { padding: 11px 11px 12px; }
	.pm-card__title { font-size: 14px; min-height: 42px; margin-bottom: 6px; }
	.pm-card__price { font-size: 16px; }
	.pm-card__meta { font-size: 11.5px; gap: 3px 8px; }
	.pm-card__cta { font-size: 13px; padding: 8px; }
	.pm-contact { padding: 22px 18px; text-align: center; justify-content: center; }
	.pm-contact__actions { width: 100%; justify-content: center; }
	.pm-btn { flex: 1 1 100%; justify-content: center; }
}
