:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #1e293b;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --radius: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.pub-header { background: var(--card-bg); border-bottom: 3px solid var(--primary); padding: 1rem 2rem; display: flex; align-items: center; gap: 1rem; }
.pub-header .logo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); }
.pub-header h1 { font-size: 1.25rem; font-weight: 600; color: var(--secondary); }
.pub-header .sub { color: var(--text-light); font-size: 0.85rem; }
.pub-header .nav-links { margin-left: auto; display: flex; gap: 1rem; font-size: 0.9rem; }

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow 0.15s; }
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.card-img { width: 100%; height: 180px; object-fit: cover; background: #e2e8f0; display: flex; align-items: center; justify-content: center; color: var(--text-light); font-size: 0.85rem; }
.card-body { padding: 1rem; }
.card-body h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.card-body p { font-size: 0.85rem; color: var(--text-light); margin-bottom: 0.5rem; }
.card-body .price { font-size: 1.1rem; font-weight: 600; color: var(--primary); }

/* Buttons */
.btn { display: inline-block; padding: 0.5rem 1.25rem; border: none; border-radius: var(--radius); font-size: 0.9rem; cursor: pointer; font-weight: 500; transition: background 0.15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: #f1f5f9; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.65rem 1.5rem; font-size: 1rem; }

/* Progress bar */
.progress-wrap { background: #e2e8f0; border-radius: 999px; height: 12px; overflow: hidden; margin: 0.5rem 0; }
.progress-fill { height: 100%; background: var(--success); border-radius: 999px; transition: width 0.4s; }

/* Stats row */
.stats-row { display: flex; gap: 2rem; margin: 1rem 0; flex-wrap: wrap; }
.stat { text-align: center; }
.stat .value { font-size: 1.5rem; font-weight: 700; }
.stat .label { font-size: 0.8rem; color: var(--text-light); }

/* Leaderboard */
.leaderboard { list-style: none; }
.leaderboard li { display: flex; align-items: center; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); gap: 0.75rem; transition: background 0.1s; }
.leaderboard li:hover { background: #f8fafc; }
.leaderboard .rank { font-weight: 700; width: 2.5rem; text-align: center; color: var(--primary); font-size: 1.1rem; }
.leaderboard .name { flex: 1; font-weight: 500; }
.leaderboard .stats-inline { font-size: 0.8rem; color: var(--text-light); margin-right: 1rem; }
.leaderboard .amount { font-weight: 600; font-size: 1.05rem; }
.leaderboard li.rank-gold { background: linear-gradient(90deg, #fef9c3 0%, transparent 60%); }
.leaderboard li.rank-silver { background: linear-gradient(90deg, #f1f5f9 0%, transparent 60%); }
.leaderboard li.rank-bronze { background: linear-gradient(90deg, #fed7aa 0%, transparent 60%); }
.leaderboard li.rank-gold .rank { color: #b45309; }
.leaderboard li.rank-silver .rank { color: #475569; }
.leaderboard li.rank-bronze .rank { color: #9a3412; }

/* Cart */
.cart-bar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card-bg); border-top: 2px solid var(--primary); padding: 0.75rem 2rem; display: flex; align-items: center; gap: 1rem; z-index: 50; box-shadow: 0 -2px 10px rgba(0,0,0,0.08); }
.cart-bar.hidden { display: none; }
.cart-bar .cart-count { background: var(--primary); color: #fff; border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.85rem; font-weight: 600; }
.cart-bar .cart-total { font-weight: 600; font-size: 1.1rem; margin-left: auto; }

/* Checkout form */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.25rem; font-size: 0.9rem; }
.form-group input { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; }
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }

/* Cart table */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.cart-table th { text-align: left; padding: 0.5rem; border-bottom: 2px solid var(--border); font-size: 0.85rem; color: var(--text-light); }
.cart-table td { padding: 0.5rem; border-bottom: 1px solid var(--border); }
.cart-table .qty-input { width: 50px; text-align: center; padding: 0.25rem; border: 1px solid var(--border); border-radius: 4px; }
.cart-table .remove-btn { color: var(--danger); cursor: pointer; border: none; background: none; font-size: 1.1rem; }

/* Summary */
.order-summary { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.summary-row { display: flex; justify-content: space-between; padding: 0.35rem 0; }
.summary-row.total { border-top: 2px solid var(--text); margin-top: 0.5rem; padding-top: 0.75rem; font-weight: 700; font-size: 1.1rem; }

/* Confirmation */
.confirmation-box { background: var(--card-bg); border: 2px solid var(--success); border-radius: var(--radius); padding: 2rem; text-align: center; margin: 2rem 0; }
.confirmation-box h2 { color: var(--success); margin-bottom: 0.5rem; }

/* Alert */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-info { background: #dbeafe; color: #1e40af; }
.alert-warning { background: #fef3c7; color: #92400e; }

/* Sponsor grid — school landing page */
.sponsor-grid { display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center; }
.sponsor-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-align: center; min-width: 160px; max-width: 220px; transition: box-shadow 0.15s; }
.sponsor-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.sponsor-logo { max-height: 60px; max-width: 140px; object-fit: contain; margin-bottom: 0.5rem; }
.sponsor-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.tier-badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.tier-badge-title { background: #fbbf24; color: #78350f; }
.tier-badge-platinum { background: #e2e8f0; color: #334155; }
.tier-badge-gold { background: #fde68a; color: #92400e; }
.tier-badge-silver { background: #f1f5f9; color: #475569; }
.tier-badge-bronze { background: #fed7aa; color: #9a3412; }
.tier-badge-custom { background: #dbeafe; color: #1e40af; }
.sponsor-card.tier-title { border-color: #fbbf24; border-width: 2px; }
.sponsor-card.tier-platinum { border-color: #94a3b8; border-width: 2px; }
.sponsor-card.tier-gold { border-color: #fbbf24; }

/* Sponsor strip — campaign page (compact) */
.sponsor-strip { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.sponsor-chip { display: flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.75rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: 999px; font-size: 0.8rem; font-weight: 500; }
.sponsor-chip-logo { height: 20px; max-width: 40px; object-fit: contain; }

/* Responsive */
@media (max-width: 768px) {
  .pub-header { flex-wrap: wrap; padding: 0.75rem 1rem; }
  .pub-header .nav-links { margin-left: 0; width: 100%; }
  .container { padding: 1rem; }
  .stats-row { gap: 1rem; }
  .cart-bar { padding: 0.5rem 1rem; }
  .sponsor-grid { gap: 0.75rem; }
  .sponsor-card { min-width: 130px; padding: 0.75rem; }
}

/* Footer */
.pub-footer { text-align: center; padding: 2rem 1rem; margin-top: 3rem; border-top: 1px solid var(--border); color: var(--text-light); font-size: 0.8rem; }
.pub-footer img { height: 24px; margin-bottom: 0.5rem; display: block; margin-left: auto; margin-right: auto; }

/* Hero banner */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 70%, black) 100%);
  color: #fff;
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: var(--secondary, #d4a017);
  opacity: 0.1;
  border-radius: 50%;
}
.hero .hero-logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.3);
  margin: 0 auto 1rem;
  background: rgba(255,255,255,0.1);
  object-fit: cover;
}
.hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.25rem; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.hero .hero-sub { font-size: 1rem; opacity: 0.85; margin-bottom: 1.25rem; }
.hero .hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.hero .hero-actions a {
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.15s;
}
.hero .hero-actions a:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.hero .hero-btn-primary { background: var(--secondary, #d4a017); color: #fff; }
.hero .hero-btn-outline { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3); }

/* Store card image placeholder with school colors */
.card-img.store-img {
  background: linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 60%, var(--secondary, #1e293b)) 100%);
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
/* Store card placeholder with icons */
.store-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 100%;
  color: rgba(255,255,255,0.8);
}
.store-placeholder svg {
  opacity: 0.6;
}
.store-placeholder span {
  text-transform: capitalize;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}
