/**
 * activities/auction.php — UI shell คู่กับ photo activity
 * โหลดเฉพาะหน้าประมูล (pageStylesheets)
 */

body.page-auction,
body.page-auction button,
body.page-auction input,
body.page-auction a:not(.glass-preview-item):not(.glass-preview-brand) {
  font-family: inherit;
}

body.page-auction .glass-preview-bar .glass-preview-item,
body.page-auction .glass-preview-bar .glass-preview-brand {
  font-family: "Noto Sans Thai", sans-serif;
}

body.page-auction .auc-shell {
  max-width: 44rem;
  margin: 0 auto;
}

body.page-auction .page-auction__main {
  padding-bottom: 2.5rem;
}

body.page-auction .auc-hero {
  position: relative;
  padding: 1.1rem 0 1.35rem;
  overflow: hidden;
}

body.page-auction .auc-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(125, 186, 255, 0.35), transparent 50%),
    radial-gradient(ellipse at 10% 100%, rgba(255, 255, 255, 0.55), transparent 45%);
  pointer-events: none;
}

body.page-auction .auc-hero__top {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.15rem;
}

body.page-auction .auc-hero__top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

body.page-auction .auc-back,
body.page-auction .auc-chip-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(8, 38, 83, 0.1);
  background: rgba(255, 255, 255, 0.78);
  color: #082653;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(25, 76, 140, 0.06);
}

body.page-auction .auc-back:hover,
body.page-auction .auc-chip-link:hover {
  background: #fff;
}

body.page-auction .auc-points-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 3.35rem;
  padding: 0.55rem 1.05rem 0.55rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(206, 136, 0, 0.22);
  color: #17345e;
  font-size: 0.92rem;
  box-shadow: 0 10px 24px rgba(25, 76, 140, 0.08);
}

body.page-auction .auc-points-pill__text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  line-height: 1.25;
}

body.page-auction .auc-points-pill__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #52698a;
}

body.page-auction .auc-points-pill__value {
  font-size: 0.98rem;
  font-weight: 700;
}

body.page-auction .auc-points-pill strong {
  color: #082653;
  font-weight: 800;
}

body.page-auction .auc-points-pill__coin {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffd978 0%, #ce8800 100%);
  color: #513900;
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

body.page-auction .auc-hero__copy {
  position: relative;
  z-index: 1;
  max-width: 36rem;
}

body.page-auction .auc-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2rem;
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  background: #082653;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

body.page-auction .auc-hero h1 {
  margin: 0.7rem 0 0;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #082653;
}

body.page-auction .auc-hero__subtitle {
  margin: 0.55rem 0 0;
  max-width: 28rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.45;
  color: #3f5d82;
}

body.page-auction .auc-body {
  padding-top: 0.35rem;
}

body.page-auction .auc-empty {
  text-align: center;
  padding: 2rem 1.1rem;
  border-radius: 26px;
  border: 3px solid #fff;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 32px rgba(35, 82, 140, 0.1);
}

body.page-auction .auc-empty__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #082653;
}

body.page-auction .auc-empty__text {
  margin: 0.4rem 0 0;
  color: #617794;
  font-size: 0.9rem;
}

body.page-auction .auc-card-grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  body.page-auction .auc-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* การ์ดแนวนอน: รูปซ้าย รายละเอียดขวา (มือถือไม่เรียงแนวตั้งเต็มแถว) */
body.page-auction .auc-card {
  display: flex;
  align-items: stretch;
  gap: 0.85rem;
  min-height: 7.2rem;
  padding: 0.7rem;
  border-radius: 22px;
  border: 3px solid #fff;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 28px rgba(35, 82, 140, 0.1);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.page-auction .auc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(35, 82, 140, 0.14);
}

body.page-auction .auc-card__media {
  flex: 0 0 38%;
  max-width: 9.5rem;
  border-radius: 16px;
  overflow: hidden;
  background: #dbeafe;
  aspect-ratio: 4 / 3;
}

body.page-auction .auc-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body.page-auction .auc-card__fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #3b82f6;
}

body.page-auction .auc-card__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.15rem 0.25rem 0.15rem 0;
}

body.page-auction .auc-card__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
}

body.page-auction .auc-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #082653;
  line-height: 1.3;
}

body.page-auction .auc-card__meta {
  margin: 0;
  font-size: 0.8rem;
  color: #617794;
  line-height: 1.4;
}

body.page-auction .auc-card__cta {
  margin-top: 0.15rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: #164c87;
}

body.page-auction .auc-status {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 1.7rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

body.page-auction .auc-status.is-closed {
  background: #f1f5f9;
  color: #64748b;
}

body.page-auction .auc-panel {
  margin: 0 0 1rem;
  padding: 1.15rem 1.1rem 1.2rem;
  border-radius: 26px;
  border: 3px solid #fff;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 32px rgba(35, 82, 140, 0.1);
}

body.page-auction .auc-panel__cover {
  margin: -0.15rem -0.15rem 1rem;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #dbeafe;
}

body.page-auction .auc-panel__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body.page-auction .auc-panel__status-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

body.page-auction .auc-panel__desc {
  margin: 0.75rem 0 0;
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.5;
}

body.page-auction .auc-stat-row {
  list-style: none;
  margin: 0.95rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

body.page-auction .auc-stat {
  padding: 0.65rem 0.5rem;
  border-radius: 14px;
  background: #f4f8fd;
  border: 1px solid rgba(8, 38, 83, 0.06);
  text-align: center;
}

body.page-auction .auc-stat__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #617794;
  margin-bottom: 0.2rem;
}

body.page-auction .auc-stat__value {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  color: #082653;
  line-height: 1.3;
  word-break: break-word;
}

body.page-auction .auc-bid-box {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(8, 38, 83, 0.08);
}

body.page-auction .auc-bid-box__min {
  margin: 0 0 0.85rem;
  color: #3f5d82;
  font-size: 0.9rem;
  font-weight: 650;
}

body.page-auction .auc-bid-box__min strong {
  color: #082653;
  font-weight: 800;
}

body.page-auction .auc-field {
  display: block;
  margin: 0 0 0.85rem;
}

body.page-auction .auc-field__label {
  display: block;
  margin-bottom: 0.35rem;
  color: #1e3a8a;
  font-size: 0.88rem;
  font-weight: 750;
}

body.page-auction .auc-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid rgba(59, 91, 134, 0.22);
  border-radius: 14px;
  background: #f8fbff;
  color: #0f172a;
  font: inherit;
  padding: 0.7rem 0.85rem;
}

body.page-auction .auc-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: #fff;
}

body.page-auction .auc-cta-shell {
  width: min(100%, 26rem);
  margin: 0.5rem auto 0;
}

body.page-auction .auc-primary-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  min-height: 58px;
  margin: 0;
  padding: 12px 3rem 12px 1.5rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #164c87 0%, #062653 100%);
  box-shadow: 0 7px 15px rgba(8, 39, 85, 0.22);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

body.page-auction .auc-primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(8, 39, 85, 0.28);
  color: #fff;
}

body.page-auction .auc-primary-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

body.page-auction .auc-primary-button__chevron {
  position: absolute;
  right: 1.1rem;
  display: inline-grid;
  place-items: center;
}

body.page-auction .auc-bid-hint {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: #6a7f9b;
}

body.page-auction .auc-alert {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: #fff5f5;
  border: 1px solid #f1c0c0;
  color: #9b1c1c;
  font-size: 0.92rem;
}

body.page-auction .auc-alert.is-soft {
  background: #f4f7fb;
  border-color: rgba(8, 38, 83, 0.1);
  color: #52698a;
}

body.page-auction .auc-section {
  margin-top: 1.15rem;
  padding: 1.1rem 1.05rem 1.15rem;
  border-radius: 26px;
  border: 3px solid #fff;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 32px rgba(35, 82, 140, 0.1);
}

body.page-auction .auc-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

body.page-auction .auc-section__head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #082653;
}

body.page-auction .auc-section__chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: #eef4fb;
  color: #3f5d82;
  font-size: 0.75rem;
  font-weight: 750;
}

body.page-auction .auc-bid-list {
  display: grid;
  gap: 0.5rem;
}

body.page-auction .auc-bid {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: #f5f8fc;
  border: 1.5px solid rgba(55, 90, 130, 0.12);
  color: #3f5678;
}

body.page-auction .auc-bid.is-lead {
  background: linear-gradient(145deg, #fff8e8, #fffdf6);
  border-color: #e0b13a;
  box-shadow: 0 6px 16px rgba(176, 130, 24, 0.12);
  color: #082653;
}

body.page-auction .auc-bid.is-empty {
  display: flex;
  justify-content: center;
  grid-template-columns: none;
  color: #617794;
  font-size: 0.9rem;
  background: #f8fbff;
  border-color: rgba(8, 38, 83, 0.06);
  box-shadow: none;
}

body.page-auction .auc-bid__avatar {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  overflow: hidden;
  border-radius: 50%;
  background: #dce8f6;
  color: #1f4f88;
  font-size: 0.95rem;
  font-weight: 800;
  flex-shrink: 0;
}

body.page-auction .auc-bid__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body.page-auction .auc-bid__initial {
  line-height: 1;
}

body.page-auction .auc-bid__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .12rem;
  min-width: 0;
}

body.page-auction .auc-bid__name {
  min-width: 0;
  max-width: 100%;
  color: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.page-auction .auc-bid__time {
  color: inherit;
  font-size: .72rem;
  font-weight: 550;
  line-height: 1.25;
  opacity: .78;
}

body.page-auction .auc-bid.is-lead .auc-bid__name {
  font-weight: 800;
  color: #082653;
}

body.page-auction .auc-bid.is-lead .auc-bid__time {
  color: #082653;
  opacity: .72;
}

body.page-auction .auc-bid__amount {
  color: #52698a;
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

body.page-auction .auc-bid.is-lead .auc-bid__amount {
  color: #9a6b00;
  font-size: 1.02rem;
}

@media (max-width: 430px) {
  body.page-auction .auc-card {
    min-height: 6.6rem;
  }
  body.page-auction .auc-card__media {
    flex-basis: 34%;
    max-width: 7.8rem;
  }
  body.page-auction .auc-stat-row {
    grid-template-columns: 1fr;
  }
}

/*
 * S-ERUM AUCTION LISTING — UI UPGRADE PATCH
 * ================================================================
 * ไฟล์นี้เป็น CSS ส่วนต่อขยายสำหรับ activities-auction.css เดิม
 * จุดประสงค์: ปรับหน้ารวมรายการประมูลให้ใกล้เคียงภาพ Mockup:
 * - โทนฟ้า/ขาว/กรมท่า และทอง ใช้ภาพลักษณ์ Premium ของ S-ERUM
 * - ส่วนหัวมีข้อมูลสรุปกิจกรรม ไม่ใช่แค่หัวข้อกับคำโปรย
 * - มีแถบกรองและเรียงลำดับรายการ
 * - การ์ดประมูลแบบแนวนอนบนจอใหญ่ แสดงราคา/เวลา/ปุ่มอย่างชัดเจน
 * - มือถือยังอ่านง่าย โดยเรียงข้อมูลเป็นลำดับ ไม่บีบคอลัมน์
 *
 * วิธีใช้:
 * 1) ให้ Cursor อ่านไฟล์ PHP จริงก่อน และตรวจ class/โครง HTML ปัจจุบัน
 * 2) เพิ่ม markup เฉพาะส่วนที่จำเป็นตาม class ในไฟล์นี้
 * 3) โหลดไฟล์นี้ "หลัง" activities-auction.css เดิม เพื่อให้ override ได้
 * 4) อย่าลบ CSS เดิมทันที จนกว่าจะทดสอบ desktop/mobile และทุกสถานะแล้ว
 *
 * สำคัญ:
 * - CSS นี้ไม่สร้างข้อมูล และไม่คำนวณราคา/เวลา/จำนวนบิดเอง
 * - ค่าใน UI ต้องมาจากตัวแปร/ข้อมูลจริงที่ PHP ส่งมาเท่านั้น
 * - ถ้าระบบไม่มีข้อมูลใด เช่น จำนวนผู้สนใจ ห้ามสร้างตัวเลขจำลอง
 * - ทุก selector ถูก scope ใต้ body.page-auction เพื่อไม่กระทบหน้าอื่น
 */


/* ================================================================
   01. PAGE FOUNDATION — ขยายพื้นที่หน้ารวมประมูล
   ================================================================ */

/* CSS เดิมจำกัด .auc-shell ไว้ที่ 44rem ซึ่งแคบเกินไปสำหรับ
   การ์ดแนวนอนที่ต้องแสดงรูป + รายละเอียด + ราคา + countdown + CTA
   จึงขยายเฉพาะหน้า auction และใช้ padding กันเนื้อหาชนขอบจอ */
body.page-auction .auc-shell {
  width: min(100% - 2rem, 90rem);
  max-width: 90rem;
  margin-inline: auto;
}

body.page-auction .page-auction__main {
  padding-bottom: clamp(2rem, 4vw, 4rem);
}

/* พื้นหลังรวม: ฟ้าอ่อนสะอาด มีแสงนุ่ม ๆ ไม่แย่งความเด่นจากสินค้า */
body.page-auction {
  background:
    radial-gradient(ellipse at 12% 5%, rgba(255,255,255,.95), transparent 34rem),
    radial-gradient(ellipse at 92% 12%, rgba(177,216,255,.38), transparent 38rem),
    linear-gradient(180deg, #eaf5ff 0%, #f7fbff 48%, #edf5ff 100%);
  color: #082653;
}


/* ================================================================
   02. HERO — ส่วนหัวหน้า Auction Listing
   ================================================================ */

/* กล่องหัวหน้าให้เป็นพื้นที่นำสายตาแบบ Mockup
   หาก PHP มีภาพ Hero จริง สามารถใส่ background-image เพิ่มได้
   แต่ต้องมี gradient สำรองเพื่อให้ข้อความอ่านได้เสมอ */
body.page-auction .auc-hero {
  position: relative;
  isolation: isolate;
  padding: clamp(1.4rem, 3vw, 2.6rem) 0 clamp(1.25rem, 2.5vw, 2rem);
  overflow: hidden;
  border-radius: 0 0 2rem 2rem;
  background-color: #d9edff;
  background-image:
    linear-gradient(90deg, rgba(248,252,255,.88) 0%, rgba(248,252,255,.55) 42%, rgba(248,252,255,.12) 72%, rgba(248,252,255,0) 100%),
    url("../images/activities/activities_auction_result.webp");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: cover;
}

/* ชั้นโปร่งบางช่วยให้อ่านข้อความซ้ายชัด โดยไม่บังค้อนทองด้านขวา */
body.page-auction .auc-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 40%);
}

/* ส่วนบน: ปุ่มกลับ + คะแนนสมาชิก */
body.page-auction .auc-hero__top {
  align-items: center;
  margin-bottom: clamp(1rem, 2.2vw, 1.8rem);
}

body.page-auction .auc-back,
body.page-auction .auc-chip-link {
  min-height: 2.6rem;
  padding-inline: 1.1rem;
  border-color: rgba(36, 91, 153, .14);
  background: rgba(255,255,255,.82);
  box-shadow: 0 5px 18px rgba(27, 76, 132, .08);
  backdrop-filter: blur(8px);
}

body.page-auction .auc-points-pill {
  min-height: 3.7rem;
  padding: .55rem 1.2rem .55rem .6rem;
  border-color: rgba(214, 157, 37, .24);
  box-shadow: 0 8px 24px rgba(25,76,140,.1);
}

/* Hero copy: หัวข้อใหญ่และอ่านชัดบนพื้นหลังสว่าง */
body.page-auction .auc-hero__copy {
  max-width: 52rem;
}

body.page-auction .auc-hero__badge {
  min-height: 2.25rem;
  padding: .35rem 1.1rem;
  background: linear-gradient(180deg, #174d89, #082653);
  box-shadow: 0 5px 14px rgba(8,38,83,.16);
}

body.page-auction .auc-hero h1 {
  margin-top: .85rem;
  font-size: clamp(2rem, 4.5vw, 3.65rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}

body.page-auction .auc-hero__subtitle {
  max-width: 42rem;
  margin-top: .7rem;
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: #365b85;
}

/* ถ้าเพิ่มสรุปตัวเลขใน Hero ให้ใช้ .auc-overview และ .auc-overview__item
   ตัวเลขทุกตัวต้องมาจากข้อมูลจริง หากไม่มีข้อมูลให้ซ่อน item นั้น */
body.page-auction .auc-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  width: min(100%, 58rem);
  margin-top: 1.35rem;
  padding: .85rem;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 1.5rem;
  background: rgba(255,255,255,.72);
  box-shadow: 0 10px 28px rgba(35,82,140,.08);
  backdrop-filter: blur(10px);
}

body.page-auction .auc-overview__item {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-width: 0;
  padding: .35rem .75rem;
}

body.page-auction .auc-overview__item + .auc-overview__item {
  border-left: 1px solid rgba(39,91,151,.18);
}

body.page-auction .auc-overview__icon {
  display: grid;
  place-items: center;
  flex: 0 0 2.6rem;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: #e6f2ff;
  color: #15549a;
  font-size: 1.25rem;
}

body.page-auction .auc-overview__label {
  display: block;
  color: #547092;
  font-size: .78rem;
  font-weight: 650;
}

body.page-auction .auc-overview__value {
  display: block;
  color: #082653;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 850;
  line-height: 1.25;
}


/* ================================================================
   03. TOOLBAR — ตัวกรองและการเรียงลำดับ
   ================================================================ */

/* ใช้กับแถบ filter ที่ Cursor จะเพิ่มใน PHP
   ตัวกรองต้องเปลี่ยน query/URL ตามระบบเดิม ไม่ใช่แค่เปลี่ยนสีปุ่ม */
body.page-auction .auc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.35rem 0 1.1rem;
}

body.page-auction .auc-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  min-width: 0;
}

body.page-auction .auc-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.9rem;
  padding: .55rem 1.15rem;
  border: 1px solid rgba(48,105,169,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: #173b6b;
  font: inherit;
  font-size: .92rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

body.page-auction .auc-filter:hover {
  background: #fff;
  box-shadow: 0 5px 14px rgba(35,82,140,.08);
}

body.page-auction .auc-filter.is-active,
body.page-auction .auc-filter[aria-current="page"],
body.page-auction .auc-filter[aria-pressed="true"] {
  border-color: transparent;
  background: linear-gradient(135deg, #2787df, #14529a);
  color: #fff;
  box-shadow: 0 7px 16px rgba(20,82,154,.2);
}

body.page-auction .auc-filter.is-ending {
  background: #fff0f3;
  color: #c51e45;
}

body.page-auction .auc-filter.is-ending.is-active {
  background: linear-gradient(135deg, #ed5272, #c51e45);
  color: #fff;
}

body.page-auction .auc-sort {
  min-height: 2.9rem;
  max-width: 100%;
  padding: .55rem 2.4rem .55rem 1rem;
  border: 1px solid rgba(48,105,169,.16);
  border-radius: 999px;
  background-color: rgba(255,255,255,.9);
  color: #173b6b;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 5px 16px rgba(35,82,140,.07);
}


/* ================================================================
   04. LIST — รายการประมูล
   ================================================================ */

/* Mockup ใช้รายการเรียงลงมาเต็มความกว้าง
   จึงยกเลิก grid 2 คอลัมน์ของ CSS เดิม */
body.page-auction .auc-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .9rem;
}

/* การ์ดรายการ: desktop แบ่งเป็น 4 โซน
   1) ภาพสินค้า  2) รายละเอียด  3) ราคา/เวลา  4) ปุ่ม
   Cursor ต้องจัด HTML ให้ตรงโครงสร้างนี้ หรือปรับ grid-template ตาม DOM จริง */
body.page-auction .auc-card {
  display: grid;
  grid-template-columns: minmax(11rem, 16.5rem) minmax(15rem, 1fr) minmax(13rem, 19rem) minmax(10.5rem, 15rem);
  align-items: stretch;
  gap: clamp(.85rem, 1.5vw, 1.4rem);
  min-height: 13rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 1.8rem;
  background: linear-gradient(110deg, rgba(255,255,255,.98), rgba(248,252,255,.96));
  box-shadow: 0 9px 24px rgba(31,78,133,.12);
  color: inherit;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

/* display:grid ทับ [hidden] ของเบราว์เซอร์ — บังคับซ่อนเมื่อกรองไม่ผ่าน */
body.page-auction .auc-card[hidden],
body.page-auction .auc-card.is-filter-hidden {
  display: none !important;
}

/* รายการเด่น/แนะนำ: ใช้ class นี้เฉพาะรายการที่ระบบกำหนดจริง
   อย่าใส่ให้ทุกใบ เพราะจะทำให้ความสำคัญไม่แตกต่าง */
body.page-auction .auc-card.is-featured {
  border: 2px solid #f4c542;
  box-shadow: 0 9px 24px rgba(194,139,18,.18), 0 2px 6px rgba(31,78,133,.08);
}

body.page-auction .auc-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59,130,246,.32);
  box-shadow: 0 15px 30px rgba(31,78,133,.16);
}

body.page-auction .auc-card__media {
  width: 100%;
  max-width: none;
  min-width: 0;
  aspect-ratio: 1 / 1;
  align-self: stretch;
  border-radius: 1.2rem;
  background: linear-gradient(145deg, #dceeff, #f6fbff);
}

body.page-auction .auc-card__media img {
  object-fit: cover;
  padding: 0;
}

/* เนื้อหาสินค้า: ชื่อและสถานะอยู่บนสุด สรุป/ตัวเลขอยู่ด้านล่าง */
body.page-auction .auc-card__body {
  justify-content: center;
  gap: .55rem;
  padding: .2rem .15rem;
}

body.page-auction .auc-card__title-row {
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: .5rem .65rem;
}

body.page-auction .auc-card__title {
  font-size: clamp(1.08rem, 1.45vw, 1.45rem);
  line-height: 1.28;
}

body.page-auction .auc-card__meta {
  font-size: .88rem;
  line-height: 1.5;
}

body.page-auction .auc-status {
  min-height: 1.8rem;
  padding: .25rem .8rem;
  background: #e6f1ff;
  color: #15549a;
  font-size: .76rem;
}

body.page-auction .auc-status.is-open {
  background: #e6f1ff;
  color: #15549a;
}

body.page-auction .auc-status.is-scheduled {
  background: #fff4df;
  color: #b45309;
}

body.page-auction .auc-status.is-ended,
body.page-auction .auc-status.is-closed {
  background: #eef1f5;
  color: #64748b;
}

body.page-auction .auc-status.is-cancelled {
  background: #f3f4f6;
  color: #9ca3af;
}

/* แถวสถิติย่อย — หลักเดียวกับ detail: 3 คอลัมน์ · ก้อนไอคอน+ข้อความอยู่กลางคอลัมน์ */
body.page-auction .auc-card__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 0;
  margin-top: .45rem;
  padding: .2rem 0;
}

body.page-auction .auc-card__stats.is-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.page-auction .auc-card__stat {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: .35rem .3rem;
  color: #173b6b;
  font-size: .88rem;
  font-weight: 800;
}

body.page-auction .auc-card__stat + .auc-card__stat {
  padding-left: .3rem;
  border-left: 1px solid rgba(34, 83, 143, .18);
}

body.page-auction .auc-card__stat-cluster {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  max-width: 100%;
  text-align: left;
}

body.page-auction .auc-card__stat-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .06rem;
  min-width: 0;
}

body.page-auction .auc-card__stat small {
  display: block;
  color: #7186a2;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.2;
}

/* กล่องราคา/นับถอยหลัง: สีพื้นตามสถานะเพื่อสื่อความหมายชัด */
body.page-auction .auc-card__deal {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .7rem;
  min-width: 0;
  padding: .9rem 1rem;
  border-radius: 1.35rem;
  background: linear-gradient(145deg, #fff4f2, #fff9f6);
  text-align: center;
}

body.page-auction .auc-card__deal[data-status="open"] {
  background: linear-gradient(145deg, #fff1ef, #fff7f4);
}

body.page-auction .auc-card__deal[data-status="scheduled"] {
  background: linear-gradient(145deg, #fff8eb, #fffdf8);
}

body.page-auction .auc-card__deal[data-status="ended"] {
  background: linear-gradient(145deg, #eef2f7, #f8fafc);
}

body.page-auction .auc-card__deal[data-status="cancelled"] {
  background: linear-gradient(145deg, #f3f4f6, #fafafa);
}

body.page-auction .auc-countdown {
  color: #c62828;
  font-weight: 850;
  line-height: 1.25;
}

body.page-auction .auc-countdown[data-status="open"] {
  color: #c62828;
}

body.page-auction .auc-countdown[data-status="scheduled"] {
  color: #b45309;
}

body.page-auction .auc-countdown[data-status="ended"],
body.page-auction .auc-countdown[data-status="cancelled"] {
  color: #64748b;
}

body.page-auction .auc-countdown__label {
  display: block;
  margin-bottom: .25rem;
  font-size: .82rem;
  font-weight: 750;
}

body.page-auction .auc-countdown__label:empty {
  display: none;
}

body.page-auction .auc-countdown__value {
  display: block;
  font-size: clamp(1.05rem, 1.6vw, 1.5rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}

body.page-auction .auc-status-text {
  font-weight: 850;
}

body.page-auction .auc-winner-tail {
  display: block;
  margin-top: .28rem;
  color: inherit;
  font-size: .5em;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  opacity: .92;
}

body.page-auction .auc-countdown[data-status="scheduled"] .auc-countdown__sub {
  color: #c27803;
}

body.page-auction .auc-countdown[data-status="ended"] .auc-countdown__sub,
body.page-auction .auc-countdown.is-ended .auc-countdown__sub {
  color: #7b8798;
}

body.page-auction .auc-countdown.is-ended[data-status="open"] {
  color: #64748b;
}

body.page-auction .auc-countdown,
body.page-auction .auc-current-price {
  text-align: center;
}

body.page-auction .auc-current-price__label {
  display: block;
  color: #173b6b;
  font-size: .86rem;
  font-weight: 750;
}

body.page-auction .auc-current-price__value {
  display: block;
  margin-top: .12rem;
  color: #0b3d83;
  font-size: clamp(1.55rem, 2.2vw, 2.15rem);
  font-weight: 900;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}

/* ราคาปัจจุบันตามสถานะ — แยกสายตาไม่ให้ทุกการ์ดสีเดียวกัน */
body.page-auction .auc-card__deal[data-status="open"] .auc-current-price__label,
body.page-auction .auc-card__deal[data-status="open"] .auc-current-price__value {
  color: #c62828;
}

body.page-auction .auc-card__deal[data-status="scheduled"] .auc-current-price__label,
body.page-auction .auc-card__deal[data-status="scheduled"] .auc-current-price__value {
  color: #b45309;
}

body.page-auction .auc-card__deal[data-status="ended"] .auc-current-price__label,
body.page-auction .auc-card__deal[data-status="ended"] .auc-current-price__value,
body.page-auction .auc-card__deal[data-status="cancelled"] .auc-current-price__label,
body.page-auction .auc-card__deal[data-status="cancelled"] .auc-current-price__value {
  color: #64748b;
}

body.page-auction .auc-start-price {
  display: block;
  margin-top: .25rem;
  color: #637894;
  font-size: .84rem;
  font-weight: 650;
}

/* กลุ่มปุ่ม: CTA หลักต้องเด่นที่สุด และปุ่มติดตามเป็นรอง */
body.page-auction .auc-card__actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .65rem;
  min-width: 0;
}

body.page-auction .auc-card__bid-button,
body.page-auction .auc-card__watch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  min-height: 3.5rem;
  padding: .75rem 1rem;
  border-radius: 999px;
  font: inherit;
  font-size: .98rem;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

body.page-auction .auc-card__bid-button {
  border: 1px solid #1460b8;
  background: linear-gradient(180deg, #2589ed, #0753b0);
  color: #fff;
  box-shadow: 0 7px 15px rgba(16,89,177,.22);
}

body.page-auction .auc-card__bid-button.is-open {
  border-color: #c62828;
  background: linear-gradient(180deg, #ef5350, #c62828);
  box-shadow: 0 7px 15px rgba(198, 40, 40, .22);
}

body.page-auction .auc-card__bid-button.is-scheduled {
  border-color: #b45309;
  background: linear-gradient(180deg, #f0a04b, #b45309);
  box-shadow: 0 7px 15px rgba(180, 83, 9, .22);
}

body.page-auction .auc-card__bid-button.is-ended,
body.page-auction .auc-card__bid-button.is-closed {
  border-color: #64748b;
  background: linear-gradient(180deg, #94a3b8, #64748b);
  box-shadow: 0 7px 15px rgba(100, 116, 139, .2);
}

body.page-auction .auc-card__bid-button.is-cancelled {
  border-color: #9ca3af;
  background: linear-gradient(180deg, #d1d5db, #9ca3af);
  box-shadow: 0 7px 15px rgba(156, 163, 175, .18);
}

body.page-auction .auc-card__bid-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(16,89,177,.28);
  color: #fff;
}

body.page-auction .auc-card__bid-button.is-open:hover {
  box-shadow: 0 10px 20px rgba(198, 40, 40, .28);
}

body.page-auction .auc-card__bid-button.is-scheduled:hover {
  box-shadow: 0 10px 20px rgba(180, 83, 9, .28);
}

body.page-auction .auc-card__bid-button.is-ended:hover,
body.page-auction .auc-card__bid-button.is-closed:hover {
  box-shadow: 0 10px 20px rgba(100, 116, 139, .26);
}

body.page-auction .auc-card__watch-button {
  min-height: 3rem;
  border: 1.5px solid #1b64b5;
  background: rgba(255,255,255,.85);
  color: #104887;
}

body.page-auction .auc-card__watch-button:hover {
  background: #edf6ff;
}

/* CTA เดิมใน card หาก PHP ยังใช้ .auc-card__cta ให้คงหน้าตาเป็นลิงก์
   ระหว่างที่ Cursor ปรับ markup ไม่เสร็จ */
body.page-auction .auc-card__cta {
  color: #14549a;
  font-weight: 850;
}


/* ================================================================
   05. DETAIL PAGE / EXISTING COMPONENTS — รักษาหน้ารายละเอียด
   ================================================================ */

/* CSS ส่วนนี้ตั้งใจไม่เปลี่ยนโครงสร้างหน้ารายละเอียดประมูล
   คง panel, bid form, input, history และปุ่มเดิมไว้
   ปรับเพียงเงา/สีให้เข้ากับหน้า listing */
body.page-auction .auc-panel,
body.page-auction .auc-section,
body.page-auction .auc-empty {
  border: 1px solid rgba(255,255,255,.98);
  box-shadow: 0 10px 28px rgba(35,82,140,.11);
}

body.page-auction .auc-primary-button {
  background: linear-gradient(180deg, #1a5797 0%, #082653 100%);
  box-shadow: 0 8px 18px rgba(8,39,85,.22);
}


/* ================================================================
   06. RESPONSIVE — TABLET
   ================================================================ */

@media (max-width: 1050px) {
  /* ลดจำนวนคอลัมน์ก่อน เพื่อไม่ให้รายละเอียดกับราคาเบียดกัน */
  body.page-auction .auc-card {
    grid-template-columns: minmax(9rem, 13rem) minmax(0, 1fr) minmax(12rem, 16rem);
  }

  /* ปุ่มย้ายไปอยู่ใต้ข้อมูลราคาในคอลัมน์ที่สาม */
  body.page-auction .auc-card__actions {
    grid-column: 3;
  }

  body.page-auction .auc-card__deal {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 760px) {
  body.page-auction .auc-shell {
    width: min(100% - 1.1rem, 42rem);
  }

  body.page-auction .auc-hero {
    border-radius: 0 0 1.4rem 1.4rem;
  }

  body.page-auction .auc-hero__top {
    align-items: flex-start;
  }

  body.page-auction .auc-overview {
    gap: .35rem;
    padding: .55rem;
  }

  body.page-auction .auc-overview__item {
    gap: .45rem;
    padding: .3rem .4rem;
  }

  body.page-auction .auc-overview__icon {
    flex-basis: 2rem;
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  body.page-auction .auc-overview__label {
    font-size: .68rem;
  }

  body.page-auction .auc-overview__value {
    font-size: .92rem;
  }

  body.page-auction .auc-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  body.page-auction .auc-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: .1rem .05rem .45rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  body.page-auction .auc-sort {
    align-self: flex-end;
  }

  /* มือถือ: รูปอยู่ซ้าย รายละเอียดอยู่ขวา และราคา/ปุ่มลงมาเต็มแถว
     ทำให้ผู้ใช้เห็นสินค้าได้ทันทีโดยไม่ต้องเลื่อนผ่านรูปขนาดใหญ่ */
  body.page-auction .auc-card {
    grid-template-columns: minmax(6.5rem, 8.5rem) minmax(0, 1fr);
    gap: .75rem;
    min-height: 0;
    padding: .75rem;
    border-radius: 1.35rem;
  }

  body.page-auction .auc-card__media {
    grid-column: 1;
    grid-row: 1;
    aspect-ratio: 1 / 1;
    border-radius: 1rem;
  }

  body.page-auction .auc-card__body {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }

  body.page-auction .auc-card__deal {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    text-align: left;
    padding: .75rem .9rem;
  }

  body.page-auction .auc-card__actions {
    grid-column: 1 / -1;
    grid-row: 3;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }

  body.page-auction .auc-card__bid-button {
    min-height: 3.1rem;
  }

  body.page-auction .auc-card__watch-button {
    min-height: 3.1rem;
  }
}


/* ================================================================
   07. RESPONSIVE — SMALL MOBILE
   ================================================================ */

@media (max-width: 480px) {
  body.page-auction .auc-shell {
    width: calc(100% - 1rem);
  }

  body.page-auction .auc-hero {
    padding-top: 1rem;
  }

  body.page-auction .auc-hero__top {
    gap: .55rem;
  }

  body.page-auction .auc-back,
  body.page-auction .auc-chip-link {
    min-height: 2.25rem;
    padding-inline: .8rem;
    font-size: .8rem;
  }

  body.page-auction .auc-points-pill {
    min-height: 2.7rem;
    padding: .4rem .7rem .4rem .4rem;
    font-size: .78rem;
  }

  body.page-auction .auc-points-pill__label {
    font-size: .68rem;
  }

  body.page-auction .auc-points-pill__value {
    font-size: .82rem;
  }

  body.page-auction .auc-hero h1 {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  body.page-auction .auc-hero__subtitle {
    font-size: .95rem;
  }

  /* บนมือถือจอแคบ ให้สรุปตัวเลขเป็น 3 ช่องเท่ากันและตัดคำอย่างปลอดภัย */
  body.page-auction .auc-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-radius: 1rem;
  }

  body.page-auction .auc-overview__item {
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
    padding: .3rem;
  }

  body.page-auction .auc-overview__item + .auc-overview__item {
    border-left: 1px solid rgba(39,91,151,.15);
  }

  body.page-auction .auc-overview__icon {
    display: grid;
    flex-basis: 1.55rem;
    width: 1.55rem;
    height: 1.55rem;
    font-size: .85rem;
  }

  body.page-auction .auc-overview__icon svg {
    width: 12px;
    height: 12px;
  }

  body.page-auction .auc-overview__item {
    flex-direction: row;
    align-items: center;
  }

  body.page-auction .auc-overview__label {
    font-size: .62rem;
    line-height: 1.25;
  }

  body.page-auction .auc-overview__value {
    font-size: .82rem;
    overflow-wrap: anywhere;
  }

  body.page-auction .auc-card {
    grid-template-columns: 6.1rem minmax(0, 1fr);
    gap: .65rem;
    padding: .65rem;
  }

  body.page-auction .auc-card__title {
    font-size: .95rem;
  }

  body.page-auction .auc-card__meta {
    font-size: .76rem;
  }

  body.page-auction .auc-card__stat {
    font-size: .76rem;
    padding: .3rem .15rem;
  }

  body.page-auction .auc-card__stat-cluster {
    gap: .3rem;
  }

  body.page-auction .auc-card__stat + .auc-card__stat {
    padding-left: .15rem;
  }

  body.page-auction .auc-card__deal {
    grid-template-columns: 1fr;
    gap: .5rem;
  }

  body.page-auction .auc-countdown__value {
    font-size: 1.1rem;
  }

  body.page-auction .auc-current-price__value {
    font-size: 1.65rem;
  }

  body.page-auction .auc-card__actions {
    grid-template-columns: 1fr;
  }

  body.page-auction .auc-card__bid-button,
  body.page-auction .auc-card__watch-button {
    min-height: 2.9rem;
    font-size: .9rem;
  }
}


/* ================================================================
   08. ACCESSIBILITY & MOTION — ใช้งานได้จริง ไม่ใช่แค่สวย
   ================================================================ */

body.page-auction .auc-filter:focus-visible,
body.page-auction .auc-sort:focus-visible,
body.page-auction .auc-card__bid-button:focus-visible,
body.page-auction .auc-card__watch-button:focus-visible,
body.page-auction .auc-primary-button:focus-visible {
  outline: 3px solid rgba(34,125,220,.45);
  outline-offset: 3px;
}

/* ผู้ใช้ที่ตั้งค่า Reduce Motion จะไม่เห็นการยกการ์ด/transition */
@media (prefers-reduced-motion: reduce) {
  body.page-auction .auc-card,
  body.page-auction .auc-filter,
  body.page-auction .auc-card__bid-button,
  body.page-auction .auc-card__watch-button,
  body.page-auction .auc-primary-button {
    transition: none !important;
  }

  body.page-auction .auc-card:hover,
  body.page-auction .auc-primary-button:hover,
  body.page-auction .auc-card__bid-button:hover {
    transform: none !important;
  }
}


/* ================================================================
   09. LOCAL OVERRIDES — Noto Sans + detail width + single CTA
   ================================================================ */

body.page-auction .auc-hero,
body.page-auction .auc-hero__top,
body.page-auction .auc-back,
body.page-auction .auc-chip-link,
body.page-auction .auc-points-pill,
body.page-auction .auc-hero__copy,
body.page-auction .auc-hero__badge,
body.page-auction .auc-hero h1,
body.page-auction .auc-hero__subtitle,
body.page-auction .auc-overview,
body.page-auction .auc-toolbar,
body.page-auction .auc-filter,
body.page-auction .auc-sort,
body.page-auction .auc-card,
body.page-auction .auc-card__title,
body.page-auction .auc-card__meta,
body.page-auction .auc-card__bid-button,
body.page-auction .auc-countdown,
body.page-auction .auc-current-price__value,
body.page-auction .auc-start-price {
  font-family: "Noto Sans Thai", "Noto Sans Thai UI", sans-serif;
}

body.page-auction.is-auc-detail .auc-shell {
  width: min(100% - 2rem, 44rem);
  max-width: 44rem;
}

body.page-auction .auc-card__actions:has(> :only-child) {
  grid-template-columns: 1fr;
}


/* ================================================================
   10. MOCKUP POLISH — hero art, overview SVG, start badge, view toggle, grid
   ================================================================ */

body.page-auction .auc-hero {
  position: relative;
}

body.page-auction .auc-hero__stage {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 52rem;
}

body.page-auction .auc-overview__icon svg {
  display: block;
}

body.page-auction .auc-toolbar__tools {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex: 0 0 auto;
}

body.page-auction .auc-sort-form {
  margin: 0;
}

body.page-auction .auc-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .2rem;
  border: 1px solid rgba(48,105,169,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 5px 16px rgba(35,82,140,.07);
}

body.page-auction .auc-view-toggle__btn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #3d5f88;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background .16s ease, color .16s ease;
}

body.page-auction .auc-view-toggle__btn:hover {
  background: #eef6ff;
  color: #0f4f96;
}

body.page-auction .auc-view-toggle__btn.is-active,
body.page-auction .auc-view-toggle__btn[aria-pressed="true"] {
  background: linear-gradient(135deg, #2787df, #14529a);
  color: #fff;
}

body.page-auction .auc-countdown__sub {
  display: block;
  margin-top: .28rem;
  color: #64748b;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
}

body.page-auction .auc-card__media {
  position: relative;
  overflow: hidden;
}

body.page-auction .auc-card__start-badge {
  position: absolute;
  left: .55rem;
  bottom: .55rem;
  z-index: 1;
  max-width: calc(100% - 1.1rem);
  padding: .28rem .7rem;
  border-radius: 999px;
  background: rgba(8, 38, 83, .82);
  color: #fff;
  font-size: .72rem;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

/* ปิดแล้ว: เฟดรูป + overlay ผู้ชนะ (แนว sold-out) */
body.page-auction .auc-card__media.is-ended > img,
body.page-auction .auc-card__media.is-ended > .auc-card__fallback {
  filter: brightness(.42) saturate(.55);
  transform: scale(1.02);
}

body.page-auction .auc-card__ended-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .75rem .65rem;
  text-align: center;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 20, 40, .18), rgba(8, 20, 40, .42));
}

body.page-auction .auc-card__ended-avatar {
  display: grid;
  place-items: center;
  width: clamp(4.4rem, 38%, 5.6rem);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
  background: #dbe7f6;
  color: #0b3d83;
  font-size: 1.55rem;
  font-weight: 900;
}

body.page-auction .auc-card__ended-avatar.is-empty {
  background: #111827;
  color: #fff;
  border-color: #fff;
}

body.page-auction .auc-card__ended-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: none;
  transform: none;
}

body.page-auction .auc-card__ended-initial {
  line-height: 1;
}

body.page-auction .auc-card__ended-kicker {
  margin-top: .2rem;
  color: #fff;
  font-size: .78rem;
  font-weight: 750;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}

body.page-auction .auc-card__ended-name {
  color: #fff;
  font-size: clamp(.95rem, 2.4vw, 1.15rem);
  font-weight: 900;
  line-height: 1.25;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .5);
}

body.page-auction .auc-card__ended-price {
  color: #ffe08a;
  font-size: clamp(.88rem, 2.2vw, 1.02rem);
  font-weight: 850;
  line-height: 1.25;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}

body.page-auction .auc-card__title-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .4rem;
}

body.page-auction .auc-card__title {
  width: 100%;
  margin: 0;
  font-weight: 850;
  color: #082653;
}

body.page-auction .auc-card__stat-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0;
  border-radius: 50%;
  background: #e8f2ff;
  color: #0b3d83;
}

body.page-auction .auc-card__stat-icon svg {
  display: block;
  width: 1rem;
  height: 1rem;
}

body.page-auction .auc-card__stat strong {
  display: block;
  font-weight: 900;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

body.page-auction .auc-countdown__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  width: 100%;
}

body.page-auction .auc-card__bid-button {
  justify-content: center;
}

/* Grid view: true multi-column cards */
body.page-auction .auc-card-grid.is-view-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 1100px) {
  body.page-auction .auc-card-grid.is-view-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

body.page-auction .auc-card-grid.is-view-grid .auc-card {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  grid-template-areas:
    "media"
    "body"
    "deal"
    "actions";
  min-height: 0;
  gap: .75rem;
  padding: .85rem;
}

body.page-auction .auc-card-grid.is-view-grid .auc-card__media {
  grid-area: media;
  aspect-ratio: 4 / 3;
}

body.page-auction .auc-card-grid.is-view-grid .auc-card__body {
  grid-area: body;
  padding: 0 .1rem;
}

body.page-auction .auc-card-grid.is-view-grid .auc-card__deal {
  grid-area: deal;
  text-align: center;
}

body.page-auction .auc-card-grid.is-view-grid .auc-card__actions {
  grid-area: actions;
}

body.page-auction .auc-card-grid.is-view-grid .auc-countdown__label,
body.page-auction .auc-card-grid.is-view-grid .auc-current-price__label {
  justify-content: center;
}

@media (max-width: 900px) {
  body.page-auction .auc-hero {
    background-position: 72% center;
  }

  body.page-auction .auc-hero__copy {
    position: relative;
    z-index: 1;
    max-width: 100%;
  }
}
