/* ============================================
   GoCheckin Rewards – Component Styles
   ============================================ */

/* ==========================================
   LOYALTY CARD
   ========================================== */
.loyalty-card {
  background: var(--color-on-primary);
  border-radius: var(--radius-3xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: visible;
}

.loyalty-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(113, 113, 113, 0.15);
}

/* Card header */
.card-header {
  display: flex;
  align-items: center;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-weak);
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-content-main);
  line-height: var(--line-height-xl);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Points row */
.card-points-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
}

.points-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--color-content-main);
}

.points-label {
  font-size: var(--font-size-s);
  font-weight: var(--font-weight-regular);
  opacity: 0.5;
  line-height: var(--line-height-s);
}

.points-value-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.points-number {
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  color: var(--color-content-main);
  line-height: 1.1;
}

.points-unit {
  font-size: 15.5px;
  font-weight: var(--font-weight-bold);
  color: var(--color-content-main);
}

.points-dollar {
  font-size: var(--font-size-s);
  font-weight: var(--font-weight-regular);
  color: var(--color-content-main);
  line-height: var(--line-height-s);
}

/* Rewards dropdown trigger */
.rewards-dropdown {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  border: none;
  background: none;
  font-family: var(--font-family);
  font-size: var(--font-size-s);
  font-weight: var(--font-weight-regular);
  color: var(--color-content-main);
  line-height: var(--line-height-s);
}

.rewards-dropdown-label {
  font-size: var(--font-size-s);
  font-weight: var(--font-weight-regular);
  color: var(--color-content-main);
  line-height: var(--line-height-s);
}

.dropdown-icon {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.rewards-dropdown.open .dropdown-icon {
  transform: rotate(180deg);
}

/* ---- Rewards Detail Panel (inline collapsible) ---- */
.rewards-detail {
  max-height: 0;
  overflow: hidden;
  margin: 0 calc(-1 * var(--space-5));
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 var(--space-5);
  background: linear-gradient(to bottom, #fff6e6, #ffead1);
}

.rewards-detail.open {
  max-height: 300px;
  padding: 12px var(--space-5);
  border-top: 1px solid rgba(100, 100, 108, 0.1);
  border-bottom: 1px solid rgba(100, 100, 108, 0.1);
}

.rewards-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.rewards-detail-title {
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
  line-height: 24px;
}

.btn-history {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 99px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
  line-height: var(--line-height-s);
  box-shadow: 0 1px 2px rgba(140,140,140,0.1), inset 0 1px 2px rgba(255,255,255,0.5), inset 0 16px 16px rgba(123,113,130,0.1);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  white-space: nowrap;
}

.btn-history svg { color: var(--color-content-main); }

.rewards-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rewards-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rewards-amount {
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
  line-height: 20px;
  white-space: nowrap;
}

.rewards-pts {
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  color: var(--color-content-main);
  line-height: 20px;
  white-space: nowrap;
}

.rewards-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-content-main);
  flex-shrink: 0;
}

.rewards-badge {
  background: #ffdeb2;
  color: #d89912;
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  line-height: 14px;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

/* Progress bar */
.progress-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.progress-milestones {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  margin-bottom: 2px;
}

.progress-milestone {
  font-size: var(--font-size-3xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-content-main);
  text-align: center;
  min-width: 20px;
}

.progress-milestone sup {
  font-size: 6px;
  vertical-align: super;
}

.progress-bar-wrap {
  position: relative;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--color-progress-bg);
  overflow: visible;
}

.progress-bar-fill {
  height: 100%;
  width: var(--fill, 0%);
  border-radius: var(--radius-full);
  background: var(--color-progress-fill);
  transition: width 0.6s ease;
}

.progress-marker {
  position: absolute;
  left: var(--pos);
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-progress-bg);
  border: 1.5px solid var(--color-on-primary);
}

.progress-tooltip {
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translate(0, -50%);
  background: var(--color-progress-tooltip-bg);
  padding: 4px;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-tooltip);
  display: flex;
  align-items: center;
  z-index: 5;
}

.progress-tooltip svg {
  width: 12px;
  height: 12px;
}

/* ==========================================
   PROMO BANNER (Flash Sale)
   ========================================== */
.promo-banner {
  border-radius: var(--radius-l);
  overflow: hidden;
  background: var(--gradient-flash-sale);
  position: relative;
}

.promo-banner-header {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-3) var(--space-5);
  background: linear-gradient(90deg, rgba(180, 102, 218, 0.5) 0%, rgba(178, 102, 219, 0) 80%);
}

.flash-badge {
  display: flex;
  align-items: center;
  gap: 1px;
}

.flash-badge-text {
  font-size: var(--font-size-s);
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
  letter-spacing: 0.3px;
}

.flash-icon {
  width: 8px;
  height: 12px;
  display: inline-flex;
}

.flash-timer {
  display: flex;
  align-items: center;
  gap: 4px;
}

.timer-digit {
  font-size: var(--font-size-s);
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
  font-variant-numeric: tabular-nums;
}

.timer-sep {
  font-size: var(--font-size-s);
  font-weight: var(--font-weight-semibold);
  color: rgba(255,255,255,0.7);
}

.promo-banner-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
}

.promo-copy {
  font-size: 16px;
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  line-height: var(--line-height-l);
}

.promo-image {
  width: 80px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.promo-image img {
  width: 100%;
  object-fit: contain;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn-group {
  display: flex;
  gap: var(--space-3);
  height: 40px;
}

.btn {
  flex: 1;
  height: 100%;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--font-size-m);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
}

.btn:active { transform: scale(0.97); }
.btn:hover  { opacity: 0.9; }

.btn-secondary {
  background: var(--neutral-10);
  color: var(--color-content-main);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn-dark {
  background: var(--color-content-main);
  color: var(--color-white);
}

/* Standalone button variants for styleguide */
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}

/* ==========================================
   SECTION HEADER
   ========================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.section-title {
  font-size: var(--font-size-m);
  font-weight: var(--font-weight-bold);
  color: var(--color-content-main);
}

.section-link {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
  text-decoration: none;
}

/* ==========================================
   MODAL / BOTTOM SHEET
   ========================================== */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  border-radius: inherit;
}

.overlay.open {
  opacity: 1;
  pointer-events: all;
}

.bottom-sheet {
  background: var(--color-on-primary);
  border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
  padding: var(--space-5);
  width: 100%;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 80%;
  overflow-y: auto;
}

.bottom-sheet.open {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--neutral-20);
  border-radius: 100px;
  margin: 0 auto var(--space-5);
}

.sheet-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-content-main);
  margin-bottom: var(--space-4);
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.reward-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border: 1.5px solid var(--color-border-weak);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.reward-option:hover,
.reward-option.selected {
  border-color: var(--color-primary);
  background: rgba(165, 40, 227, 0.04);
}

.reward-option-name {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
}

.reward-option-pts {
  font-size: var(--font-size-s);
  font-weight: var(--font-weight-regular);
  color: var(--color-content-muted);
}

/* ==========================================
   NOTIFICATION BADGE
   ========================================== */
.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #e83d3d;
  border-radius: 50%;
  border: 1.5px solid var(--color-on-primary);
}

/* ==========================================
   SHEET SUBTITLE
   ========================================== */
.sheet-subtitle {
  font-size: var(--font-size-s);
  font-weight: var(--font-weight-regular);
  color: var(--color-content-muted);
  margin-bottom: var(--space-5);
}

/* ==========================================
   SHEET ACTIONS (btn-group with top margin)
   ========================================== */
.sheet-actions {
  display: flex;
  gap: var(--space-3);
  height: 40px;
  margin-top: var(--space-5);
}

/* ==========================================
   DETAIL LIST (inside Detail Sheet)
   ========================================== */
.detail-list {
  display: flex;
  flex-direction: column;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-weak);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 13px;
  font-weight: var(--font-weight-regular);
  color: var(--color-content-muted);
}

.detail-value {
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
}

.detail-value--primary {
  color: var(--color-primary);
}

/* ==========================================
   OFFER ITEMS (inside Offers Sheet)
   ========================================== */
/* ==========================================
   OFFERS SHEET
   ========================================== */

/* Override sheet background to match design surface color */
.offers-bottom-sheet {
  background: var(--color-surface, #f3f0f4);
}

/* Header with back button (detail→offers mode) */
.offers-sheet-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 40px; /* balance the back btn so title appears centered */
  margin-bottom: var(--space-4);
}

.offers-sheet-header .offers-sheet-title {
  margin-bottom: 0;
  flex: 1;
}

.offers-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow:
    0px 0px 16px 0px rgba(102, 102, 102, 0.15),
    inset 0px 1px 2px 0px rgba(255, 255, 255, 0.5),
    inset 0px 16px 16px 0px rgba(123, 113, 130, 0.1);
}

.offers-back-btn .icon {
  width: 20px;
  height: 20px;
  color: var(--color-content-main);
}

/* Default: header hidden, show when .from-detail is added to sheet */
.offers-bottom-sheet .offers-sheet-header { display: none; }
.offers-bottom-sheet.from-detail .offers-sheet-header { display: flex; }
.offers-bottom-sheet.from-detail .offers-sheet-title-standalone { display: none; }

.offers-sheet-title {
  font-size: 20px;
  font-weight: var(--font-weight-bold);
  color: var(--color-content-main);
  text-align: center;
  margin-bottom: var(--space-4);
  line-height: 28px;
}

.offers-list {
  gap: var(--space-4);
}

/* ==========================================
   EXCLUSIVE OFFERS SHEET CARDS (Home → Get Offers)
   Prefixed exc-offer-* to avoid conflict with
   detail-page .offer-card (photo-based cards)
   ========================================== */
.exc-offer-card {
  background: var(--color-sub-surface, #fcfcfc);
  border-radius: 16px;
  box-shadow: 0px 1px 2px 0px rgba(113, 113, 113, 0.1);
  border: 2px solid transparent;
  padding: 16px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  cursor: pointer;
  transition: border-color 0.15s;
}

.exc-offer-card.selected {
  border-color: var(--color-primary, #a528e3);
}

.exc-offer-card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exc-offer-card-text-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exc-offer-card-title {
  font-size: 18px;
  font-weight: var(--font-weight-bold);
  color: var(--color-content-main);
  line-height: 26px;
}

.exc-offer-card-sub {
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  color: var(--color-content-main);
  opacity: 0.7;
  line-height: 20px;
  white-space: nowrap;
}

.exc-offer-card-date {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.7;
}

.exc-offer-clock-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-content-main);
}

.exc-offer-card-date span {
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  color: var(--color-content-main);
  line-height: 20px;
  white-space: nowrap;
}

.exc-offer-card-details {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
  line-height: 20px;
  padding: 0;
}

.exc-offer-card-details svg {
  width: 16px;
  height: 16px;
  color: var(--color-content-main);
}

.exc-offer-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: block;
  object-fit: contain;
}

/* Book Now button — hidden by default, shows on offer select */
.offers-book-wrap {
  margin-top: var(--space-4);
  display: none;
}
.offers-book-wrap.visible {
  display: block;
}

.btn-offers-book {
  width: 100%;
  height: 48px;
  background: var(--color-primary, #a528e3);
  color: #fcfcfc;
  border: none;
  border-radius: 24px;
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-offers-book:hover { opacity: 0.9; }

/* ==========================================
   NOTIFICATION LIST (inside Notif Sheet)
   ========================================== */
.notif-list {
  display: flex;
  flex-direction: column;
}

.notif-item {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-weak);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-l);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-icon-wrap--purple {
  background: rgba(165, 40, 227, 0.1);
}

.notif-icon-wrap--gold {
  background: rgba(243, 184, 82, 0.15);
}

.notif-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-title {
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
}

.notif-desc {
  font-size: var(--font-size-s);
  color: var(--color-content-muted);
}

.notif-time {
  font-size: 11px;
  color: var(--color-content-muted);
  margin-top: var(--space-1);
}

/* ==========================================
   TOAST
   ========================================== */
.toast {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-content-main);
  color: var(--color-white);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 100;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
