/* Saving group — rewards (Figma 334:38205 list, 344:45508 code).
   Loaded after style.css. Prefix sgr- to avoid colliding with other agents. */


.sgr-page,
.sgr-code,
.sgr-list,
.sgr-code-inner {
  font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #232934;
}

.sgr-page,
.sgr-code,
.sgr-list,
.sgr-code-inner,
.sgr-page *,
.sgr-code * {
  box-sizing: border-box;
}

.sgr-page ::selection,
.sgr-code ::selection {
  background: #FFB3E6;
  color: #232934;
}

.sgr-page button,
.sgr-code button {
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

.sgr-filter:focus-visible,
.sgr-tab:focus-visible,
.sgr-card:focus-visible,
.sgr-copy:focus-visible,
.sgr-mint:focus-visible,
.sgr-seg-btn:focus-visible,
.sgr-filter-item:focus-visible {
  outline: 2px solid #ED008C;
  outline-offset: 2px;
}

body:has(.sgr-page) {
  background: #FFFFFF !important;
}

body:has(.sgr-code) {
  background: #FFB3E6 !important;
}

/* ---------- list 334:38205 ---------- */

.sg-page.sgr-page {
  background: #FFFFFF;
  min-height: 100vh;
  overflow-x: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.sgr-list {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: 18px 16px 8px;
}

.sgr-filter-wrap {
  position: absolute;
  right: 0;
  top: 0;
}

.sgr-filter {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #F0F1F3;
  border-radius: 14px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sgr-filter img {
  width: 16px;
  height: 16px;
  display: block;
}

.sgr-filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 176px;
  padding: 6px;
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.sgr-filter-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
  color: #444E61;
  cursor: pointer;
}

.sgr-filter-item.is-active {
  background: #FFF4F7;
  color: #DA0081;
}

.sgr-tabs {
  display: flex;
  gap: 6px;
  margin: 18px 0;
}

.sgr-tab {
  flex: 1;
  height: 40px;
  border: 1px solid #F0F1F3;
  border-radius: 999px;
  background: #F8F8F9;
  color: #444E61;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 12px;
}

.sgr-tab:hover:not(.is-active) {
  background: #F0F1F3;
}

.sgr-tab.is-active {
  background: #E30086;
  border-color: #ED008C;
  color: #FFFFFF;
  box-shadow: inset 0 4px 4px rgba(0, 0, 0, 0.25);
}

.sgr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
}

/* ปุ่ม "แสดงเพิ่ม" — ค่าเดียวกับปุ่มของหน้า /redeem (col-10 ของ Bootstrap + .gsb-redeem-catalog .btn-brand-primary) */
.sgr-more {
  display: block;
  width: calc(100% * 10 / 12 - 4px);
  height: 42px;
  /* ล่าง 16 + padding ของ .sgr-list = ห่างแถบเมนูล่าง 24px ตอนเลื่อนสุด เท่ากับ /redeem */
  margin: 32px auto 16px;
  padding: 0 16px;
  border: 1px solid #ED008C;
  border-radius: 999px;
  background: #ED008C;
  color: #FFFFFF;
  font-size: 14px;
  line-height: 21px;
  font-weight: 700;
  cursor: pointer;
}

.sgr-more:disabled {
  opacity: 0.65;
  cursor: default;
}

.sgr-card {
  display: flex;
  flex-direction: column;
  height: 268px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 2px 2px rgba(0, 0, 0, 0.15);
  text-align: left;
  cursor: pointer;
}

.sgr-card:hover {
  box-shadow: 0 4px 12px rgba(17, 20, 27, 0.14);
}

.sgr-card-pic {
  position: relative;
  flex: 0 0 130px;
  height: 130px;
  width: 100%;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sgr-card-pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* สิทธิ์เต็มแล้ว — โควตาหมด · ตัวป้ายใช้คอมโพเนนต์ SoldOutStamp (ไฟล์ภาพจากดีไซน์) */
.sgr-card.is-soldout {
  cursor: default;
}

.sgr-card-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sgr-card-name {
  font-size: 12px;
  line-height: 14px;
  font-weight: 600;
  color: #232934;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sgr-card-note {
  font-size: 12px;
  line-height: 14px;
  font-weight: 400;
  color: #566278;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sgr-card-point {
  margin-top: auto;
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
  color: #232934;
}

.sgr-card-unit {
  font-weight: 500;
  color: #566278;
}

.sgr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 8px 24px;
}

.sgr-empty img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
}

.sgr-empty p {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: #303747;
}

.sgr-empty span {
  margin-top: 4px;
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
  color: #737D91;
}

.sgr-empty-on-pink p,
.sgr-empty-on-pink span {
  color: #303747;
}

@keyframes sgr-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.sgr-skel {
  display: block;
  background: #F0F1F3;
  border-radius: 16px;
  animation: sgr-pulse 1.2s ease-in-out infinite;
}

.sgr-skel-card {
  height: 268px;
}

/* ---------- code sheet 344:45508 ---------- */

/* ---- หน้าโค้ดของรางวัล (Figma 288:27766) ---- */
.sg-page.sgr-code {
  position: relative;
  min-height: 100vh;
  background-color: #FFFFFF;
  overflow-x: hidden;
}

.sgr-code-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sgr-code-top {
  position: relative;
  overflow: hidden;
  padding: 24px 16px;
  background-color: #FFB3E6;
}

.sgr-code-top::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 720px;
  height: 720px;
  transform: translate(-50%, -48%);
  background: #FFFFFF;
  opacity: 0.18;
  -webkit-mask: url('/assets/images/saving-group/sg-rays.png') center / contain no-repeat;
  mask: url('/assets/images/saving-group/sg-rays.png') center / contain no-repeat;
  pointer-events: none;
  z-index: 0;
}

.sgr-code-hero,
.sgr-code-card,
.sgr-empty {
  position: relative;
  z-index: 1;
}

.sgr-code-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0 0 18px;
}

.sgr-code-hero img {
  width: 109px;
  height: 109px;
  display: block;
  object-fit: cover;
}

.sgr-code-hero p {
  margin: 0;
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  color: #ED008C;
  text-shadow: 0 0 2px rgba(240, 241, 243, 0.72);
  text-align: center;
}

.sgr-code-card {
  background: #FFFFFF;
  border-radius: 16px;
  overflow: hidden;
  text-align: center;
}

.sgr-code-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
}

.sgr-code-pic {
  width: 100%;
  height: 181px;
  border-radius: 12px;
  background: #DFE1E6;
  overflow: hidden;
}

.sgr-code-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sgr-code-title {
  margin: 0;
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
  color: #232934;
  text-align: center;
}

.sgr-seg {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 40px;
}

.sgr-seg-btn {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 1px solid #F0F1F3;
  border-left: 0;
  border-radius: 0;
  background: #F8F8F9;
  color: #444E61;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  cursor: pointer;
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sgr-seg-btn:first-child {
  border-radius: 999px 0 0 999px;
}

.sgr-seg-btn:last-child {
  border-radius: 0 999px 999px 0;
}

.sgr-seg-btn.is-active {
  border-color: #ED008C;
  /* ของรางวัลปกติคืนเส้นซ้ายตอน active ไม่งั้นขอบซ้ายของแท็บกลางจะหายไปเส้นหนึ่ง */
  border-left: 1px solid #ED008C;
  background: #E30086;
  color: #FFFFFF;
  box-shadow: inset 0 4px 4px rgba(0, 0, 0, 0.25);
}

.sgr-code-redeem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 0 0;
}

.sgr-code-panel {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px 0 0;
}

.sgr-code-value {
  margin: 0;
  font-size: 28px;
  line-height: 32px;
  font-weight: 600;
  color: #232934;
  word-break: keep-all;
}

.sgr-code-graphic {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  overflow-x: auto;
}

.sgr-code-graphic svg,
.sgr-code-graphic canvas {
  max-width: 100%;
  height: auto;
}

.sgr-code-hint {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: #232934;
}

.sgr-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid #566278;
  border-radius: 999px;
  background: #FFFFFF;
  color: #566278;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  cursor: pointer;
}

.sgr-copy img {
  width: 24px;
  height: 24px;
  display: block;
}

.sgr-copy:hover {
  background: #F8F8F9;
}

.sgr-code-foot {
  display: flex;
  justify-content: center;
  padding: 12px;
  border-top: 1px dashed #99A1AF;
}

.sgr-expire {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid #FDEAE7;
  border-radius: 196px;
  background: #FDEAE7;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
  color: #D41C22;
}

.sgr-expire img {
  width: 20px;
  height: 20px;
  margin: 2px;
  display: block;
  border-radius: 50%;
  background: #E32D33;
}

.sgr-details {
  padding: 18px;
  background: #FFFFFF;
}

.sgr-details-title {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
  color: #232934;
}

.sgr-details-list {
  margin: 0;
  padding: 0 0 0 1.25em;
  color: #444E61;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
}

.sgr-details-list li + li {
  margin-top: 12px;
}

.sgr-cta {
  margin-top: auto;
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: #FFFFFF;
}

.sgr-mint {
  display: block;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 18px;
  color: #FFFFFF;
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(153.61deg, #42f2d9 0%, #03bbb1 53.85%, #049b9b 100%);
  box-shadow:
    0 10px 11px rgba(3, 133, 133, 0.2),
    0 3px 3px rgba(3, 133, 133, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.sgr-mint:hover {
  filter: brightness(1.03);
}

.sgr-mint:disabled {
  background: #C4C4C4;
  box-shadow: none;
  cursor: not-allowed;
  filter: none;
}
