/* ============================================================================
   WPC AutoParts — หน้าบัญชีของฉัน (Phase C1.2)
   โหลดเฉพาะ is_account_page() · handle `wpc-account`

   🔴 namespace `wpc-acct-*` ทั้งไฟล์โดยตั้งใจ
      CSS 45,736 ไบต์ใน Customizer (DB, พิมพ์ท้าย <head> เสมอ) จับคลาสเก่าไว้ด้วย
      `!important` ทุกกฎ 6 ส่วน (PROFILE CARD / NAV / CONTENT / ORDERS TABLE /
      BUTTONS & FORMS / MOBILE) — พอชื่อไม่ชนกันก็ไม่ต้องแข่ง specificity เลย
      และไม่ต้องแตะ DB (DB = มือตะวัน)

   ⚠️ กฎที่ต้องสู้จริงมีเฉพาะคลาสของ WooCommerce เองที่เลี่ยงชื่อไม่ได้ — อยู่ท้ายไฟล์
   ⚠️ จุดตัดมือถือใช้ 768.98px ให้ตรงธีม (DB ใช้ 768px — มีช่วงคาบเกี่ยว 0.98px)
   ⚠️ ตัวแปรสีมีค่าสำรองเสมอ เพราะ --wpc ถูกประกาศไว้ใน Customizer CSS (DB)
      ถ้าวันหลังก้อนนั้นถูกล้าง หน้านี้ต้องไม่กลายเป็นขาวดำ
   ========================================================================= */

.wpc-acct {
	--acct: var(--wpc, #ec5a31);
	--acct-dk: var(--wpc-dk, #c94520);
	--acct-lt: var(--wpc-lt, #fff3ef);
	--acct-line: #f0f0f0;
	--acct-ink: #1a1a1a;
	--acct-mute: #888;

	display: flex;
	flex-direction: column;
	gap: 14px;
	font-family: Prompt, Arial, sans-serif;
	color: var(--acct-ink);
}

/* ── การ์ดโปรไฟล์ ─────────────────────────────────────────────────────── */

.wpc-acct-profile {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px;
	border: 1px solid #eaeaea;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(17, 17, 17, 0.04), 0 4px 14px rgba(17, 17, 17, 0.06);
	color: #222;
	/* กันเบราว์เซอร์บังคับโหมดมืดแล้วสีเพี้ยน (บทเรียน §15 ข้อ 9) */
	color-scheme: only light;
}

.wpc-acct-profile__avatar img {
	display: block;
	width: 56px;
	height: 56px;
	border: 1px solid #eaeaea;
	border-radius: 50%;
	background: #fdece3;
	object-fit: cover;
}

.wpc-acct-profile__text {
	flex: 1 1 auto;
	min-width: 0;
}

.wpc-acct-profile__hello {
	color: #6b6b6b;
	font-size: 12px;
	line-height: 1.25;
}

.wpc-acct-profile__name {
	margin-top: 1px;
	overflow-wrap: anywhere;
	color: #222;
	font-weight: 600;
	font-size: 16px;
	line-height: 1.35;
}

.wpc-acct-profile__meta {
	margin-top: 3px;
	overflow-wrap: anywhere;
	color: #6b6b6b;
	font-size: 12px;
	line-height: 1.4;
}

/* ป้าย "เชื่อมต่อ LINE แล้ว" — เดิมเป็นสีขาวโปร่งบนการ์ดส้ม ตอนนี้การ์ดเป็นสีขาวแล้ว */
.wpc-acct-profile__tag {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-top: 6px;
	padding: 2px 9px;
	border: 1px solid #d7efd9;
	border-radius: 20px;
	background: #f3fbf3;
	color: #2e7d32;
	-webkit-text-fill-color: #2e7d32;
	font-size: 11px;
}

.wpc-acct-profile__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #22c55e;
}

/* ปุ่ม "แก้ไขข้อมูล" ตาม prototype — ปุ่มเส้นขอบบาง ไม่ใช่ปุ่มทึบ */
.wpc-acct-profile__edit {
	flex-shrink: 0;
	align-self: center;
	padding: 6px 12px;
	border: 1px solid #eaeaea;
	border-radius: 8px;
	color: #3a3a3a;
	font-weight: 500;
	font-size: 12px;
	line-height: 1.4;
	white-space: nowrap;
	text-decoration: none;
}

.wpc-acct-profile__edit:hover {
	background: #f7f7f7;
	color: var(--acct, #ec5a31);
}

/* ── หัวข้อแต่ละส่วน ──────────────────────────────────────────────────── */

.wpc-acct-section {
	background: #fff;
	border: 1px solid var(--acct-line);
	border-radius: 14px;
	padding: 14px;
}

.wpc-acct-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
}

.wpc-acct-section__title {
	font-size: 15px;
	font-weight: 700;
}

.wpc-acct-section__more {
	font-size: 13px;
	color: var(--acct);
	text-decoration: none;
	flex-shrink: 0;
}

.wpc-acct-section__more::after { content: " ›"; }

/* ── แถบสถานะ 4 ช่อง ─────────────────────────────────────────────────── */

/* [28 ส.ค.] ไทล์สถานะมี 3 โหมดตาม prototype (วัดจากของจริง ไม่ได้เดา):
     มือถือ  ≤767   flex + overflow-x:auto · ช่องกว้างตายตัว 72px → **เลื่อนแนวนอน ไม่บีบ**
     แท็บเล็ต 768–1199  grid 3 คอลัมน์ → 2 แถว แถวละ 3
     จอใหญ่  ≥1200   แถวเดียว 6 ช่อง ยืดเท่ากัน
   (prototype ใช้ 64px บนมือถือ แต่ป้ายไทยของเรายาวกว่า จึงเป็น 72px) */
.wpc-acct-tabs {
	display: flex;
	align-items: stretch;
	gap: 4px;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.wpc-acct-tabs::-webkit-scrollbar { display: none; }

.wpc-acct-tabs > .wpc-acct-tab {
	flex: 0 0 72px;   /* ไม่ยืด ไม่หด — ตัวที่เกินขอบให้เลื่อนเอา */
	min-width: 0;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
	.wpc-acct-tabs {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 6px;
		overflow-x: visible;
	}

	.wpc-acct-tabs > .wpc-acct-tab {
		flex: initial;
	}
}

@media (min-width: 1200px) {
	.wpc-acct-tabs {
		overflow-x: visible;
	}

	.wpc-acct-tabs > .wpc-acct-tab {
		flex: 1 1 0;
	}
}

.wpc-acct-tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 10px 2px;
	text-decoration: none;
	color: var(--acct-ink);
	border-radius: 10px;
	transition: background 0.15s;
}

.wpc-acct-tab:hover { background: var(--acct-lt); }

/* prototype: ไอคอน 19px อยู่กลางวงกลมส้มอ่อน 40px · ป้ายเลขเกาะมุมขวาบนของวงกลม */
.wpc-acct-tab__icon {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #fff3ec;
	color: var(--acct);
	line-height: 0;
}

/* ตัวสร้างไอคอนพ่น width/height 24 มาใน attribute — ต้องทับด้วย CSS */
.wpc-acct-tab__icon > svg {
	width: 19px;
	height: 19px;
}

.wpc-acct-tab__badge {
	position: absolute;
	top: -6px;
	right: -8px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 9px;
	background: #e53935;
	border: 1.5px solid #fff;
	color: #fff;
	-webkit-text-fill-color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 14px;
	text-align: center;
	color-scheme: only light;
}

.wpc-acct-tab__label {
	font-size: 11.5px;
	text-align: center;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

/* ── การ์ดออเดอร์ ────────────────────────────────────────────────────── */

.wpc-acct-orders {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wpc-acct-order-card {
	border: 1px solid var(--acct-line);
	border-radius: 12px;
	padding: 12px 14px;
	background: #fff;
}

.wpc-acct-order-card__head {
	padding-bottom: 8px;
	margin-bottom: 8px;
	border-bottom: 1px solid #f5f5f5;
}

.wpc-acct-order-card__no {
	font-size: 13.5px;
	font-weight: 600;
}

.wpc-acct-order-card__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 3px 0;
	font-size: 13px;
}

.wpc-acct-order-card__label {
	color: var(--acct-mute);
	flex-shrink: 0;
}

.wpc-acct-order-card__value {
	text-align: right;
	min-width: 0;
}

.wpc-acct-order-card__foot {
	display: flex;
	justify-content: flex-end;
	margin-top: 10px;
}

.wpc-acct-btn {
	display: inline-block;
	padding: 7px 18px;
	border: 1.5px solid var(--acct);
	border-radius: 8px;
	background: #fff;
	color: var(--acct);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.wpc-acct-btn:hover {
	background: var(--acct);
	color: #fff;
}

/* ── ป้ายสถานะ ───────────────────────────────────────────────────────── */

.wpc-acct-pill {
	display: inline-block;
	padding: 3px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	color-scheme: only light;
}

.wpc-acct-pill--done   { background: #eaf3de; color: #3b6d11; }
.wpc-acct-pill--active { background: #e6f1fb; color: #185fa5; }
/* "กำลังจัดส่ง" ต้องมีสีของตัวเอง — ถ้าใช้เขียวเหมือน "จัดส่งแล้ว" ลูกค้าแยกไม่ออก
   เวลาเห็น 2 สถานะพร้อมกันในรายการเดียว (เจอตอนเทสจริงบน staging 12 ส.ค.) */
.wpc-acct-pill--ship   { background: #e8e6f7; color: #40308f; }
.wpc-acct-pill--wait   { background: #faeeda; color: #854f0b; }
.wpc-acct-pill--dead   { background: #fcebeb; color: #a32d2d; }

/* ── แถบบอกว่ากำลังกรอง ──────────────────────────────────────────────── */

.wpc-acct-filter {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
	padding: 8px 12px;
	background: var(--acct-lt);
	border: 1px solid var(--acct);
	border-radius: 10px;
	font-size: 13px;
}

.wpc-acct-filter__clear {
	color: var(--acct);
	text-decoration: underline;
	flex-shrink: 0;
}

/* ── ยังไม่มีออเดอร์ ─────────────────────────────────────────────────── */

.wpc-acct-empty {
	padding: 22px 14px;
	text-align: center;
	color: var(--acct-mute);
	font-size: 13.5px;
}

/* ── จอใหญ่จริง (คอลัมน์เนื้อหา ≥ ~770px) ────────────────────────────── */

/* 1150 มาจากการวัด ไม่ได้ตั้งลอย ๆ: คอลัมน์เนื้อหาจะกลับมากว้างเกิน 738px
   (เท่าที่จอ 768 เคยได้) ก็ต่อเมื่อจอกว้างประมาณ 1120 ขึ้นไป — เผื่อไว้ที่ 1150 */
@media (min-width: 1150px) {
	.wpc-acct { gap: 16px; }

	.wpc-acct-profile { padding: 16px; }
	.wpc-acct-profile__name { font-size: 17px; }

	.wpc-acct-section { padding: 18px; }
	.wpc-acct-tab__label { font-size: 13px; }

	.wpc-acct-order-card__row { font-size: 13.5px; }
}

/* ============================================================================
   สู้กับกฎที่จับคลาสของ WooCommerce เอง (เลี่ยงชื่อไม่ได้)
   ทุกกฎในบล็อกนี้ต้องชนะ Customizer CSS ที่เป็น !important — ยกระดับ specificity
   ให้**ชนะจริง** ไม่ใช่แค่เท่ากัน (บทเรียน 3G ข้อ 1)
   ========================================================================= */

/* DB: `.woocommerce-MyAccount-content { padding: 0 !important }` — ไม่ขัดกัน ปล่อยไว้ */

/* กันกฎเหมารวม `.shop_table` ของ Customizer มาแต่งกล่องเราเป็นการ์ดซ้อนการ์ด
   (กฎตัวเดียวกับที่เคยทำ cart/checkout ชิดขอบ — CLAUDE.md §13) */
body.woocommerce-account .woocommerce-MyAccount-content .wpc-acct-order-card,
body.woocommerce-account .woocommerce-MyAccount-content .wpc-acct-section {
	box-shadow: none !important;
}

/* ============================================================================
   สมุดที่อยู่ (Phase C1.1)
   ========================================================================= */

.wpc-addr {
	--acct: var(--wpc, #ec5a31);
	--acct-dk: var(--wpc-dk, #c94520);
	--acct-lt: var(--wpc-lt, #fff3ef);
	--acct-line: #f0f0f0;
	--acct-mute: #888;
	font-family: Prompt, Arial, sans-serif;
	color: #1a1a1a;
}

.wpc-abook-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 14px;
}

.wpc-abook-head h2 { font-size: 17px; font-weight: 700; margin: 0; }

.wpc-abook-add,
.wpc-abook-back {
	font-size: 13px;
	color: var(--acct);
	text-decoration: none;
	flex-shrink: 0;
}

.wpc-abook-notice {
	padding: 10px 14px;
	margin-bottom: 12px;
	border-radius: 10px;
	background: #eaf7ef;
	border: 1px solid #a8d5b9;
	font-size: 13px;
	color-scheme: only light;
}

.wpc-abook-notice.is-error {
	background: #fcebeb;
	border-color: #e8a5a5;
	color: #a32d2d;
}

.wpc-abook-empty {
	padding: 22px 14px;
	text-align: center;
	color: var(--acct-mute);
	font-size: 13.5px;
	border: 1px dashed #ddd;
	border-radius: 12px;
}

/* ── การ์ดที่อยู่ ─────────────────────────────────────────────────────── */

.wpc-abook-list { display: flex; flex-direction: column; gap: 10px; }

.wpc-abook-card {
	border: 1px solid var(--acct-line);
	border-radius: 12px;
	padding: 12px 14px;
	background: #fff;
}

.wpc-abook-card.is-default { border-color: var(--acct); }

.wpc-abook-card__chips { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }

.wpc-abook-chip {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 20px;
	background: #f4f4f4;
	color: #555;
	font-size: 11px;
	color-scheme: only light;
}

.wpc-abook-chip--main { background: var(--acct); color: #fff; -webkit-text-fill-color: #fff; }

.wpc-abook-card__who { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.wpc-abook-card__name { font-weight: 600; font-size: 14px; }
.wpc-abook-card__phone { color: var(--acct-mute); font-size: 13px; }

.wpc-abook-card__text {
	margin-top: 5px;
	font-size: 13px;
	line-height: 1.55;
	color: #444;
}

.wpc-abook-card__acts {
	display: flex;
	gap: 16px;
	margin-top: 10px;
	padding-top: 9px;
	border-top: 1px solid #f5f5f5;
}

.wpc-abook-act { font-size: 13px; color: var(--acct); text-decoration: none; }
.wpc-abook-act--del { color: #c0392b; }

/* ── ฟอร์ม ───────────────────────────────────────────────────────────── */

.wpc-abook-form__group {
	background: #fff;
	border: 1px solid var(--acct-line);
	border-radius: 12px;
	padding: 14px;
	margin-bottom: 12px;
}

.wpc-abook-form__group h3 { font-size: 14px; font-weight: 700; margin: 0 0 10px; }

.wpc-abook-field { margin: 0 0 10px; }
.wpc-abook-field:last-child { margin-bottom: 0; }

.wpc-abook-field label {
	display: block;
	font-size: 13px;
	margin-bottom: 4px;
	color: #444;
}

.wpc-abook-field abbr { color: var(--acct); text-decoration: none; border: 0; }

.wpc-abook-field input,
.wpc-abook-field select {
	width: 100%;
	height: 44px;
	padding: 0 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	background: #fff;
	color-scheme: only light;
}

.wpc-abook-field input:focus,
.wpc-abook-field select:focus {
	border-color: var(--acct);
	box-shadow: 0 0 0 3px rgba(236, 90, 49, 0.1);
	outline: none;
}

.wpc-abook-types { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

.wpc-abook-type { cursor: pointer; }
.wpc-abook-type input { position: absolute; opacity: 0; pointer-events: none; }

.wpc-abook-type span {
	display: inline-block;
	padding: 7px 16px;
	border: 1.5px solid #ddd;
	border-radius: 20px;
	font-size: 13px;
	color-scheme: only light;
}

.wpc-abook-type input:checked + span {
	border-color: var(--acct);
	background: var(--acct-lt);
	color: var(--acct);
	font-weight: 600;
}

.wpc-abook-toggle { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.wpc-abook-toggle input { width: 18px; height: 18px; }

/* 🔴 ผูก body+button ให้ชนะกฎปุ่มของธีม — ไม่งั้นปุ่มหลักกลายเป็นพื้นส้มอ่อนตัวหนังสือดำ
   (เหตุผลเต็มอยู่ที่หัวข้อ dialog รีวิวด้านล่าง · เทส tests/test-theme-button-override.php) */
body.woocommerce-account button.wpc-abook-submit {
	width: 100%;
	height: 48px;
	min-height: 0;
	padding: 0 16px;
	border: 0;
	border-radius: 10px;
	background-color: var(--acct);
	color: #fff;
	-webkit-text-fill-color: #fff;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
	color-scheme: only light;
}

body.woocommerce-account button.wpc-abook-submit:hover { background-color: var(--acct-dk); }

/* ระหว่างรอฐานข้อมูลที่อยู่โหลด — บอกให้รู้ว่ายังกดไม่ได้ ไม่ใช่ค้าง */
.wpc-abook-form:not(.is-ready):not(.is-offline) select { opacity: 0.55; }

@media (min-width: 768.99px) {
	.wpc-abook-form__group { padding: 18px; }
	.wpc-abook-field input,
	.wpc-abook-field select { height: 42px; }
	body.woocommerce-account button.wpc-abook-submit { width: auto; min-width: 220px; padding: 0 32px; }
}

/* ============================================================
   สมุดที่อยู่: ฟอร์มเด้งเป็น dialog (Phase C2)
   ตะวันขอตามภาพ Shopee — จอคอมกล่องลอย · มือถือเต็มจอ ปุ่มยืนยันตรึงล่าง
   ============================================================ */

body.woocommerce-account dialog.wpc-abook-dialog {
	width: min(560px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100vh - 64px);
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: #fff;
	color: inherit;
	overflow: hidden auto;
	color-scheme: only light;   /* กัน force-dark ของ Android Chrome กลับสีจนอ่านไม่ออก */
}

body.woocommerce-account dialog.wpc-abook-dialog::backdrop {
	background: rgba(0, 0, 0, 0.45);
}

/* dialog ที่ยังไม่ถูกเปิด ต้องไม่กินที่บนหน้า (เบราว์เซอร์เก่าที่ไม่รู้จัก <dialog>) */
body.woocommerce-account dialog.wpc-abook-dialog:not([open]) { display: none; }

body.wpc-dialog-open { overflow: hidden; }

.wpc-abook-dialog__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px;
	border-bottom: 1px solid #f0f0f0;
	position: sticky;
	top: 0;
	background: #fff;
	z-index: 2;
}

.wpc-abook-dialog__head h3 { margin: 0; font-size: 16px; font-weight: 700; }

.wpc-abook-dialog__close {
	font-size: 18px;
	line-height: 1;
	color: var(--acct-mute);
	text-decoration: none;
	padding: 4px 8px;
}

body.woocommerce-account .wpc-abook-dialog .wpc-abook-form { padding: 16px 18px 0; }

/* ---------- กล่องแปะข้อมูลที่อยู่ ---------- */

.wpc-abook-paste {
	background: var(--acct-lt);
	border: 1px dashed var(--acct);
	border-radius: 10px;
	padding: 12px 14px;
	margin-bottom: 14px;
	color-scheme: only light;
}

.wpc-abook-paste > label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 2px; }

.wpc-abook-paste__hint { margin: 0 0 8px; font-size: 12.5px; color: var(--acct-mute); line-height: 1.5; }

.wpc-abook-paste__text {
	width: 100%;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	font-family: inherit;
	resize: vertical;
	background: #fff;
}

body.woocommerce-account button.wpc-abook-paste__go {
	margin-top: 8px;
	height: 38px;
	min-height: 0;
	padding: 0 18px;
	border: 1.5px solid var(--acct);
	border-radius: 8px;
	background-color: #fff;
	color: var(--acct);
	-webkit-text-fill-color: var(--acct);
	font-size: 13.5px;
	font-weight: 700;
	font-family: inherit;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
	color-scheme: only light;
}

body.woocommerce-account button.wpc-abook-paste__go:disabled { opacity: 0.6; cursor: default; }

.wpc-abook-paste__msg { display: block; margin-top: 8px; font-size: 12.5px; color: var(--acct-mute); }

/* ---------- แถวปุ่มท้ายฟอร์ม ---------- */

.wpc-abook-form__actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 14px;
	padding: 14px 0 18px;
	background: #fff;
}

.wpc-abook-cancel {
	font-size: 14px;
	color: var(--acct-mute);
	text-decoration: none;
	white-space: nowrap;
}

body.woocommerce-account .wpc-abook-form__actions button.wpc-abook-submit { width: auto; min-width: 180px; padding: 0 28px; }

@media (max-width: 768.98px) {
	body.woocommerce-account dialog.wpc-abook-dialog {
		width: 100vw;
		height: 100dvh;
		max-height: 100dvh;
		margin: 0;
		border-radius: 0;
	}

	/* ปุ่มยืนยันเห็นตลอดโดยไม่ต้องเลื่อน (ตามภาพมือถือของ Shopee) */
	body.woocommerce-account .wpc-abook-dialog .wpc-abook-form__actions {
		position: sticky;
		bottom: 0;
		padding: 12px 0 14px;
		box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
	}

	body.woocommerce-account .wpc-abook-form__actions button.wpc-abook-submit { flex: 1; min-width: 0; }
}

/* ============================================================
   หน้าคำสั่งซื้อแบบ marketplace (Phase C2)
   7 แท็บเลื่อนแนวนอน + การ์ดที่มีรูปสินค้า + ปุ่ม 3 ตัว
   ============================================================ */

/* [27 ส.ค.] เดิมที่นี่มีกฎ "แถวเลื่อนแนวนอนเมื่อมี 5 ช่องขึ้นไป" ไว้รองรับ 7 แท็บบนหน้า
   รายการคำสั่งซื้อ — หน้านั้นย้ายไปใช้ชิป (.wpc-acct-chips) แล้ว และหน้าแรกมี 6 ไทล์
   ที่ยืดเท่ากันทั้งแถว จึงไม่ต้องมีโหมดเลื่อนอีก */

.wpc-acct-tab.is-on {
	background: var(--acct-lt);
	box-shadow: inset 0 -2px 0 0 var(--acct);
}

.wpc-acct-tab.is-on .wpc-acct-tab__label { color: var(--acct); font-weight: 700; }

/* ---------- หัวการ์ด: ป้ายสถานะ + บรรทัดอธิบาย ---------- */

.wpc-acct-order-card__state {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.wpc-acct-order-card__hint { font-size: 12.5px; color: var(--acct-mute); }

/* ---------- แถวสินค้า ---------- */

.wpc-acct-order-card__items {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 12px 0;
	border-top: 1px solid #f2f2f2;
	border-bottom: 1px solid #f2f2f2;
}

.wpc-acct-item {
	display: grid;
	grid-template-columns: 56px 1fr auto;
	align-items: center;
	gap: 10px;
}

.wpc-acct-item__img { display: block; width: 56px; height: 56px; }

/* 🔴 ธีมตั้ง min-width ให้รูปในหลายที่ ซึ่งชนะ width เสมอ (บทเรียน §15 ข้อ 2) — ล้างทิ้งตรงนี้ */
body.woocommerce-account .wpc-acct-item__img img {
	width: 56px;
	min-width: 0;
	height: 56px;
	object-fit: cover;
	border-radius: 0;
	border: 1px solid #eee;
	display: block;
}

.wpc-acct-item__name {
	font-size: 13.5px;
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wpc-acct-item__qty { font-size: 13px; color: var(--acct-mute); white-space: nowrap; }

.wpc-acct-item__more { font-size: 12.5px; color: var(--acct-mute); padding-left: 66px; }

/* ---------- แถวยอดรวม ---------- */

.wpc-acct-order-card__sum {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	padding: 12px 0 4px;
}

.wpc-acct-order-card__date { font-size: 12.5px; color: var(--acct-mute); }

.wpc-acct-order-card__total { font-size: 14px; font-weight: 700; }

.wpc-acct-order-card__total .amount,
.wpc-acct-order-card__total bdi { color: var(--acct); font-size: 17px; }

/* ---------- ปุ่มท้ายการ์ด ---------- */

.wpc-acct-order-card__foot {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.wpc-acct-btn--primary {
	background: var(--acct);
	border-color: var(--acct);
	color: #fff;
	-webkit-text-fill-color: #fff;
	font-weight: 700;
	color-scheme: only light;
}

.wpc-acct-btn--primary:hover { background: var(--acct-dk); border-color: var(--acct-dk); }

/* ปุ่มรีวิวเป็น <button> — ต้องหน้าตาเท่าปุ่มลิงก์ข้าง ๆ */
button.wpc-acct-btn { font-family: inherit; cursor: pointer; }

@media (max-width: 768.98px) {
	.wpc-acct-item { grid-template-columns: 48px 1fr auto; }
	.wpc-acct-item__img,
	body.woocommerce-account .wpc-acct-item__img img { width: 48px; height: 48px; }
	.wpc-acct-item__more { padding-left: 58px; }
	.wpc-acct-order-card__foot > .wpc-acct-btn { flex: 1 1 auto; text-align: center; }
}

/* ============================================================
   dialog รีวิวจากหน้าคำสั่งซื้อ (Phase C2 ส่วน A)
   🔴 กติกาเดียวกับ dialog สมุดที่อยู่: จอคอมกล่องลอย · มือถือเต็มจอ
      + `color-scheme: only light` กัน force-dark ของ Android Chrome (บทเรียน 3G ข้อ 9)
   ============================================================ */

body.woocommerce-account dialog.wpc-orev-dialog {
	width: min(640px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100vh - 64px);
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: #fff;
	color: inherit;
	overflow: hidden;
	color-scheme: only light;
	display: none;
}

body.woocommerce-account dialog.wpc-orev-dialog[open] {
	display: flex;
	flex-direction: column;
}

body.woocommerce-account dialog.wpc-orev-dialog::backdrop { background: rgba( 0, 0, 0, 0.45 ); }

.wpc-orev-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	border-bottom: 1px solid #f0f0f0;
	flex: 0 0 auto;
}

.wpc-orev-title { margin: 0; font-size: 16px; font-weight: 700; }

/* ============================================================
   🔴 ปุ่มใน dialog รีวิว — ต้องผูก `body.woocommerce-account button.` เสมอ

   ธีมมีกฎเหมารวมใน `woodmart/css/parts/base.min.css`:
     :is(.btn,.button,button,[type=submit],[type=button]) {
         background-color: var(--btn-bgcolor);  → rgba(244,108,29,0.16) พื้นส้มอ่อน
         color:            var(--btn-color);    → rgb(28,28,28) เกือบดำ
         font-size: 13px · min-height: 42px · padding: 5px 20px · text-transform
     }
   `:is()` คิด specificity = คลาสเดียว (0,1,0) **เท่ากับกฎ `.wpc-xxx` ของเราเป๊ะ**
   และ CSS ปลั๊กอินถูก enqueue **ก่อน** base.min.css เสมอ
   (ลำดับจริง: global.css → account.css → base.min.css → xts-theme_settings)
   ⇒ เขียน `.wpc-xxx { }` เฉย ๆ = แพ้ทุกครั้ง ไม่ใช่ความบังเอิญ

   นี่คือต้นเหตุของทั้ง 4 ข้อที่คุณกานต์วงมา 31 ส.ค. (กากบาทจิ๋ว · ดาวขนาดไม่เท่า ·
   ดาวมีพื้นหลัง · ดาวสีดำ) — เรื่องเดียว ไม่ใช่ 4 เรื่อง
   เทสที่กันไว้: tests/test-theme-button-override.php (สแกนปุ่มจาก markup จริง)
   ============================================================ */

/* ✕ ปิด — ลูกค้าแจ้ง "ไม่ให้เล็กเกินไป" (ธีมกดเหลือ 13px ในกล่อง 45x42) */
body.woocommerce-account button.wpc-orev-x {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background-color: transparent;
	box-shadow: none;
	color: var( --acct-mute, #888 );
	-webkit-text-fill-color: var( --acct-mute, #888 );
	font-size: 26px;
	font-weight: 400;
	line-height: 1;
	text-transform: none;
	cursor: pointer;
}

body.woocommerce-account button.wpc-orev-x:hover {
	background-color: #f4f4f4;
	color: #333;
	-webkit-text-fill-color: #333;
}

/* เนื้อในเลื่อนได้ ปุ่มส่งอยู่กับที่เสมอ — ออเดอร์หลายชิ้นจะได้ไม่ต้องเลื่อนหาปุ่ม */
.wpc-orev-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 4px 18px 8px;
	-webkit-overflow-scrolling: touch;
}

.wpc-orev-loading { padding: 24px 0; text-align: center; color: var( --acct-mute, #888 ); }

.wpc-orev-item { padding: 16px 0; border-bottom: 1px solid #f2f2f2; }
.wpc-orev-item:last-child { border-bottom: 0; }

.wpc-orev-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }

.wpc-orev-thumb { flex: 0 0 auto; width: 56px; height: 56px; }
.wpc-orev-thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: 0; display: block; }

.wpc-orev-name { font-size: 14px; font-weight: 600; line-height: 1.35; }

/* ---------- ดาว ----------
   🔴 ห้ามใช้ป้าย/กลไกของธีม (`p.stars`) ที่นี่ — ธีมซ่อนข้อความด้วย font-size: 0
      แล้ววาดดาวจาก ::before ถ้าไปตั้ง font-size ทับจะปลุกข้อความที่ซ่อนไว้กลับมา
      (บทเรียน §20 รอบ 3) ดาวชุดนี้เป็นปุ่มของเราเอง ไม่เกี่ยวกับของธีม */

.wpc-orev-stars { display: flex; align-items: center; gap: 2px; }

/* ดาว — คำขอลูกค้า 31 ส.ค.: ขนาดเท่ากันทุกแถว · ไม่มีพื้นหลัง · ยังไม่เลือกเป็นดาวโปร่ง
   กดแล้วเป็นดาวทึบสีส้ม  (รูปดาวสลับ ☆ ↔ ★ ที่ account.js — ★ กับ ☆ กว้างเท่ากัน
   ในฟอนต์ Prompt ของเว็บ วัดแล้ว 21.67px ทั้งคู่ จึงไม่มีการกระตุกตอนกด) */
body.woocommerce-account button.wpc-orev-star {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 0 2px;
	border: 0;
	border-radius: 0;
	background-color: transparent;
	box-shadow: none;
	color: #d9d9d9;
	-webkit-text-fill-color: #d9d9d9;
	font-size: 26px;
	font-weight: 400;
	line-height: 1;
	text-transform: none;
	cursor: pointer;
}

body.woocommerce-account button.wpc-orev-star.is-on {
	color: #f5a623;
	-webkit-text-fill-color: #f5a623;
}

.wpc-orev-word { margin-left: 8px; font-size: 13px; color: #f5a623; font-weight: 600; }

.wpc-orev-crit {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 6px;
}

.wpc-orev-critlabel { font-size: 13px; color: var( --acct-mute, #777 ); }
/* [31 ส.ค.] เดิมบังคับดาวหัวข้อย่อย 20px — ตัดออกตามคำขอ "ขนาดเท่ากัน"
   (ของจริงที่ลูกค้าเห็นคือดาวหลัก 13px เพราะโดนธีมกด ส่วนแถวนี้รอดที่ 20px = กลับหัวกัน) */

.wpc-orev-text {
	width: 100%;
	margin-top: 10px;
	border: 1px solid #e3e3e3;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	resize: vertical;
	background: #fff;
}

/* ---------- แนบรูป ---------- */

.wpc-orev-imgs { margin-top: 10px; }
.wpc-orev-file { display: none; }

body.woocommerce-account button.wpc-orev-addimg {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 8px 14px;
	border: 1px dashed #cfcfcf;
	border-radius: 8px;
	background-color: #fafafa;
	color: #444;
	-webkit-text-fill-color: #444;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
}

.wpc-orev-addimg span { font-size: 16px; margin-right: 4px; }

.wpc-orev-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.wpc-orev-thumbs img { width: 64px; height: 64px; object-fit: cover; border: 1px solid #eee; }

.wpc-orev-imgnote { font-size: 12px; color: var( --acct-mute, #999 ); margin-top: 6px; }

.wpc-orev-itemmsg { margin-top: 8px; font-size: 13px; color: #c0392b; }

/* ---------- ท้ายกล่อง ---------- */

.wpc-orev-foot {
	flex: 0 0 auto;
	border-top: 1px solid #f0f0f0;
	padding: 12px 18px;
	background: #fff;
}

.wpc-orev-anon { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.wpc-orev-anon input { width: 18px; height: 18px; }

.wpc-orev-msg { font-size: 13px; color: var( --acct, #2f7d3a ); margin-top: 6px; min-height: 18px; }

.wpc-orev-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

body.woocommerce-account button.wpc-orev-cancel,
body.woocommerce-account button.wpc-orev-send {
	min-height: 40px;
	padding: 10px 18px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background-color: #fff;
	color: #333;
	-webkit-text-fill-color: #333;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
}

/* 🔴 [31 ส.ค.] ปุ่มนี้เคยหน้าตาเหมือนปุ่ม "ยกเลิก" เป๊ะ — ธีมทับพื้นเป็นส้มอ่อน+ตัวหนังสือดำ
   (ลูกค้ายังไม่ทัน แต่หนักกว่าที่ทักมา: ปุ่มหลักกับปุ่มรองแยกไม่ออก)
   ค่า fallback เดิมเป็น #2f7d3a สีเขียว = โค้ดตาย เพราะ --acct ผูกกับส้มของเว็บอยู่แล้ว */
body.woocommerce-account button.wpc-orev-send {
	border-color: var( --acct, #ec5a31 );
	background-color: var( --acct, #ec5a31 );
	color: #fff;
	-webkit-text-fill-color: #fff;
	font-weight: 700;
}

body.woocommerce-account button.wpc-orev-send:hover {
	background-color: var( --acct-dk, #c94520 );
}

body.woocommerce-account button.wpc-orev-send[disabled] { opacity: 0.6; cursor: default; }

/* ---------- มือถือเต็มจอ (จุดตัดเดียวกับทั้งโปรเจกต์) ---------- */

@media ( max-width: 768.98px ) {
	body.woocommerce-account dialog.wpc-orev-dialog {
		width: 100vw;
		max-width: 100vw;
		height: 100dvh;
		max-height: 100dvh;
		border-radius: 0;
		margin: 0;
	}

	.wpc-orev-actions .wpc-orev-send { flex: 1 1 auto; }
}

/* ============================================================
   ตารางรายละเอียดคำสั่งซื้อ (หน้า "คำสั่งซื้อ" → ดูรายละเอียด)

   🔴 ทำไมข้อความชิดขอบ: Customizer CSS ให้ระยะห่างเฉพาะ `thead th` กับ `tbody td`
      (`.woocommerce-orders-table tbody td, .shop_table tbody td { padding: 12px 16px !important }`)
      แต่แถวสรุปท้ายตาราง (รวม · ค่าจัดส่ง · วิธีชำระเงิน · บันทึก · ปุ่ม) อยู่ใน **`tfoot`**
      ซึ่งไม่มีกฎไหนแตะเลย → ป้ายซ้ายชิดขอบการ์ด 0px
      (ยืนยันจาก markup จริงของออเดอร์ #34711 บน staging ไม่ได้เดา)

   🔴 ต้องมี `!important` + specificity สูงกว่า เพราะกฎต้นทางเป็น !important
      (0,2,1) → ของเรา (0,3,3) = ชนะจริง ไม่ใช่แค่เท่ากัน (บทเรียน 3G ข้อ 1)
   ============================================================ */

body.woocommerce-account .woocommerce-order-details table.order_details thead th,
body.woocommerce-account .woocommerce-order-details table.order_details tbody th,
body.woocommerce-account .woocommerce-order-details table.order_details tbody td,
body.woocommerce-account .woocommerce-order-details table.order_details tfoot th,
body.woocommerce-account .woocommerce-order-details table.order_details tfoot td {
	padding: 14px 20px !important;
}

/* ป้ายชิดซ้าย · ตัวเลขชิดขวา — ให้แถวสรุปอ่านเป็นคู่กัน */
body.woocommerce-account .woocommerce-order-details table.order_details tfoot th {
	text-align: left !important;
	font-weight: 600 !important;
}

body.woocommerce-account .woocommerce-order-details table.order_details tfoot td {
	text-align: right !important;
}

/* ปุ่มในแถว "เลือกคำสั่ง" ไม่ให้ชนขอบขวา */
body.woocommerce-account .woocommerce-order-details table.order_details tfoot td .button {
	margin-left: 8px;
}

@media ( max-width: 768.98px ) {
	body.woocommerce-account .woocommerce-order-details table.order_details thead th,
	body.woocommerce-account .woocommerce-order-details table.order_details tbody th,
	body.woocommerce-account .woocommerce-order-details table.order_details tbody td,
	body.woocommerce-account .woocommerce-order-details table.order_details tfoot th,
	body.woocommerce-account .woocommerce-order-details table.order_details tfoot td {
		padding: 12px 16px !important;
	}
}

/* ============================================================
   ปุ่ม "ให้คะแนน" บนการ์ดออเดอร์ดูเหมือนถูก disable

   🔴 ต้นเหตุ: WoodMart มีกฎ `:is(.btn,.button,button,[type=submit],[type=button])`
      ที่ตั้ง `background-color: var(--btn-bgcolor, #F3F3F3)` + `color:#3E3E3E`
      + `min-height:42px` + `text-transform:uppercase`
      · `:is()` คิด specificity จากตัวที่แรงสุดในวงเล็บ = คลาส (0,1,0)
        **เท่ากับ `.wpc-acct-btn--primary` ของเราเป๊ะ** แล้ว CSS ธีมพิมพ์ทีหลัง → ธีมชนะ
      · ปุ่มอื่นบนการ์ดเป็น `<a>` จึงไม่โดน — โดนแค่ปุ่มรีวิวที่เป็น `<button>`
        (ตรงกับอาการ "ดูเหมือน disable แต่กดได้")

   ⚠️ ธีมใช้ `background-color` (longhand) → ของเราต้องเป็น longhand ด้วย
      ไม่งั้น shorthand `background` ที่อยู่คนละบรรทัดจะแพ้ลำดับ
   ============================================================ */

body.woocommerce-account button.wpc-acct-btn {
	background-color: #fff;
	color: var(--acct);
	-webkit-text-fill-color: var(--acct);
	border: 1.5px solid var(--acct);
	border-radius: 8px;
	padding: 7px 18px;
	min-height: 0;
	font-size: 13px;
	font-weight: 600;
	text-transform: none;
	line-height: 1.4;
}

body.woocommerce-account button.wpc-acct-btn--primary {
	background-color: var(--acct);
	color: #fff;
	-webkit-text-fill-color: #fff;
	border-color: var(--acct);
	font-weight: 700;
}

body.woocommerce-account button.wpc-acct-btn:hover {
	background-color: var(--acct);
	color: #fff;
	-webkit-text-fill-color: #fff;
}

body.woocommerce-account button.wpc-acct-btn--primary:hover {
	background-color: var(--acct-dk);
	border-color: var(--acct-dk);
}

/* ============================================================
   หน้า "ข้อมูลบัญชี" (/my-account/edit-myaccount/) ล้นขอบจอบนมือถือ

   🔴 ต้นเหตุ = ค่าเริ่มต้นของ **เบราว์เซอร์เอง** ไม่ใช่ธีมและไม่ใช่ Customizer
      `<fieldset>` มี UA default `min-inline-size: min-content` ซึ่ง **ชนะ `width`**
      (กฎ box model ตระกูลเดียวกับ `min-width` ของธีมที่เคยทำรูปตะกร้าเพี้ยน — บทเรียน §15 ข้อ 2
       ไม่เกี่ยวกับ specificity และ `!important` ก็ไม่ช่วย ต้องล้ม min-width ตรง ๆ)
      ป้ายไทยยาว ๆ อย่าง "รหัสผ่านปัจจุบัน (ปล่อยว่างไว้ ถ้าไม่ต้องการเปลี่ยน)" ไม่มีเว้นวรรค
      → min-content บวมค้างที่ 384px ไม่ย่อตามจอ · ธีมยังตั้ง `padding: 20px 40px` ทับอีก 80px

   วัดจริงบน staging ด้วย Playwright (ไม่ได้เดา · computed style ยืนยัน `min-width: min-content`):
      จอ 360 → กล่องกว้าง 384 ขอบขวาอยู่ที่ 399 = **ล้นออกนอกจอ 39px**
      จอ 390 → ล้น 9px · ตั้งแต่ 480 ขึ้นไปพอดีอยู่แล้ว
   ⚠️ **ไม่มี scrollbar แนวนอนให้เห็น** เพราะตัวครอบ clip ไว้ = เนื้อหาถูกตัดหาย ไม่ใช่แค่เลื่อนไปดูได้
      → เป็นเหตุผลที่การไล่หา "หน้าจอเลื่อนแนวนอนไหม" อย่างเดียวจะไม่มีวันเจอบั๊กตัวนี้

   ℹ️ ตรวจ Customizer CSS (45KB ใน DB) แล้ว — **ไม่มีกฎ `fieldset` เลยสักจุด**
      จึงไม่ต้องแข่ง specificity แต่ยังผูก `body.woocommerce-account` ไว้ให้ชนะธีมแน่ ๆ
   ============================================================ */

body.woocommerce-account .woocommerce-MyAccount-content fieldset {
	min-width: 0;
	max-width: 100%;
}

/* ฟอร์มของ WooCommerce เอง (ไม่ได้อยู่ใน namespace wpc-*) ต้องไม่กว้างเกินคอลัมน์ */
body.woocommerce-account .woocommerce-MyAccount-content form {
	max-width: 100%;
}

/* ป้าย/หัวข้อภาษาไทยยาวต้องตัดบรรทัดได้ ไม่งั้นตัวมันเองก็ยังดันกล่องให้บวมอยู่ดี */
body.woocommerce-account .woocommerce-MyAccount-content fieldset legend,
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-form-row label {
	overflow-wrap: anywhere;
}

@media (max-width: 480px) {
	/* ธีมให้ padding 20/40 — ในคอลัมน์ 330px เหลือที่ให้ช่องกรอกแค่ ~250px */
	body.woocommerce-account .woocommerce-MyAccount-content fieldset {
		padding: 16px 14px;
	}
}

/* ============================================================
   [27 ส.ค. 2026] หน้า "รีวิวของฉัน" (endpoint wpc-reviews)

   ทำตาม prototype ลูกค้า: แท็บ รอรีวิว / รีวิวแล้ว + แถวละ 1 สินค้า
   ⚠️ ปุ่ม "เขียนรีวิว" ใช้คลาส wpc-acct-review-open ของ dialog Phase C2
      → สไตล์ที่นี่ห้ามแตะ display/pointer-events ของปุ่ม ไม่งั้น dialog กดไม่ติด
   ============================================================ */

.wpc-myrev__title {
	margin: 0 0 14px;
	font-size: 20px;
	font-weight: 700;
}

.wpc-myrev-tabs {
	display: flex;
	gap: 6px;
	margin-bottom: 16px;
	border-bottom: 1px solid #ececec;
}

.wpc-myrev-tab {
	padding: 9px 14px;
	border-bottom: 2px solid transparent;
	color: #777;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.wpc-myrev-tab:hover {
	color: var(--acct, #ec5a31);
}

.wpc-myrev-tab.is-active {
	border-bottom-color: var(--acct, #ec5a31);
	color: var(--acct, #ec5a31);
}

.wpc-myrev-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wpc-myrev-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid #f0f0f0;
}

.wpc-myrev-item:last-child {
	border-bottom: 0;
}

.wpc-myrev-item__thumb {
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	overflow: hidden;
	background: #fafafa;
}

/* 🔴 ธีมตั้ง min-width ให้รูปในตาราง — min-width ชนะ width เสมอ (บทเรียน 3G/3H)
   ที่นี่เป็น list ไม่ใช่ตาราง แต่ล็อกไว้กันธีมมาทับทีหลัง */
.wpc-myrev-item__thumb img {
	display: block;
	width: 64px;
	min-width: 0;
	height: 64px;
	object-fit: cover;
	border-radius: 0;
}

.wpc-myrev-item__body {
	flex: 1 1 auto;
	min-width: 0;   /* ไม่ใส่ = ชื่อสินค้ายาวดันแถวจนปุ่มหลุดขอบ */
}

.wpc-myrev-item__name {
	display: -webkit-box;
	overflow: hidden;
	color: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.wpc-myrev-item__meta {
	margin-top: 3px;
	color: #999;
	font-size: 12px;
}

.wpc-myrev-item__rate {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 4px;
}

.wpc-myrev-item__text {
	margin-top: 4px;
	overflow-wrap: anywhere;
	font-size: 13px;
	line-height: 1.5;
}

.wpc-myrev-item__flag {
	padding: 2px 8px;
	border-radius: 10px;
	background: #fff4e5;
	color: #b26a00;
	font-size: 11px;
	font-weight: 600;
}

.wpc-myrev-stars {
	color: #ddd;
	font-size: 14px;
	letter-spacing: 1px;
}

.wpc-myrev-star.is-on {
	color: #f5a623;
}

body.woocommerce-account button.wpc-myrev-item__btn {
	flex: 0 0 auto;
	align-self: center;
	min-height: 0;
	padding: 8px 14px;
	border: 1px solid var(--acct, #ec5a31);
	border-radius: 6px;
	background-color: #fff;
	color: var(--acct, #ec5a31);
	-webkit-text-fill-color: var(--acct, #ec5a31);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
}

body.woocommerce-account button.wpc-myrev-item__btn:hover {
	background-color: var(--acct-lt, #fff3ef);
}

.wpc-myrev-empty {
	padding: 28px 16px;
	border: 1px dashed #e2e2e2;
	border-radius: 8px;
	color: #888;
	font-size: 14px;
	text-align: center;
}

@media (max-width: 480px) {
	.wpc-myrev-item {
		flex-wrap: wrap;
	}

	/* ปุ่มลงมาเต็มบรรทัดของตัวเอง — จอ 360 ใส่แถวเดียวกับรูป+ชื่อไม่พอ (เคสเดียวกับ 3G) */
	body.woocommerce-account button.wpc-myrev-item__btn {
		flex: 1 0 100%;
		margin-top: 4px;
	}
}

/* ============================================================
   [27 ส.ค. 2026] ให้หน้าตาตรง prototype ของลูกค้า
   — เมนูข้างซ้ายมีไอคอน · ชิปกรองบนหน้ารายการคำสั่งซื้อ

   ค่าที่ใช้ อ่านจาก prototype จริง (Tailwind → ค่าดิบ):
     ส้ม #ea5b2a (ใกล้ --wpc ของเว็บ) · พื้นเมนูที่เปิดอยู่ #fdece3
     วงกลมไอคอนไทล์ #fff3ec · ป้ายเลขแดง #e5372b · ตัวหนังสือ #3a3a3a
   ============================================================ */

/* ---------- เมนูข้างซ้าย (เทมเพลตของ WooCommerce ที่เรา fork) ----------

   🔴 ก้อน Customizer 45KB ใน DB มี "ส่วน NAV" ที่ตั้ง `!important` ไว้ **ทุกกฎ**
      (อ่านของจริงจากหน้าเว็บ 27 ส.ค.):
        .woocommerce-MyAccount-navigation ul li a
            padding: 11px 18px · font-size: 13.5px · gap: 2px · color: #444
            border-left: 3px solid transparent · border-bottom: 1px solid #fafafa
        .woocommerce-MyAccount-navigation ul li.is-active a
            background: var(--wpc) · color: #fff · font-weight: 600     ← ส้มทึบ ตัวหนังสือขาว
        .woocommerce-MyAccount-navigation-link--customer-logout a  color: #e53935  ← แดง
      prototype ต้องการ **พื้นส้มอ่อน + ตัวหนังสือส้ม** และปุ่มออกจากระบบสีปกติ
      → ที่นี่จึงต้องใส่ `!important` **และ** specificity สูงกว่า ไม่ใช่อย่างใดอย่างหนึ่ง
      (บทเรียน §15 ข้อ 1: ยกให้ชนะจริง ไม่ใช่แค่เท่ากัน · §12: ห้ามแก้ DB)

      ของเรา  body.woocommerce-account .woocommerce-MyAccount-navigation ul > li > a  = (0,0,2,4)
      ของ DB  .woocommerce-MyAccount-navigation ul li a                               = (0,0,1,3)
      ตัวที่เปิดอยู่ ของเรา (0,0,3,4) vs ของ DB (0,0,3,2)
   -------------------------------------------------------------------- */

/* กล่องเมนูเป็นการ์ดเต็มใบ — ก้อน DB ตัดขอบบนทิ้ง (border-radius: 0 0 12px 12px)
   ตั้งแต่สมัยที่มีอะไรวางอยู่ข้างบน ตอนนี้ไม่มีแล้ว เหลือเป็นการ์ดหัวตัด */
body.woocommerce-account .woocommerce-MyAccount-navigation {
	border-top: 1px solid #f0f0f0 !important;
	border-radius: 14px !important;
	overflow: hidden !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0 !important;
	padding: 6px !important;
	list-style: none !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul > li {
	margin: 0;
	border: 0;
	background: none;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul > li > a {
	display: flex !important;
	align-items: center !important;
	gap: 10px !important;
	padding: 9px 12px !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: none !important;
	color: #3a3a3a !important;
	font-size: 14px !important;
	line-height: 1.45 !important;
	text-decoration: none !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul > li > a:hover {
	background: #f7f7f7 !important;
	color: var(--acct, #ec5a31) !important;
}

/* ตัวที่เปิดอยู่ — prototype: พื้นส้มอ่อน + ตัวหนังสือส้ม (ของเดิมใน DB เป็นส้มทึบ/ตัวขาว) */
body.woocommerce-account .woocommerce-MyAccount-navigation ul > li.is-active > a,
body.woocommerce-account .woocommerce-MyAccount-navigation ul > li.woocommerce-MyAccount-navigation-link--active > a {
	background: #fdece3 !important;
	color: var(--acct, #ec5a31) !important;
	font-weight: 500 !important;
}

/* ปุ่มออกจากระบบ — prototype ใช้สีเดียวกับเมนูอื่น (ของเดิมใน DB บังคับเป็นสีแดง) */
body.woocommerce-account .woocommerce-MyAccount-navigation ul > li.woocommerce-MyAccount-navigation-link--customer-logout > a {
	margin-top: 0 !important;
	border-top: 0 !important;
	color: #3a3a3a !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul > li.woocommerce-MyAccount-navigation-link--customer-logout > a:hover {
	background: #f7f7f7 !important;
	color: var(--acct, #ec5a31) !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation .wpc-acct-nav__icon {
	flex-shrink: 0;   /* ไม่ใส่ = ไอคอนถูกบีบแบนเมื่อป้ายยาว */
}

body.woocommerce-account .woocommerce-MyAccount-navigation .wpc-acct-nav__label {
	min-width: 0;
	overflow-wrap: anywhere;
}

/* ---------- ชิปกรองสถานะ (หน้ารายการคำสั่งซื้อ) ---------- */

.wpc-acct-chips {
	display: flex;
	gap: 6px;
	margin-bottom: 14px;
	padding: 8px;
	overflow-x: auto;
	border: 1px solid #f0f0f0;
	border-radius: 14px;
	background: #fff;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.wpc-acct-chips::-webkit-scrollbar { display: none; }

.wpc-acct-chip {
	flex: 0 0 auto;
	padding: 6px 14px;
	border-radius: 999px;
	color: #3a3a3a;
	font-size: 14px;
	line-height: 1.5;
	white-space: nowrap;
	text-decoration: none;
}

.wpc-acct-chip:hover { background: #f7f7f7; }

/* 🔴 ชิปที่เลือก = พื้นส้มทึบ ตัวหนังสือขาว → ต้องกันเบราว์เซอร์บังคับโหมดมืด
   ไม่งั้นบน Android Chrome ตัวหนังสือถูกกลับเป็นสีเข้มบนพื้นเข้ม อ่านไม่ออก (บทเรียน §15 ข้อ 9) */
.wpc-acct-chip.is-on {
	background: var(--acct, #ec5a31);
	color: #fff;
	-webkit-text-fill-color: #fff;
	font-weight: 500;
	color-scheme: only light;
}

@media (prefers-color-scheme: dark) {
	.wpc-acct-chip.is-on {
		background: var(--acct, #ec5a31);
		color: #fff;
		-webkit-text-fill-color: #fff;
	}
}

/* ป้ายจำนวนข้างหัวข้อ — prototype เขียน "รีวิวของฉัน 🔴2" */
.wpc-acct-section__n {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	margin-left: 6px;
	padding: 0 5px;
	border-radius: 9px;
	background: #e5372b;
	color: #fff;
	-webkit-text-fill-color: #fff;
	font-weight: 700;
	font-size: 11px;
	line-height: 18px;
	vertical-align: middle;
	color-scheme: only light;
}
