/* Gift shop browse + checkout */

.gift-shop {
  padding-top: 28px;
}

.gift-shop-card {
  width: 100%;
  padding: 48px 36px;
  background: var(--accent-soft);
  border: 1px solid rgb(var(--accent-rgb) / 0.16);
  border-radius: 24px;
  text-align: center;
}

.gift-shop h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.85rem, 5vw, 2.5rem);
  color: var(--text);
}

.gift-shop-copy {
  max-width: 520px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.gift-shop-login-gate .gift-shop-copy {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text);
}

.gift-shop-contact {
  margin: 1.25rem 0 0;
  color: var(--text-muted);
}

.gs-hero {
  margin-bottom: 1.25rem;
}

.gs-hero p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  max-width: 36rem;
}

.gs-balance-card {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.12), transparent 55%),
    #fff;
  border: 1px solid rgb(var(--accent-rgb) / 0.18);
}

.gs-label {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.gs-balance-value {
  margin: 0.15rem 0 0;
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
}

.gs-balance-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  max-width: 16rem;
  text-align: right;
}

.gs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.85rem 1rem;
  margin-bottom: 1rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.gs-filter {
  display: grid;
  gap: 0.35rem;
  flex: 1 1 calc(50% - 0.5rem);
  min-width: 0;
  max-width: 100%;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.gs-filter--search {
  flex: 1 1 calc(50% - 0.5rem);
}

.gs-filter--country {
  flex: 1 1 calc(50% - 0.5rem);
}

.gs-filter input,
.gs-filter select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px; /* iOS won't auto-zoom on focus when ≥16px */
  line-height: 1.25;
  color: var(--text);
  background: #fff;
  box-sizing: border-box;
}

.gs-filter select {
  /* Long option labels must not force the control wider than its column */
  text-overflow: ellipsis;
}

.gs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 1rem;
}

.gs-offer {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 100%;
  padding: 1.1rem 1rem 1rem;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.gs-offer:hover {
  border-color: rgb(var(--accent-rgb) / 0.4);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.06);
  transform: translateY(-2px);
}

.gs-offer:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gs-offer-media {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid rgb(0 0 0 / 0.04);
}

.gs-offer-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gs-offer-fallback {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--accent);
}

.gs-offer-body {
  display: grid;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
}

.gs-offer-brand {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gs-offer-country {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gs-offer-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.gs-offer-price {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.gs-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
}

.gs-catalog-loading {
  grid-column: 1 / -1;
  display: grid;
  gap: 1.25rem;
}

.gs-spinner {
  width: 28px;
  height: 28px;
  margin: 0.25rem auto 0;
  border: 2.5px solid rgb(var(--accent-rgb) / 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: gs-spin 0.7s linear infinite;
}

.gs-catalog-loading-text {
  margin: 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.gs-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 1rem;
}

.gs-skeleton-card {
  display: grid;
  gap: 0.85rem;
  padding: 1.1rem 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}

.gs-skeleton-media {
  width: 56px;
  height: 56px;
  border-radius: 12px;
}

.gs-skeleton-line {
  height: 12px;
  width: 78%;
  border-radius: 999px;
}

.gs-skeleton-line--short {
  width: 42%;
}

.gs-shimmer {
  background: linear-gradient(
    90deg,
    #ececec 0%,
    #f7f7f7 45%,
    #ececec 90%
  );
  background-size: 200% 100%;
  animation: gs-shimmer 1.2s ease-in-out infinite;
}

@keyframes gs-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes gs-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.gs-banner {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #f4f4f5;
  color: var(--text);
  font-size: 0.9375rem;
}

.gs-banner--ok {
  background: #ecfdf3;
  color: #166534;
}

.gs-receipt {
  margin-bottom: 1.25rem;
}

.gs-receipt[hidden] {
  display: none !important;
}

.gs-receipt-card {
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: 18px;
  border: 1px solid rgb(var(--accent-rgb) / 0.18);
  background:
    linear-gradient(160deg, rgb(var(--accent-rgb) / 0.08), transparent 50%),
    #fff;
}

.gs-receipt-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.gs-receipt-status {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.gs-receipt-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem 1.25rem;
  margin: 0;
}

.gs-receipt-grid > div {
  display: grid;
  gap: 0.15rem;
}

.gs-receipt-grid dt {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.gs-receipt-grid dd {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9375rem;
  word-break: break-word;
}

.gs-receipt-full {
  grid-column: 1 / -1;
}

.gs-receipt-highlight {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: rgb(var(--accent-rgb) / 0.08);
  border: 1px solid rgb(var(--accent-rgb) / 0.2);
}

.gs-receipt-highlight .gs-receipt-link {
  font-size: 1rem;
}

.gs-receipt-link {
  font-weight: 600;
}

.gs-receipt-pending {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 1rem 0 0;
}

.gs-receipt-close-wrap {
  margin: 1.25rem 0 0;
  text-align: center;
}

.gs-receipt-close {
  min-width: 160px;
}

.gs-spinner--inline {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .gs-receipt-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.gs-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgb(0 0 0 / 0.35);
}

.gs-checkout {
  position: fixed;
  z-index: 130;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(100% - 2rem, 420px);
  max-height: min(90dvh, 640px);
  overflow: auto;
  padding: 1.25rem 1.25rem 1.4rem;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.18);
}

.gs-checkout-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.gs-checkout-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.gs-muted {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.gs-icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--bg);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.gs-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.gs-field[hidden] {
  display: none !important;
}

.gs-field label {
  font-size: 0.875rem;
  font-weight: 600;
}

.gs-field input {
  height: 44px;
  padding: 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px; /* iOS won't auto-zoom on focus when ≥16px */
  line-height: 1.25;
}

.gs-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.gs-math {
  display: grid;
  gap: 0.45rem;
  margin: 0.5rem 0 1.1rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: var(--bg);
}

.gs-math > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9375rem;
}

.gs-math-total {
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-heading);
  font-weight: 600;
}

.gs-buy {
  width: 100%;
}

.gs-history-list {
  display: grid;
  gap: 1rem;
}

.gs-history-card {
  padding: 1.1rem 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}

.gs-history-card--focus {
  border-color: #b54708;
  box-shadow: 0 0 0 3px rgba(181, 71, 8, 0.12);
}

.gs-history-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.gs-history-brand {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
}

.gs-history-meta {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.gs-history-status {
  flex-shrink: 0;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-muted);
}

.gs-history-status--ok {
  background: #ecfdf3;
  color: #027a48;
}

.gs-history-status--hold {
  background: #fffaeb;
  color: #b54708;
}

.gs-history-status--fail {
  background: #fef3f2;
  color: #b42318;
}

.gs-history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1rem;
  margin: 0;
}

.gs-history-grid dt {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.gs-history-grid dd {
  margin: 0.1rem 0 0;
  font-weight: 600;
  font-size: 0.9375rem;
}

.gs-history-actions {
  margin: 0.85rem 0 0;
}

.gs-history-id {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  word-break: break-all;
}

@media (max-width: 560px) {
  .gift-shop-card {
    padding: 36px 22px;
  }

  .gs-balance-note {
    text-align: left;
    max-width: none;
  }
}
