/* ===== variables ===== */
:root {
  --brand: #001a96;
  --radius: 6px;
  --max: 960px;
}

/* ===== fonts ===== */
@font-face {
  font-family: SqMarket;
  src: url("fonts/sqmarket-regular.woff") format("woff");
  font-weight: 400;
}
@font-face {
  font-family: SqMarket;
  src: url("fonts/sqmarket-medium.woff") format("woff");
  font-weight: 500;
}
@font-face {
  font-family: SqMarket;
  src: url("fonts/sqmarket-bold.woff") format("woff");
  font-weight: 700;
}

/* ===== base ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: SqMarket, Arial, sans-serif;
  background: #f4f7ff;
}
body.busy button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}
.hidden {
  display: none !important;
}

/* ===== nav ===== */
.nav {
  background: #fff;
  border-bottom: 1px solid #e5e8f1;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
}
.container {
  max-width: var(--max);
  width: 100%;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.logo {
  height: 60px;
}
.right-zone {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.lang {
  color: var(--brand);
  text-decoration: none;
  display: inline-block;
  font-weight: 700;
  line-height: 1;
}
/* highlight current language */
.lang.active {
  background: var(--brand);
  color: #fff;
  padding: 5px 8px;
  border-radius: 4px;
}
.lang:hover {
  text-decoration: underline;
}
.cart-icon {
  position: relative;
  cursor: pointer;
}
.cart-icon img {
  width: 28px;
  filter: brightness(0) saturate(100%) invert(11%) sepia(83%) saturate(2518%)
    hue-rotate(213deg) brightness(94%) contrast(103%);
}
.badge {
  position: absolute;
  top: -6px;
  right: -10px;
  background: #e11d48;
  color: #fff;
  border-radius: 99px;
  font-size: 0.7rem;
  padding: 2px 6px;
  font-weight: 700;
}

/* ===== layout ===== */
.wrapper {
  width: 100%;
  margin-top: 90px;
}
.hero {
  width: 100%;
}
.hero img {
  width: 100%;
  display: block;
}
.inner-content {
  padding-top: 4rem;
  max-width: var(--max);
  margin: auto;
}
.pth-intro {
  margin-bottom: 4rem;
  line-height: 1.5;
}
.pth-intro p:first-child {
  margin-bottom: 2rem;
}
.donate-box {
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.lead,
.d-label {
  font-size: 1.5rem;
  color: #001a96;
  margin-bottom: 1.5rem;
}

.d-label {
  margin-top: 2rem;
}

/* amount buttons */
.amount-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.amt {
  flex: 1 1 110px;
  padding: 1.2rem;
  border: 1px solid #ccc;
  background: #f9fafb;
  border-radius: var(--radius);
  transition: 0.2s;
  font-weight: 700;
  font-size: 1rem;
}
.amt:hover {
  background: #edf1ff;
}
.amt.selected {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* custom amount input */
.custom-wrap {
  position: relative;
  max-width: 240px;
  margin-top: 1rem;
  margin-left: auto;
}
.custom-wrap::before {
  content: "CAD $";
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 500;
  color: #444;
}
#custom-input {
  width: 100%;
  padding: 0.7rem 0.7rem 0.7rem 70px;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  outline: none;
  font-size: 1rem;
  font-family: SqMarket, Arial, sans-serif;
}
#custom-input::-webkit-inner-spin-button {
  appearance: none;
}

/* dropdown */
.dropdown {
  position: relative;
  margin-top: 0.4rem;
}
.dd-trigger {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.arrow {
  border: solid #555;
  border-width: 0 2px 2px 0;
  padding: 4px;
  transform: rotate(45deg);
  transition: 0.3s;
}
.dd-menu {
  position: absolute;
  top: 115%;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: var(--radius);
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  border: 1px solid transparent;
}
.dropdown.open .dd-menu {
  border-color: #ccc;
}
.dd-menu li {
  padding: 0.75rem 1rem;
  cursor: pointer;
}
.dd-menu li:hover {
  background: #f0f4ff;
}

/* donate CTA */
.donate-cta {
  margin-top: 1.5rem;
  background: var(--brand);
  color: #fff;
  padding: 0.85rem 1.9rem;
  border-radius: var(--radius);
  text-transform: uppercase;
}

/* ===== cart panel ===== */
.cart-panel {
  position: fixed;
  top: 90px;
  right: calc(((100vw - var(--max)) / 2) - 10px);
  width: 360px;
  max-height: calc(100vh - 90px);
  background: #fff;
  box-shadow: -3px 0 10px rgba(0, 0, 0, 0.12);
  border-left: 1px solid #e5e8f1;
  transform: translateX(500%);
  opacity: 1;
  transition: transform 0.35s ease, opacity 0.35s;
  display: flex;
  flex-direction: column;
  z-index: 900;
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}
.cart-panel.open {
  transform: translateX(0);
  opacity: 1;
}
.cart-panel h3 {
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
  font-size: 1.1rem;
  color: #001a96;
}
.cart-items {
  flex: 1;
  padding: 1.5rem;
  overflow: auto;
}
.cart-item {
  display: flex;
  gap: 14px;
  border-bottom: 1px solid #eee;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}
.cart-item:last-child {
  border-bottom: none;
  padding-bottom: 0rem;
  margin-bottom: 0rem;
}
.cart-left {
  flex: 1 1 200px;
  min-width: 0;
}

.cart-right {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 100%;
}
.cart-qty {
  font-weight: 600;
  margin-top: 0.2rem;
}
.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid #eee;
}
.totals {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-weight: 700;
  color: var(--brand);
}
.proceed-btn {
  width: 100%;
  padding: 0.8rem;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius);
}
.proceed-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.empty-donation {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
}
.empty-cart {
  width: 110px;
  opacity: 0.5;
  display: block;
  margin-bottom: 1rem;
}

/* checkout */
.checkout-page {
  max-width: 720px;
  margin: 100px auto 0;
  padding: 0 1rem;
  text-align: center;
}
.back-btn {
  margin-top: 2rem;
  padding: 0.7rem 1.4rem;
  background: #ddd;
  border-radius: var(--radius);
}
.cart-title {
  font-weight: 600;
  color: var(--brand);
}
.cart-bank {
  color: var(--brand);
  font-weight: 700;
}
.unit-line {
  font-size: 0.85rem;
  color: #555;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.pill .ctrl {
  all: unset;
  width: 25px;
  height: 25px;
  border: 1px solid var(--brand);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.pill .ctrl:hover {
  background: var(--brand);
  color: #fff;
}
.qty-num {
  min-width: 18px;
  text-align: center;
  font-weight: 600;
}

.cart-right {
  flex: 0 0 90px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
}
.item-total {
  font-weight: 700;
  color: var(--brand);
  font-size: 0.9rem;
  text-align: right;
}
.trash {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.trash:hover {
  filter: brightness(0) saturate(100%) invert(19%) sepia(89%) saturate(5496%)
    hue-rotate(349deg) brightness(84%) contrast(104%);
}

/* responsive tweak */
@media (max-width: 480px) {
  .cart-right {
    flex: 1 1 100%;
    flex-direction: row;
    justify-content: space-between;
    margin-top: 0.6rem;
  }
}

/* fall back to stacked layout only when panel < 320 px */
@media (max-width: 360px) {
  .cart-item {
    flex-wrap: wrap;
  }
  .cart-right {
    flex: 1 1 100%;
    margin: 8px 0 0;
    flex-direction: row;
    justify-content: space-between;
  }
}

/* === cart full-page layout === */
.cart-page {
  max-width: var(--max);
  margin: 2rem auto 4rem;
  padding: 0 12px;
}
.cart-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.cart-logo {
  width: 300px;
}
.back-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
}

/* --- grid: left scrolls with page, right sticks then scrolls away --- */
.cart-grid {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

/* left column simply flows – the whole page scrolls */
.cart-left-side,
.cart-left {
  flex: 1 1 60%;
}

.cart-title {
  margin-bottom: 2rem;
  font-size: 1.8rem;
  color: var(--brand);
}

/* right summary: scrolls until its top hits viewport (top:24px) then sticks;
   when the parent container scrolls out, it scrolls away too              */
.cart-summary {
  flex: 0 0 300px;
  border: 1px solid #e5e8f1;
  border-radius: 8px;
  padding: 1.5rem;
  position: sticky;
  top: 24px;
  background-color: #fff;
}

/* narrow screens stack columns – summary becomes normal flow */
@media (max-width: 800px) {
  .cart-summary {
    flex: 1 1 100%;
    top: 0;
  }
}

.sum-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.sum-row.total {
  font-weight: 700;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed #e5e8f1;
  margin-bottom: 1.5rem;
  color: var(--brand);
}
.coupon {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin: 18px 0;
  font-size: 0.9rem;
}
@media (max-width: 800px) {
  .cart-summary {
    flex: 1 1 100%;
  }
}

/* empty states & buttons */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin: 40px 0;
}
.start-btn,
.more-btn {
  padding: 0.8rem 1.6rem;
  background: var(--brand);
  color: #fff;
  border-radius: 6px;
  font-family: SqMarket, Arial, sans-serif;
  cursor: pointer;
  border: none;
}
.more-btn {
  margin-top: 24px;
}

/* --- footer logo + button --- */
.pth-footer {
  text-align: center;
  margin: 5rem 0rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
.footer-logo {
  max-width: 400px;
  width: 100%;
}
.learn-btn {
  display: inline-block;
  margin-top: 22px;
  padding: 0.9rem 2rem;
  background: var(--brand);
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
}
.learn-btn:hover {
  opacity: 0.9;
}

.empty-state img {
  opacity: 0.5;
}

/* ===== mobile Pay now button ===== */
.pay-now-btn {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  border: none;
  border-radius: 0;
  font-size: 1.05rem;
  font-weight: 600;
  background: var(--brand);
  color: #fff;
  padding: 1rem;
  cursor: pointer;
}

/* show only below 768 px */
@media (min-width: 768px) {
  .pay-now-btn {
    display: none !important;
  }
}

@media (max-width: 1092px) {
  .nav {
    padding: 0rem 1.5rem;
  }
  .inner-content {
    padding: 1.5rem;
  }
  .pth-intro {
    margin-bottom: 1.5rem;
  }
  .pth-intro p:first-child {
    margin-bottom: 1rem;
  }
  .donate-box {
    padding: 1.5rem;
  }
  .cart-page {
    margin: 0;
    padding: 1.5rem;
  }
}

@media (max-width: 980px) {
  .cart-panel {
    right: 0px;
    height: calc(100vh - 150px);
  }
}

@media (max-width: 810px) {
  .cart-grid {
    flex-direction: column;
    align-items: center;
  }
  .cart-left-side {
    order: 2;
  }
  .cart-summary {
    order: 1;
    width: 100%;
    flex: initial;
    top: 0;
  }
}

@media (max-width: 768px) {
  .pth-footer {
    padding: 0rem 1.5rem;
  }
  .container {
    height: 70px;
  }
  .logo {
    height: 40px;
  }
  .cart-panel {
    top: 70px;
  }
  .wrapper {
    margin-top: 70px;
  }
}

@media (max-width: 710px) {
  .custom-wrap {
    max-width: 100%;
  }
}

@media (max-width: 586px) {
  .cart-bar {
    flex-direction: column;
  }
  .back-link {
    order: 2;
    margin-top: 1rem;
  }
}
