/* give.css — styles for the /donation/ give page */

/* ── Intent pills ─────────────────────────────────────────── */

.give-quiz-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 10rem;
  padding-bottom: 10rem;
  padding-right: 0.5rem;
  padding-left: 0.5rem;
}
.give-pills-natural {
  position: sticky;
  top: var(--gfa-navbar-preserve, 3.5rem);
  z-index: 1031;
  padding-right: 0.5rem;
  padding-left: 0.5rem;
  padding-top: 0.75rem;
  padding-bottom: 7.5rem;
  margin-top: -11rem;
  pointer-events: none;
}
.give-quiz-wrap h1 {
  margin-bottom: 2rem;
  padding-bottom: 4px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 1);
  font-weight: normal;
}

.give-intent-pill {
  display: inline-flex;
  pointer-events: auto;
  align-items: center;
  gap: 10px;
  padding: 6px 24px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.give-intent-pill:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.give-intent-pill .pill-icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  transition: background 0.2s;
}
.give-intent-pill .pill-icon-circle i {
  font-size: 1rem;
  line-height: 1;
  color: #fff;
}
.give-intent-pill.active {
  background: rgba(var(--give-active-rgb), 0.85);
  color: var(--give-active-text, #fff);
  box-shadow: 0 4px 20px rgba(var(--give-active-rgb), 0.4);
  border-color: rgb(var(--give-active-rgb));
}
.give-intent-pill.active .pill-icon-circle {
  background: var(--give-active-icon-bg, rgba(255, 255, 255, 0.2));
}
.give-intent-pill.active .pill-icon-circle i {
  color: var(--give-active-text, #fff);
}
.give-intent-pill.active:hover {
  background: rgba(var(--give-active-rgb), 0.75);
  box-shadow: 0 4px 20px rgba(var(--give-active-rgb), 0.5);
}
.pills-on-page {
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 0.5rem !important;
  margin-top: -10.4rem;
}
.pills-on-page .give-intent-pill {
  width: auto !important;
  flex-shrink: 1;
}
.pills-on-page .give-intent-pill:not(.active) {
  background: rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.15);
}
.pills-on-page .give-intent-pill:not(.active):hover {
  background: rgba(0, 0, 0, 0.58);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.pills-on-page .give-intent-pill:not(.active) .pill-icon-circle {
  background: rgba(255, 255, 255, 0.15);
}
.pills-on-page .give-intent-pill .pill-icon-circle {
  display: none;
}


/* ── Give button states ───────────────────────────────────── */

.feedback-group {
  display: inline-grid;
  grid-template-areas: "content";
  align-items: center;
}
.feedback-group .btn,
.feedback-group .feedback-success {
  grid-area: content;
}
.feedback-group .btn {
  display: inline-grid;
  grid-template-areas: "button-content";
  align-items: center;
  justify-content: center;
}
.feedback-group .btn .btn-state-idle,
.feedback-group .btn .btn-state-loading,
.feedback-group .btn .btn-state-added {
  grid-area: button-content;
  transition: opacity 0.15s ease-in-out, visibility 0.15s ease-in-out;
}
.feedback-group .btn .btn-state-idle    { opacity: 1; visibility: visible; }
.feedback-group .btn .btn-state-loading { opacity: 0; visibility: hidden; }
.feedback-group .btn .btn-state-added   { opacity: 0; visibility: hidden; }
.feedback-group .btn.htmx-request { pointer-events: none; }
.feedback-group .btn.htmx-request .btn-state-idle    { opacity: 0; visibility: hidden; }
.feedback-group .btn.htmx-request .btn-state-loading { opacity: 1; visibility: visible; }
.feedback-group.show .btn { pointer-events: none; }
.feedback-group.show .btn .btn-state-idle  { opacity: 0; visibility: hidden; }
.feedback-group.show .btn .btn-state-added { opacity: 1; visibility: visible; }
.input-group > .feedback-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}


/* ── Give toggle colors ───────────────────────────────────── */

.btn-toggle-group.give-toggle {
  --bs-btn-toggle-group-active-color: var(--bs-primary);
}
.btn-toggle-group.give-toggle > .btn {
  font-weight: 500;
}


/* ── Toggle-driven label/suffix swaps (CSS replaces JS) ─────── */

.give-amount-monthly { display: none; }
[data-donation-widget]:has(.btn-check[value="M"]:checked) .give-amount-onetime { display: none; }
[data-donation-widget]:has(.btn-check[value="M"]:checked) .give-amount-monthly { display: inline; }

[data-give-custom] .give-mo { display: none; }
[data-donation-widget]:has(.btn-check[value="M"]:checked) [data-give-custom] .give-mo { display: inline; }

.give-widget-desc-one-time { visibility: hidden; }
[data-give-desc-scope]:has(.btn-check[value="O"]:checked) .give-widget-desc-one-time { visibility: visible; }
[data-give-desc-scope]:has(.btn-check[value="O"]:checked) .give-widget-desc-monthly { visibility: hidden; }


/* ── Shimmering labels ───────────────────────────────────── */

@keyframes give-shimmer {
  0%   { background-position:  200% center; }
  100% { background-position: -200% center; }
}
@keyframes give-monthly-shimmer {
  0%   { background-position:  150% center; }
  100% { background-position:  -50% center; }
}
.give-recommended {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: -20px;
  padding: 4px 20px 4px 20px;
  background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%) var(--bs-primary);
  background-size: 200% auto;
  animation: give-shimmer 6s linear infinite;
  color: #fff;
  clip-path: polygon(0% 0%, 12px 50%, 0% 100%, 100% 100%, 100% 0%);
}
.give-mo { font-size: 0.75rem; }
.give-monthly-btn { position: relative; }
.give-monthly-shimmer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, var(--bs-primary) 30%, rgba(255,220,120,0.7) 50%, var(--bs-primary) 70%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: give-monthly-shimmer 3s linear infinite;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
  pointer-events: none;
}
.give-monthly-text { transition: opacity 0.15s ease-in-out; }
.btn-toggle-group.give-toggle:has(> .btn-check:last-of-type:checked) .give-monthly-text { opacity: 0; }
.btn-toggle-group.give-toggle:has(> .btn-check:last-of-type:checked) .give-monthly-shimmer {
  opacity: 1;
}


/* ── Give cards ──────────────────────────────────────────── */

.give-card-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.15;
  color: var(--bs-body-color);
}
.give-card-hero {
  margin: -20px -20px 20px;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  height: 180px;
}
.give-card-wide .give-card-hero { height: 230px; }
.give-price {
  font-size: 1.5rem;
  font-weight: 600;
}
.give-price-unit {
  font-size: 0.75rem;
  color: var(--bs-secondary);
  align-self: flex-end;
  padding-bottom: 0.55em;
}
.give-desc {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}
.give-widget-desc-wrap { display: grid; }
.give-widget-desc-wrap > * { grid-area: 1 / 1; }


/* ── Gift offcanvas ──────────────────────────────────────── */

#giftOCCustomGiveBtn:disabled { cursor: default; }
.give-gift-offcanvas { width: 380px; }
.give-gift-offcanvas .offcanvas-header { padding: 20px 20px 0; }
.give-gift-offcanvas .offcanvas-body {
  padding: 16px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}


/* ── Horizontal gift carousel ───────────────────────────── */

.gift-scroll-wrap { position: relative; }
.gift-items-scroll-outer { position: relative; }
.gift-items-scroll-outer::before,
.gift-items-scroll-outer::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 10px;
  width: 30px;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.2s;
}
.gift-items-scroll-outer::before {
  left: 0;
  background: linear-gradient(to right, var(--bs-white) 0%, transparent 100%);
}
.gift-items-scroll-outer::after {
  right: 0;
  background: linear-gradient(to left, var(--bs-white) 0%, transparent 100%);
}
.gift-scroll-wrap.at-start .gift-items-scroll-outer::before { opacity: 0; }
.gift-scroll-wrap.at-end   .gift-items-scroll-outer::after  { opacity: 0; }
.gift-scroll-arrow {
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: calc(50% - 36px);
  z-index: 3;
  width: 28px;
  height: 72px;
  border-radius: 9999px;
  font-size: 0.85rem;
  transition: opacity 0.2s;
  padding: 0;
}
.gift-items-leave-space-for-buttons { padding-right: 0; padding-left: 0; }
.gift-scroll-prev { left: -40px; }
.gift-scroll-next { right: -40px; }
.gift-scroll-arrow:disabled { opacity: 0; pointer-events: none; }
.gift-items-scroll {
  height: 12rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.gift-items-scroll::-webkit-scrollbar { height: 4px; }
.gift-item-card-v {
  display: inline-flex;
  flex-direction: column;
  background: var(--bs-tertiary);
  border: 1px solid var(--bs-tertiary-shaded);
  border-radius: 12px;
  text-decoration: none;
  text-align: left;
  color: inherit;
  overflow: hidden;
  width: fit-content;
  flex-shrink: 0;
  padding: 0;
  appearance: none;
  transition: background-color 0.15s ease;
}
.gift-item-card-v:hover { background: var(--bs-tertiary-shaded); color: inherit; }
.gift-item-card-v .item-img-v { width: 100px; height: 100px; object-fit: cover; }
.gift-item-name-v {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bs-body-color);
  line-height: 1.3;
  width: 100px;
  word-wrap: break-word;
  overflow: hidden;
}
.gift-item-price-v { font-size: 0.8rem; color: var(--bs-secondary); width: 100px; }
.category-heading { font-size: 1rem; font-weight: 600; color: var(--bs-body-color); margin-bottom: 8px; }


/* ── Search bar clear button ─────────────────────────────── */

.give-section .input-overlay .form-clear {
  background: none;
  border: none;
  color: var(--bs-secondary);
  order: 3;
  padding: 0.375rem 0.75rem 0.375rem 0;
  transition: color 0.15s;
}
.give-section .input-overlay .form-clear:hover { color: var(--bs-body-color); }
.give-section .input-overlay .form-control:placeholder-shown + .form-clear { display: none; }


/* ── btn-white ───────────────────────────────────────────── */

.btn-white {
  background: #fff;
  color: var(--bs-body-color);
  border: 1px solid var(--bs-white-shaded);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.btn-white:hover {
  background: var(--bs-white-shaded);
  color: var(--bs-body-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.btn-white:focus,
.btn-white:focus-visible,
.btn-white:active,
.btn-white:active:focus,
.btn-white:disabled {
  border-color: var(--bs-white-shaded);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  outline: none;
}


/* ── Section layout ──────────────────────────────────────── */

.give-section {
  position: relative;
  box-shadow: inset 0 1px 0 var(--bs-white-shaded);
  padding-bottom: 2rem;
  margin-bottom: 1rem;
}
.give-section::before {
  content: '';
  position: absolute;
  top: -30px;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.1) 0%, transparent 100%);
  pointer-events: none;
}
.give-section-header {
  padding-top: 3rem;
  padding-bottom: 2rem;
  margin-bottom: -1.5rem;
}
.give-section-header-title {
  font-family: inherit;
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bs-primary);
  margin: 0 0 0.4rem;
}
.give-section-header-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--bs-body-color);
  margin: 0;
  max-width: 100ch;
}
.give-section-hidden { opacity: 0; pointer-events: none; user-select: none; }
@keyframes give-section-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.give-section-entering { animation: give-section-in 0.35s ease both; }
.give-section-grid {
  display: grid;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.give-section-grid-sm { grid-template-columns: 1fr; }
.give-section-grid-lg { grid-template-columns: 1fr; }
.give-section-grid .give-card-wide {
  grid-column: 1 / -1;
  justify-self: center;
}
.give-desc > p:last-child { margin-bottom: 0; }


/* ── Donation summary bar (sticky cart) ──────────────────── */

.donation-summary-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--bs-white-shaded);
  box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.09);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  z-index: 1030;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.donation-summary-bar.show {
  opacity: 1;
  pointer-events: auto;
}
.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bs-tertiary);
  border: 1px solid var(--bs-tertiary-shaded);
  border-radius: 9999px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--bs-body-color);
}
.summary-chip .chip-price {
  font-weight: 600;
  color: var(--bs-primary);
}
.summary-chip .chip-remove {
  margin-left: 4px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: color 0.15s;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}
.summary-chip .chip-remove:hover { color: var(--bs-danger); }
.total-text {
  font-size: 12px;
  margin-bottom: -5px;
}
.chip-name {
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}
#summary-chips {
  order: -1;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  padding-bottom: 4px;
}
#summary-chips::-webkit-scrollbar { height: 4px; }
#donation-summary-bar > div:last-child {
  width: 100%;
  justify-content: flex-end;
}


/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 575.98px) {
  .give-pills-natural {
    flex-direction: row !important;
    flex-wrap: wrap !important;
  }
  .give-pills-natural.pills-on-page {
    flex-wrap: nowrap !important;
  }
  .give-intent-pill {
    width: calc(50% - 0.5rem);
    justify-content: space-between;
  }
  .give-intent-pill:last-child:nth-child(odd) {
    width: auto;
    justify-content: center;
  }
  .pills-on-page .give-intent-pill {
    width: auto !important;
  }
}

@media (min-width: 768px) {
  .give-card-sm { max-width: 350px; }
  .give-card-lg { max-width: 500px; }
  .give-card-wide { max-width: 800px; }
  .gift-items-leave-space-for-buttons { padding-right: 1rem; padding-left: 1rem; }
  .gift-scroll-arrow { display: flex; }
  .give-section-grid-sm {
    grid-template-columns: repeat(auto-fit, minmax(280px, 350px));
  }
  .give-section-grid-lg {
    grid-template-columns: repeat(auto-fit, minmax(380px, 500px));
  }
  .donation-summary-bar {
    flex-wrap: nowrap;
    height: 60px;
    padding: 0 48px;
    white-space: nowrap;
    gap: 8px;
  }
  #summary-chips {
    order: 0;
    width: auto;
    flex: 1;
    min-width: 0;
    padding-bottom: 0;
  }
  #donation-summary-bar > div:last-child {
    width: auto;
    margin-left: auto;
  }
}
