:root {
  --primary: #0e7c66;
  /* teal-green */
  --primary-dark: #0a5c4c;
  --accent: #f7941d;
  /* Tanzanian-market orange */
  --accent-dark: #d97b0a;
  --bg: #f6f7f9;
  --text: #202124;
  --muted: #6b7280;
  --danger: #d64545;
  --card-bg: #ffffff;
  --border: #e6e8eb;
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  text-decoration: none;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
}

/* --- Top utility bar --- */
.top-bar {
  background: var(--primary-dark);
  color: #fff;
  font-size: .8rem;
}

.top-bar-inner {
  max-width: 1150px;
  margin: 0 auto;
  padding: 6px 20px;
  display: flex;
  justify-content: space-between;
}

.top-bar-right a {
  color: #fff;
  margin-left: 16px;
  opacity: .9;
}

.top-bar-right a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* --- Main navbar --- */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar-inner {
  max-width: 1150px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
}

.brand-mark {
  background: var(--accent);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.brand-text-accent {
  color: var(--accent);
}

.brand-text-accent-sub {
  font-size: .85rem;
  opacity: .85;
  color: var(--primary-dark);
}

.nav-search {
  flex: 1;
  min-width: 220px;
  display: flex;
  border: 2px solid var(--primary);
  border-radius: 30px;
  overflow: hidden;
}

.nav-search input {
  flex: 1;
  border: none;
  padding: 10px 16px;
  font-size: .9rem;
  outline: none;
  font-family: inherit;
}

.nav-search button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0 18px;
  cursor: pointer;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-btn {
  background: var(--accent);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 600;
}

.nav-btn:hover {
  background: var(--accent-dark);
}

.lang-toggle-float {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 60;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .02em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.lang-toggle-float:hover {
  background: var(--primary-dark);
}

.cart-link {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cart-count-badge {
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 1;
}

/* --- Level / category strip --- */
.level-strip {
  background: var(--primary);
}

.level-strip-inner {
  max-width: 1150px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  gap: 22px;
  overflow-x: auto;
}

.level-strip-inner a {
  color: #fff;
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: .92;
}

.level-strip-inner a:hover {
  opacity: 1;
  text-decoration: underline;
}

.container {
  max-width: 1150px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* --- Hero / search-first --- */
.hero {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: var(--radius);
  margin-bottom: 34px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 2rem;
}

.hero p {
  opacity: .92;
  max-width: 560px;
  margin: 0 auto 20px;
}

.hero-search {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  border-radius: 30px;
  overflow: hidden;
  background: #fff;
}

.hero-search input {
  flex: 1;
  border: none;
  padding: 14px 18px;
  font-size: .95rem;
  outline: none;
  font-family: inherit;
}

.hero-search button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0 24px;
  font-weight: 600;
  cursor: pointer;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 34px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.hero-stats div {
  text-align: center;
}

.hero-stats strong {
  display: block;
  font-size: 1.3rem;
}

.hero-stats span {
  font-size: .78rem;
  opacity: .85;
}

.section {
  margin-bottom: 40px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.section-head h2 {
  margin: 0;
  border-left: 5px solid var(--accent);
  padding-left: 10px;
}

.section-head a.see-all {
  color: var(--primary);
  font-weight: 600;
  font-size: .88rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

/* --- Cards --- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform .15s ease, box-shadow .15s ease;
  display: block;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.category-card {
  padding: 22px 18px;
  text-align: center;
}

.category-card h3 {
  margin: 0 0 6px;
  color: var(--primary-dark);
}

.resource-card .cover-wrap {
  position: relative;
}

.resource-card .cover {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: #eef1f3;
}

.resource-card .cover-placeholder {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  background: linear-gradient(135deg, #e8f3f0, #f7f9fa);
  color: var(--primary);
}

.resource-card .badge-year {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}

.resource-card .badge-type {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
}

.resource-card .card-body {
  padding: 12px 14px 16px;
}

.resource-card h4 {
  margin: 0 0 4px;
  font-size: .95rem;
  line-height: 1.3;
}

.price {
  color: var(--primary-dark);
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: .85rem;
}

.notice {
  background: #fff4e5;
  border: 1px solid #ffdca8;
  color: #7a4a00;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-secondary {
  background: #eef1f3;
  color: var(--text);
  margin-left: 8px;
}

.btn-secondary:hover {
  background: #e2e6e9;
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-small {
  padding: 6px 12px;
  font-size: .78rem;
  border-radius: 20px;
}

/* --- Forms / auth --- */
.form {
  max-width: 440px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  font-size: .88rem;
}

.field-hint {
  margin: 4px 0 0;
  font-size: .78rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  padding-right: 42px;
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  padding: 6px 8px;
  line-height: 1;
  color: var(--muted);
}

.password-toggle:hover {
  color: var(--text);
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  padding-right: 42px;
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 6px 8px;
  line-height: 1;
  color: var(--muted);
}

.password-toggle:hover {
  color: var(--text);
}

.error-text {
  color: var(--danger);
  min-height: 1.2em;
  font-size: .85rem;
}

.success-text {
  color: #1a7f37;
  min-height: 1.2em;
  font-size: .85rem;
}

.auth-section {
  max-width: 460px;
  margin: 30px auto;
  background: var(--card-bg);
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.profile-card {
  max-width: 480px;
  padding: 24px;
  margin-bottom: 20px;
}

.profile-section-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
}

.auth-section h1 {
  text-align: center;
  margin-top: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: .82rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.g_id_signin {
  display: flex;
  justify-content: center;
}

.form-forgot {
  text-align: right;
  margin: -8px 0 12px;
}

.form-forgot a {
  color: var(--primary);
  font-size: .82rem;
  font-weight: 600;
}

.checkout-phone-hint {
  margin-top: 6px;
  font-size: .78rem;
}

/* --- Detail page --- */
.detail-section .card {
  padding: 0;
}

.detail-grid {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  background: var(--card-bg);
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.cover-large {
  width: 260px;
  height: 340px;
  object-fit: cover;
  border-radius: var(--radius);
  background: #eef1f3;
}

.cover-large-placeholder {
  width: 260px;
  height: 340px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #e8f3f0, #f7f9fa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: var(--primary);
}

.detail-info {
  flex: 1;
  min-width: 260px;
}

.detail-tags {
  margin: 8px 0 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background: #eef1f3;
  color: var(--text);
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.actions {
  margin-top: 14px;
}

/* --- Cart --- */
.cart-list {
  margin-bottom: 20px;
}

.cart-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.cart-row-cover {
  flex-shrink: 0;
}

.cover-small {
  width: 50px;
  height: 65px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.cover-small-placeholder {
  background: linear-gradient(135deg, #e8f3f0, #f7f9fa);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.cart-row-info {
  flex: 1;
  min-width: 0;
}

.cart-row-info strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-row-end {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cart-row-price {
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
}

.cart-summary {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: var(--radius);
  text-align: right;
}

/* --- Admin stats --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}

.stat-card h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 1.6rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: .87rem;
}

.table th {
  background: var(--primary);
  color: #fff;
}

.filter-form {
  margin: 10px 0;
}

.filter-form select {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: inherit;
}

/* --- Pagination --- */
.pagination-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 28px 0 10px;
}

.pagination-info {
  color: var(--muted);
  font-size: .82rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-num {
  min-width: 34px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

.pagination-num.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination-num:hover:not(.active) {
  background: #f2f4f6;
}

.pagination-controls .btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.pagination-ellipsis {
  padding: 0 4px;
  color: var(--muted);
}

/* --- WhatsApp float --- */
.whatsapp-float {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: #25d366;
  color: #fff;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  z-index: 60;
}

/* --- Footer --- */
.footer {
  background: var(--primary-dark);
  color: #fff;
  margin-top: 50px;
}

.footer-inner {
  max-width: 1150px;
  margin: 0 auto;
  padding: 34px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
}

.footer-col h4 {
  margin: 0 0 12px;
}

.footer-col a {
  display: block;
  color: #dfe9e6;
  margin-bottom: 6px;
  font-size: .88rem;
}

.footer-col a:hover {
  color: #fff;
}

.payment-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.payment-badges .badge {
  background: rgba(255, 255, 255, 0.12);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: .78rem;
}

.footer-bottom {
  text-align: center;
  padding: 14px 20px;
  font-size: .78rem;
  background: rgba(0, 0, 0, 0.15);
}

@media (max-width: 720px) {
  .navbar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links {
    justify-content: center;
    flex-wrap: wrap;
  }

  .top-bar-inner {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}

/* ==========================================================================
   Mobile bottom tab bar + polish
   ========================================================================== */

.mobile-tabbar {
  display: none;
}

@media (max-width: 720px) {

  /* Give room at the bottom so content never sits under the fixed tab bar */
  body.has-mobile-nav {
    padding-bottom: 70px;
  }

  .brand-text {
    display: none;
  }

  .container {
    padding: 16px 14px;
  }

  /* Hide the desktop nav-links row on mobile; the bottom bar replaces it */
  .navbar-inner {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 10px 14px;
  }

  .nav-links {
    display: none;
  }

  .nav-search {
    order: 2;
  }

  .brand {
    font-size: 1.05rem;
  }

  .top-bar {
    display: none;
  }

  .level-strip-inner {
    padding: 8px 14px;
    gap: 16px;
  }

  .hero {
    padding: 34px 16px;
    border-radius: 0;
    margin: -16px -14px 26px;
  }

  .hero h1 {
    font-size: 1.4rem;
  }

  .hero p {
    font-size: .88rem;
  }

  .hero-search input {
    padding: 12px 14px;
    font-size: .88rem;
  }

  .hero-stats {
    gap: 18px;
    margin-top: 18px;
  }

  .hero-stats strong {
    font-size: 1.05rem;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .resource-card .cover,
  .resource-card .cover-placeholder {
    height: 130px;
  }

  .resource-card h4 {
    font-size: .85rem;
  }

  .card-body {
    padding: 10px 12px 12px;
  }

  .detail-grid {
    padding: 18px;
    gap: 18px;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .cover-large,
  .cover-large-placeholder {
    width: 200px;
    height: 260px;
  }

  .detail-tags {
    justify-content: center;
  }

  .actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .actions .btn-secondary {
    margin-left: 0;
  }

  .cart-row {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 10px;
  }

  .cover-small {
    width: 40px;
    height: 52px;
  }

  .cart-row-info {
    flex-basis: calc(100% - 50px - 10px);
    /* full width minus thumbnail + gap */
  }

  .cart-row-info strong {
    font-size: .88rem;
    white-space: normal;
  }

  .cart-row-end {
    flex-basis: 100%;
    justify-content: space-between;
    padding-left: 50px;
    /* align under the title, past the thumbnail column */
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 560px;
  }

  .whatsapp-float {
    bottom: 82px;
    right: 14px;
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }

  .lang-toggle-float {
    bottom: 82px;
    left: 14px;
    width: 48px;
    height: 48px;
    font-size: .78rem;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    text-align: left;
  }

  .auth-section {
    margin: 16px auto;
    padding: 22px 18px;
    border-radius: var(--radius-sm);
  }

  .hero-search {
    flex-direction: row;
  }

  .filter-form select {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-content {
    padding: 18px 16px 60px;
  }

  .admin-topbar {
    padding: 14px 16px;
  }

  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-toolbar .search-box {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

.mobile-tab {
  position: relative;
}

.mobile-tab .cart-count-badge {
  position: absolute;
  top: 2px;
  right: 14px;
  min-width: 16px;
  height: 16px;
  font-size: .62rem;
}

@media (max-width: 720px) {
  .mobile-tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 80;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }

  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    border-radius: 10px;
    color: var(--muted);
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
  }

  .mobile-tab-icon {
    font-size: 1.25rem;
    line-height: 1;
  }

  .mobile-tab-label {
    font-size: .66rem;
    font-weight: 600;
  }

  .mobile-tab.active {
    color: var(--primary);
  }

  .mobile-tab.active .mobile-tab-icon {
    transform: translateY(-1px);
  }
}

/* Account bottom sheet (mobile) */
.mobile-account-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.35);
}

.mobile-account-sheet.open {
  display: block;
}

.mobile-account-sheet-inner {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: sheet-up .18s ease-out;
}

@keyframes sheet-up {
  from {
    transform: translateY(16px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.mobile-account-name {
  font-weight: 700;
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.mobile-account-sheet-inner a {
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.mobile-account-sheet-inner a:last-of-type {
  border-bottom: none;
}

.mobile-account-close {
  margin-top: 12px;
  background: #eef1f3;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

/* ==========================================================================
   Toast notifications (Sonner-style: rich colors, top-center, stacked)
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 92%;
  max-width: 420px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 14px 14px 16px;
  border-radius: 12px;
  color: #fff;
  font-size: .88rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(-18px) scale(0.96);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: auto;
}

.toast-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-hiding {
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
}

.toast-icon {
  flex-shrink: 0;
  font-size: 1.05rem;
  line-height: 1.4;
}

.toast-message {
  flex: 1;
  word-break: break-word;
}

.toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 4px;
  flex-shrink: 0;
}

.toast-close:hover {
  color: #fff;
}

/* Rich colors */
.toast-success {
  background: #16a34a;
}

.toast-error {
  background: #dc2626;
}

.toast-warning {
  background: #d97706;
}

.toast-info {
  background: #2563eb;
}

@media (max-width: 480px) {
  .toast-container {
    top: 12px;
    width: 94%;
  }

  .toast {
    font-size: .84rem;
    padding: 12px 12px 12px 14px;
  }
}

/* ==========================================================================
   Confirmation dialog (used before initiating a payment, etc.)
   ========================================================================== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 22, 0.5);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .15s ease;
}

.confirm-overlay.confirm-visible {
  opacity: 1;
}

.confirm-box {
  background: #fff;
  border-radius: 16px;
  padding: 26px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  transform: scale(0.94) translateY(6px);
  transition: transform .15s ease;
}

.confirm-overlay.confirm-visible .confirm-box {
  transform: scale(1) translateY(0);
}

.confirm-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.confirm-message {
  margin: 0 0 22px;
  font-size: .92rem;
  line-height: 1.55;
  color: var(--text);
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.confirm-actions .btn {
  margin-left: 0;
}

@media (max-width: 480px) {
  .confirm-box {
    padding: 20px;
  }

  .confirm-actions {
    flex-direction: column-reverse;
  }

  .confirm-actions .btn {
    width: 100%;
    text-align: center;
  }
}
