/* IdealData — Data bundles for Ghana */

:root {
  --bg: #0f1419;
  --bg-elevated: #1a2129;
  --bg-card: #1e2732;
  --border: #2d3844;
  --text: #e6edf3;
  --text-muted: #8b9aad;
  --accent: #f0b429;
  --accent-dim: #c4921f;
  --ghana-green: #006b3f;
  --ghana-red: #ce1126;
  --mtn-yellow: #ffcc00;
  --airteltigo: #ed1c24;
  --telecel: #00a651;
  --success: #3fb950;
  --error: #f85149;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --font: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 20, 25, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

.logo-icon {
  color: var(--accent);
  font-size: 1.1rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.nav-toggle:hover {
  border-color: var(--accent);
  background: rgba(240, 180, 41, 0.08);
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.25s;
}

.header.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.header.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

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

.btn-cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.btn-cart:hover {
  border-color: var(--accent);
  background: rgba(240, 180, 41, 0.08);
}

.cart-icon {
  font-size: 1.2rem;
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  color: var(--bg);
  background: var(--accent);
  border-radius: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(240, 180, 41, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.btn-block {
  width: 100%;
}

/* Hero */
.hero {
  position: relative;
  padding: 4rem 0 5rem;
  overflow: hidden;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero p {
  margin: 0 0 1.5rem;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.hero .btn {
  margin-top: 0.5rem;
}

.hero-pattern {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(240, 180, 41, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

/* Filters */
.filters {
  padding: 1rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group select {
  min-width: 160px;
  padding: 0.6rem 0.9rem;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b9aad' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Bundles grid */
.bundles {
  padding: 2.5rem 0 4rem;
}

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

.bundle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.bundle-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.bundle-card.mtn { --carrier-color: var(--mtn-yellow); }
.bundle-card.airteltigo { --carrier-color: var(--airteltigo); }
.bundle-card.telecel { --carrier-color: var(--telecel); }

.bundle-carrier {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bg);
  background: var(--carrier-color);
  border-radius: 4px;
}

.bundle-name {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.bundle-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.bundle-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
}

.bundle-price {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
}

.bundle-price span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.btn-add {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: var(--carrier-color);
  color: #0f1419;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.15s;
}

.btn-add:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.loading,
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

/* How it works */
.how {
  padding: 4rem 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.how h2 {
  margin: 0 0 2rem;
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}

.step {
  text-align: center;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border-radius: 50%;
}

.step h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.step p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Footer */
.footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.footer-social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(240, 180, 41, 0.08);
}

.footer-social svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Cart drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.25s, opacity 0.25s;
}

.drawer.is-open {
  visibility: visible;
  opacity: 1;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.drawer-panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.drawer.is-open .drawer-panel {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.drawer-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.drawer-close {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.drawer-close:hover {
  color: var(--text);
  background: var(--bg-card);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.cart-empty {
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
}

.cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cart-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-info h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.cart-item-info .carrier {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cart-item-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.cart-item-qty button {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.cart-item-qty button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.cart-item-qty span {
  min-width: 24px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
}

.cart-item-price {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
}

.cart-item-remove {
  padding: 0.25rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.cart-item-remove:hover {
  color: var(--error);
  background: rgba(248, 81, 73, 0.15);
}

.drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.cart-total span:last-child {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.25rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.25s, opacity 0.25s;
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.modal-close:hover {
  color: var(--text);
  background: var(--bg-card);
}

.checkout-step {
  padding: 0;
}

.checkout-form {
  padding: 1.5rem;
}

.checkout-pay {
  padding: 1.5rem;
}

.checkout-pay-msg {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.checkout-pay-msg strong {
  color: var(--text);
}

.checkout-pay-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkout-pay-actions .btn {
  text-align: center;
  text-decoration: none;
}

.checkout-pay-actions a.btn {
  display: block;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.required {
  color: var(--error);
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.checkout-summary {
  margin: 1.25rem 0;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.checkout-summary strong {
  color: var(--text);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.form-actions .btn {
  flex: 1;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 0.9rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--success);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 400;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.error {
  background: var(--error);
}

/* Responsive */
@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s, opacity 0.25s, visibility 0.25s;
    z-index: 99;
  }

  .nav a {
    display: block;
    padding: 0.75rem 1.25rem;
    border-radius: 0;
  }

  .header.nav-open .nav {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group select {
    min-width: 100%;
  }

  .drawer-panel {
    max-width: 100%;
  }
}
