/* ================================================================
   MegaEsim — Compat CSS  (compat.css v1)
   Maps legacy class names & CSS variables → new design tokens.
   Loaded after style.css so it takes precedence over old styles.
   ================================================================ */

/* ── Legacy CSS variable aliases ─────────────────────────────── */
:root {
  --primary:       hsl(var(--gs-primary));
  --primary-dark:  hsl(340 75% 45%);
  --success:       hsl(var(--gs-success));
  --warning:       hsl(var(--gs-warning));
  --danger:        hsl(var(--gs-destructive));
  --border:        hsl(var(--gs-border));
  --bg:            hsl(var(--gs-background));
  --card-bg:       hsl(var(--gs-card));
  --text-dark:     hsl(var(--gs-foreground));
  --text-muted:    hsl(var(--gs-muted-foreground));
  --radius:        var(--gs-radius);
  --radius-sm:     0.5rem;
  --radius-lg:     1rem;
  --radius-xl:     1.25rem;
  --gradient:      linear-gradient(135deg, hsl(var(--gs-gradient-start)), hsl(var(--gs-gradient-end)));
  --gradient-soft: linear-gradient(135deg,
    hsl(var(--gs-gradient-start) / 0.06),
    hsl(var(--gs-gradient-end)   / 0.10));
}

/* ── Typography helpers ──────────────────────────────────────── */
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.text-muted-gs { color: hsl(var(--gs-muted-foreground)) !important; }
.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.fw-semibold { font-weight: 600 !important; }

/* ── Page hero ───────────────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, hsl(232 55% 13%) 0%, hsl(268 48% 24%) 45%, hsl(340 62% 42%) 100%);
  padding: 3rem 0 2.5rem;
  border-bottom: none;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 15% 50%, rgba(255,255,255,0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 40%, hsl(340 70% 55% / 0.22) 0%, transparent 50%);
  pointer-events: none;
}
.page-hero h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(1.625rem, 4vw, 2.25rem);
  line-height: 1.2;
  color: #fff;
}
.page-hero p,
.page-hero .text-muted-gs { color: rgba(255,255,255,0.72) !important; }
.page-hero .breadcrumb-item a { color: rgba(255,255,255,0.65) !important; }
.page-hero .breadcrumb-item a:hover { color: #fff !important; }
.page-hero .breadcrumb-item.active,
.page-hero .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.5) !important; }

/* ── Section spacing ─────────────────────────────────────────── */
.py-section    { padding-top: 5rem !important; padding-bottom: 5rem !important; }
.py-section-sm { padding-top: 3rem !important; padding-bottom: 3rem !important; }

/* ── Section headings ────────────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: hsl(var(--gs-primary));
  text-transform: uppercase;
  margin-bottom: 0.625rem;
}
.section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: hsl(var(--gs-foreground));
}
.section-subtitle {
  color: hsl(var(--gs-muted-foreground));
  font-size: 1.0625rem;
  max-width: 38rem;
  margin-bottom: 2.5rem;
}

/* ── Card ────────────────────────────────────────────────────── */
.gs-card {
  background-color: hsl(var(--gs-card));
  border: 1px solid hsl(var(--gs-border));
  border-radius: 1rem;
  transition: box-shadow .3s ease;
}

/* ── Feature card + icon wrap ────────────────────────────────── */
.feature-card {
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: box-shadow .3s ease, transform .3s ease;
}
.feature-card:hover {
  box-shadow: 0 15px 30px -10px rgb(0 0 0 / 0.10);
  transform: translateY(-2px);
}
.icon-wrap {
  width: 56px;
  height: 56px;
  background: hsl(var(--gs-primary) / 0.10);
  border-radius: 0.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.375rem;
  color: hsl(var(--gs-primary));
  flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary-gs {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.625rem 1.375rem;
  background: var(--gradient);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--gs-radius);
  border: 0;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.5;
  transition: all .2s ease;
  box-shadow: 0 4px 15px -4px hsl(var(--gs-primary) / 0.40);
}
.btn-primary-gs:hover {
  color: #fff;
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -6px hsl(var(--gs-primary) / 0.55);
}

.btn-outline-gs {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.5625rem 1.25rem;
  background: transparent;
  color: hsl(var(--gs-foreground));
  border: 1.5px solid hsl(var(--gs-border));
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--gs-radius);
  text-decoration: none;
  cursor: pointer;
  line-height: 1.5;
  transition: all .2s ease;
}
.btn-outline-gs:hover {
  background: hsl(var(--gs-secondary));
  color: hsl(var(--gs-foreground));
  border-color: hsl(var(--gs-border));
}

/* ── Form controls ───────────────────────────────────────────── */
.form-control-gs {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid hsl(var(--gs-border));
  border-radius: 0.625rem;
  background: hsl(var(--gs-background));
  color: hsl(var(--gs-foreground));
  font-size: 0.9rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  -webkit-appearance: none;
  font-family: inherit;
}
.form-control-gs:focus {
  border-color: hsl(var(--gs-primary));
  box-shadow: 0 0 0 3px hsl(var(--gs-primary) / 0.15);
}
select.form-control-gs { cursor: pointer; }

.form-label-gs {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  display: block;
  color: hsl(var(--gs-foreground));
}

/* ── Search box ──────────────────────────────────────────────── */
.search-box { position: relative; }
.search-box > i,
.search-box > svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--gs-muted-foreground));
  pointer-events: none;
}
.search-box input,
.search-box .form-control-gs,
.search-box .form-control {
  padding-left: 2.75rem !important;
}

/* ── Filter buttons ──────────────────────────────────────────── */
.countries-filter { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.filter-btn {
  padding: 0.375rem 1rem;
  border: 1.5px solid hsl(var(--gs-border));
  border-radius: 999px;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  color: hsl(var(--gs-muted-foreground));
  transition: all .2s ease;
  text-decoration: none;
  display: inline-block;
  line-height: 1.5;
  font-family: inherit;
}
a.filter-btn { color: hsl(var(--gs-muted-foreground)); }
.filter-btn:hover,
.filter-btn.active {
  background: hsl(var(--gs-primary));
  border-color: hsl(var(--gs-primary));
  color: #fff;
}

/* ── Countries grid (plans.php) ──────────────────────────────── */
.countries-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
@media (min-width: 576px) { .countries-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px) { .countries-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 992px) { .countries-grid { grid-template-columns: repeat(6, 1fr); } }

.country-card-wrap { position: relative; }
.flag-emoji   { font-size: 2rem; margin-bottom: 0.375rem; display: block; line-height: 1; }
.country-name { font-weight: 600; font-size: 0.75rem; text-align: center; line-height: 1.25; }
.country-price {
  font-size: 0.7rem;
  color: hsl(var(--gs-success));
  margin-top: 0.25rem;
  text-align: center;
  font-weight: 600;
}
.popular-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 1;
  font-size: 0.6rem;
  font-weight: 700;
  background: hsl(var(--gs-warning) / 0.15);
  color: hsl(var(--gs-warning));
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb-gs .breadcrumb { background: transparent; padding: 0; margin: 0; }
.breadcrumb-gs .breadcrumb-item a {
  color: hsl(var(--gs-muted-foreground));
  text-decoration: none;
}
.breadcrumb-gs .breadcrumb-item a:hover { color: hsl(var(--gs-foreground)); }
.breadcrumb-gs .breadcrumb-item.active { color: hsl(var(--gs-foreground)); }
.breadcrumb-gs .breadcrumb-item + .breadcrumb-item::before {
  color: hsl(var(--gs-muted-foreground));
}

/* ── Auth card ───────────────────────────────────────────────── */
.auth-card {
  max-width: 440px;
  margin: 0 auto;
  padding: 2.5rem;
}
/* Divider with "or" text */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  font-size: 0.8125rem;
  color: hsl(var(--gs-muted-foreground));
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: hsl(var(--gs-border));
}

/* ── Blog cards ──────────────────────────────────────────────── */
.blog-card { overflow: hidden; transition: box-shadow .3s ease, transform .3s ease; }
.blog-card:hover {
  box-shadow: 0 15px 30px -10px rgb(0 0 0 / 0.12);
  transform: translateY(-2px);
}
.blog-card-body { padding: 1.25rem; }
.blog-card-cat {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: hsl(var(--gs-primary) / 0.10);
  color: hsl(var(--gs-primary));
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}
.blog-card-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.35;
  font-size: 0.9375rem;
}
.blog-card-title a { color: hsl(var(--gs-foreground)); text-decoration: none; }
.blog-card-title a:hover { color: hsl(var(--gs-primary)); }
.blog-card-meta { font-size: 0.8rem; color: hsl(var(--gs-muted-foreground)); }

/* ── Setup steps (esim-setup-guide.php) ─────────────────────── */
.setup-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.125rem 0;
  border-bottom: 1px solid hsl(var(--gs-border));
}
.setup-step:last-child { border-bottom: 0; }
.setup-step-num {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--gradient);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}
.setup-step-content { flex: 1; padding-top: 0.375rem; }
.setup-step-content p { margin: 0; color: hsl(var(--gs-foreground)); line-height: 1.65; }

/* ── Step items (order-success.php, product.php) ─────────────── */
.step-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.375rem;
}
.step-num {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: hsl(var(--gs-primary) / 0.10);
  color: hsl(var(--gs-primary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}
.step-content h6 { font-weight: 700; margin-bottom: 0.25rem; }
.step-content p { font-size: 0.875rem; color: hsl(var(--gs-muted-foreground)); margin: 0; }

/* ── Cart ────────────────────────────────────────────────────── */
.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid hsl(var(--gs-border));
}
.cart-item:last-child { border-bottom: 0; }
.cart-item-flag  { font-size: 2rem; flex-shrink: 0; }
.cart-item-name  { font-weight: 700; font-size: 0.9rem; }
.cart-item-meta  { font-size: 0.8rem; color: hsl(var(--gs-muted-foreground)); }
.cart-item-price { font-weight: 700; color: hsl(var(--gs-primary)); white-space: nowrap; }

.cart-qty-btn {
  width: 28px;
  height: 28px;
  border: 1.5px solid hsl(var(--gs-border));
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
  font-family: inherit;
}
.cart-qty-btn:hover {
  border-color: hsl(var(--gs-primary));
  color: hsl(var(--gs-primary));
}

/* ── Order summary box ───────────────────────────────────────── */
.order-summary-box {
  background: hsl(var(--gs-card));
  border: 1.5px solid hsl(var(--gs-border));
  border-radius: 1rem;
  padding: 1.5rem;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid hsl(var(--gs-border) / 0.5);
}
.summary-row:last-of-type { border-bottom: 0; }
.summary-row.total {
  font-weight: 700;
  font-size: 1rem;
  border-top: 1.5px solid hsl(var(--gs-border));
  border-bottom: 0;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
}

/* ── Package card (product.php) ──────────────────────────────── */
.package-card { padding: 1.5rem; position: relative; }
.package-card.featured {
  border-color: hsl(var(--gs-primary));
  box-shadow: 0 8px 25px -8px hsl(var(--gs-primary) / 0.20);
}
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--gradient);
  color: #fff;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}
.plan-data {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: hsl(var(--gs-foreground));
  line-height: 1.1;
}
.plan-validity { font-size: 0.8125rem; color: hsl(var(--gs-muted-foreground)); margin-top: 0.25rem; }
.plan-price {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: hsl(var(--gs-primary));
  line-height: 1.1;
}
.plan-price sup { font-size: 1rem; vertical-align: super; }
.package-card ul { list-style: none; padding: 0; margin: 1rem 0; }
.package-card li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  padding: 0.25rem 0;
  color: hsl(var(--gs-foreground));
}
.package-card li .bi-check-circle-fill { color: hsl(var(--gs-success)); }

/* ── Network badge ───────────────────────────────────────────── */
.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--gs-success));
  background: hsl(var(--gs-success) / 0.10);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── Dashboard sidebar ───────────────────────────────────────── */
.dashboard-sidebar {
  background: hsl(var(--gs-card));
  border: 1px solid hsl(var(--gs-border));
  border-radius: 1rem;
  padding: 1.5rem;
  height: fit-content;
}
.dashboard-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--gs-muted-foreground));
  text-decoration: none;
  transition: all .2s ease;
}
.dashboard-sidebar .nav-link:hover {
  background: hsl(var(--gs-secondary));
  color: hsl(var(--gs-foreground));
}
.dashboard-sidebar .nav-link.active {
  background: hsl(var(--gs-primary) / 0.10);
  color: hsl(var(--gs-primary));
}

/* ── Stat cards (dashboard) ──────────────────────────────────── */
.stat-card {
  background: hsl(var(--gs-card));
  border: 1px solid hsl(var(--gs-border));
  border-radius: 0.875rem;
  padding: 1.25rem;
  text-align: center;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}
.stat-val {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}
.stat-lbl { font-size: 0.8rem; color: hsl(var(--gs-muted-foreground)); margin-top: 0.375rem; }

/* ── Admin / user table ──────────────────────────────────────── */
.admin-table { font-size: 0.875rem; }
.admin-table th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: hsl(var(--gs-muted-foreground));
  background: hsl(var(--gs-secondary));
  padding: 0.75rem 1rem;
  border: 0;
}
.admin-table td {
  padding: 0.875rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid hsl(var(--gs-border) / 0.5);
}
.admin-table tr:last-child td { border-bottom: 0; }

/* ── Status badges ───────────────────────────────────────────── */
.badge-success-gs {
  display: inline-flex; padding: 0.2rem 0.625rem;
  border-radius: 999px; font-size: 0.75rem; font-weight: 600;
  background: hsl(var(--gs-success) / 0.12); color: hsl(var(--gs-success));
}
.badge-warning-gs {
  display: inline-flex; padding: 0.2rem 0.625rem;
  border-radius: 999px; font-size: 0.75rem; font-weight: 600;
  background: hsl(var(--gs-warning) / 0.12); color: hsl(var(--gs-warning));
}
.badge-danger-gs {
  display: inline-flex; padding: 0.2rem 0.625rem;
  border-radius: 999px; font-size: 0.75rem; font-weight: 600;
  background: hsl(var(--gs-destructive) / 0.12); color: hsl(var(--gs-destructive));
}

/* ── Extra utility ───────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.text-primary   { color: hsl(var(--gs-primary)) !important; }
.text-success   { color: hsl(var(--gs-success)) !important; }
.text-warning   { color: hsl(var(--gs-warning)) !important; }
.text-danger    { color: hsl(var(--gs-destructive)) !important; }
