/* Cupon Go demo — fintech aesthetic (light theme, MP / Naranja X inspired) */

:root {
  --ca-navy:        #0E1A52;
  --ca-navy-deep:   #061037;
  --ca-cyan:        #38BDF8;
  --ca-cyan-soft:   #E0F2FE;
  --ca-bg:          #F4F6FA;
  --ca-surface:     #FFFFFF;
  --ca-text:        #0E1226;
  --ca-text-muted:  #6B7186;
  --ca-text-soft:   #9BA0B5;
  --ca-border:      #E8EAF1;
  --ca-border-soft: #F0F2F8;
  --ca-success:     #16A34A;
  --ca-shadow-sm:   0 1px 2px rgba(14, 26, 82, 0.04);
  --ca-shadow:      0 1px 3px rgba(14, 26, 82, 0.06), 0 8px 24px rgba(14, 26, 82, 0.04);
  --ca-shadow-md:   0 4px 12px rgba(14, 26, 82, 0.08);
  --ca-shadow-lg:   0 24px 60px -20px rgba(14, 26, 82, 0.18);
  --ca-radius-sm:   8px;
  --ca-radius:      14px;
  --ca-radius-lg:   20px;
  --ca-font:        -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--ca-font);
  font-size: 15px;
  color: var(--ca-text);
  background: var(--ca-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ========== Layout ========== */

.cg-app {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar (white, fintech style) ---------- */

.cg-sidebar {
  background: var(--ca-surface);
  border-right: 1px solid var(--ca-border);
  padding: 28px 0 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.cg-brand {
  padding: 0 16px 24px;
  display: flex;
  justify-content: center;
}

.cg-brand a { display: inline-block; line-height: 0; }

.cg-brand-logo {
  width: 156px;
  height: auto;
  display: block;
  -webkit-user-select: none;
  user-select: none;
}

.cg-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
}

.cg-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ca-text-muted);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.cg-nav-item:hover {
  background: var(--ca-bg);
  color: var(--ca-text);
}

.cg-nav-item.active {
  background: var(--ca-cyan-soft);
  color: var(--ca-navy);
  font-weight: 600;
}

.cg-nav-item.active .cg-nav-icon { color: var(--ca-navy); }

.cg-nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--ca-text-soft);
  display: inline-flex;
  align-items: center;
}

.cg-nav-item:hover .cg-nav-icon { color: var(--ca-text); }

.cg-nav-divider {
  height: 1px;
  background: var(--ca-border);
  margin: 12px 24px;
}

.cg-sidebar-footer {
  padding: 14px 24px 0;
  font-size: 12px;
  color: var(--ca-text-soft);
  line-height: 1.5;
}

/* ---------- Main / Topbar ---------- */

.cg-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cg-topbar {
  background: var(--ca-surface);
  border-bottom: 1px solid var(--ca-border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.cg-search {
  flex: 1;
  max-width: 440px;
  position: relative;
}

.cg-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--ca-border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--ca-bg);
  color: var(--ca-text);
  outline: none;
  transition: border 0.15s, background 0.15s, box-shadow 0.15s;
}

.cg-search input::placeholder { color: var(--ca-text-soft); }

.cg-search input:focus {
  border-color: var(--ca-cyan);
  background: var(--ca-surface);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.cg-search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ca-text-soft);
  display: inline-flex;
}

.cg-topbar-spacer { flex: 1; }

.cg-bell {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--ca-border);
  background: var(--ca-surface);
  display: grid;
  place-items: center;
  color: var(--ca-text-muted);
  position: relative;
  transition: background 0.12s, color 0.12s;
}

.cg-bell:hover { background: var(--ca-bg); color: var(--ca-text); }

.cg-bell::after {
  content: "";
  position: absolute;
  top: 9px; right: 10px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ca-cyan);
  border: 2px solid var(--ca-surface);
}

.cg-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: var(--ca-bg);
  font-size: 14px;
  font-weight: 500;
}

.cg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ca-navy);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.3px;
}

/* ---------- Content ---------- */

.cg-content {
  padding: 28px 32px 40px;
  max-width: 1280px;
  width: 100%;
}

/* ---------- Hero (fintech wallet style) ---------- */

.cg-hero-grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.cg-greeting {
  font-size: 13px;
  color: var(--ca-text-muted);
  margin: 0 0 4px;
  font-weight: 500;
}

.cg-greeting-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--ca-text);
  margin: 0 0 24px;
}

/* ===== Membership e-card (vibrant mesh / holographic) ===== */
.cg-ecard {
  position: relative;
  width: 100%;
  aspect-ratio: 1.55 / 1;
  border-radius: 24px;
  padding: 24px 26px 22px;
  color: #fff;
  background:
    /* mesh gradient: 4 vibrant orbs blended over a deep navy base */
    radial-gradient(ellipse 90% 70% at 100% 0%, rgba(34, 211, 238, 0.95) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 0% 100%, rgba(217, 70, 239, 0.85) 0%, transparent 60%),
    radial-gradient(circle at 50% 60%, rgba(99, 102, 241, 0.5) 0%, transparent 55%),
    radial-gradient(ellipse 60% 80% at 100% 100%, rgba(56, 189, 248, 0.45) 0%, transparent 60%),
    linear-gradient(135deg, #030820 0%, #0a1340 50%, #14276b 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow:
    0 36px 72px -22px rgba(8, 14, 48, 0.7),
    0 14px 28px -14px rgba(8, 14, 48, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4);
  overflow: hidden;
  isolation: isolate;
}

/* Top color accent stripe (vibrant) */
.cg-ecard::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #22D3EE 0%, #38BDF8 25%, #818CF8 50%, #C084FC 75%, #D946EF 100%);
  z-index: 2;
}

/* Bottom subtle reflection band */
.cg-ecard::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.18) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Soft color auras */
.cg-ecard-aura {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}
.cg-ecard-aura-1 {
  width: 200px; height: 200px;
  top: 30px; left: 50%;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.45) 0%, transparent 70%);
  mix-blend-mode: screen;
}
.cg-ecard-aura-2 {
  width: 180px; height: 180px;
  bottom: 0px; right: 30%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.5) 0%, transparent 70%);
  mix-blend-mode: screen;
}

/* Mesh / dot grid pattern */
.cg-ecard-mesh {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1.2px);
  background-size: 16px 16px;
  background-position: 0 0;
  mask-image: linear-gradient(135deg, transparent 0%, #000 35%, #000 100%);
  -webkit-mask-image: linear-gradient(135deg, transparent 0%, #000 35%, #000 100%);
  pointer-events: none;
  z-index: 0;
}

/* Background watermark — large faded Cupon Go logo behind the content */
.cg-ecard-watermark {
  position: absolute;
  right: -40px;
  bottom: -50px;
  width: 360px;
  height: auto;
  opacity: 0.13;
  transform: rotate(-10deg);
  pointer-events: none;
  z-index: 0;
}

/* Glossy diagonal shine */
.cg-ecard-shine {
  position: absolute;
  top: -50%;
  left: -30%;
  width: 60%;
  height: 200%;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255,255,255,0.08) 48%,
    rgba(255,255,255,0.18) 50%,
    rgba(255,255,255,0.08) 52%,
    transparent 65%
  );
  transform: rotate(-8deg);
  pointer-events: none;
  z-index: 0;
}

.cg-ecard > .cg-ecard-head,
.cg-ecard > .cg-ecard-mid,
.cg-ecard > .cg-ecard-foot { position: relative; z-index: 1; }

.cg-ecard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.cg-ecard-logo {
  height: 72px;
  width: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
  -webkit-user-select: none;
  user-select: none;
}

.cg-ecard-poweredby {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
  text-align: right;
}

.cg-ecard-poweredby-label {
  font-size: 8.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
  line-height: 1;
}

.cg-ecard-poweredby-logo {
  height: 24px;
  width: auto;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.4));
}

.cg-ecard-mid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: -4px 0 4px;
}

.cg-ecard-number {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 3.5px;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", "Menlo", monospace;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
}

.cg-ecard-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cg-ecard-meta { text-align: right; }

.cg-ecard-label {
  font-size: 9.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 4px;
  font-weight: 500;
}

.cg-ecard-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.cg-ecard-since {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.cg-ecard-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  padding: 3px 11px 3px 9px;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.45);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.cg-ecard-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow:
    0 0 0 2px rgba(74, 222, 128, 0.25),
    0 0 8px rgba(74, 222, 128, 0.7);
  animation: cgPulse 2s ease-in-out infinite;
}

@keyframes cgPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.25), 0 0 8px rgba(74, 222, 128, 0.7); }
  50%      { box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.15), 0 0 14px rgba(74, 222, 128, 0.9); }
}

/* ===== Stats column next to e-card ===== */

.cg-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  height: 100%;
}

.cg-stat {
  background: var(--ca-surface);
  border: 1px solid var(--ca-border);
  border-radius: var(--ca-radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  transition: border-color 0.15s, transform 0.15s;
}

.cg-stat:hover {
  border-color: var(--ca-cyan);
  transform: translateY(-1px);
}

.cg-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ca-cyan-soft);
  color: var(--ca-navy);
  display: grid;
  place-items: center;
}

.cg-stat-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--ca-text);
  margin-top: 14px;
  line-height: 1.1;
}

.cg-stat-label {
  font-size: 12.5px;
  color: var(--ca-text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ---------- Section heads ---------- */

.cg-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
}

.cg-section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ca-text);
  margin: 0;
}

.cg-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--ca-navy);
  cursor: pointer;
}

.cg-link:hover { color: var(--ca-cyan); }

/* ---------- Filters ---------- */

.cg-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  margin-bottom: 18px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.cg-filter {
  white-space: nowrap;
  background: var(--ca-surface);
  border: 1px solid var(--ca-border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ca-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.cg-filter:hover { border-color: var(--ca-text-soft); color: var(--ca-text); }

.cg-filter.active {
  background: var(--ca-navy);
  color: #fff;
  border-color: var(--ca-navy);
}

/* ---------- Coupon grid ---------- */

.cg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.cg-card {
  background: var(--ca-surface);
  border-radius: var(--ca-radius);
  border: 1px solid var(--ca-border);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
}

.cg-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ca-shadow-md);
  border-color: transparent;
}

.cg-thumb {
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: var(--ca-bg);
}

.cg-thumb svg,
.cg-thumb img.cg-logo {
  max-width: 60%;
  max-height: 65%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.cg-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ca-text);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.cg-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: none;
  display: grid;
  place-items: center;
  color: var(--ca-text-muted);
  transition: color 0.12s, transform 0.12s;
}

.cg-fav:hover { color: var(--ca-cyan); transform: scale(1.06); }
.cg-fav.active { color: #ef4444; }

.cg-card-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.cg-card-cat {
  font-size: 11px;
  font-weight: 600;
  color: var(--ca-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.cg-card-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ca-text);
  letter-spacing: -0.2px;
}

.cg-card-benefit {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ca-navy);
  margin-top: 4px;
  line-height: 1.35;
}

.cg-card-footer {
  margin-top: auto;
  padding-top: 10px;
  font-size: 11.5px;
  color: var(--ca-text-soft);
  font-weight: 500;
}

/* "Cargar más" footer below the grid */
.cg-more {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 0 8px;
  font-size: 13px;
  color: var(--ca-text-muted);
}

.cg-more-btn {
  background: var(--ca-navy);
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.cg-more-btn:hover { background: var(--ca-navy-deep); }
.cg-more-btn:active { transform: translateY(1px); }

/* ---------- Detail modal ---------- */

.cg-modal {
  position: fixed;
  inset: 0;
  background: rgba(14, 26, 82, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  backdrop-filter: blur(4px);
}

.cg-modal.open { display: flex; }

.cg-modal-card {
  background: var(--ca-surface);
  border-radius: var(--ca-radius-lg);
  width: min(540px, 100%);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--ca-shadow-lg);
}

.cg-modal-thumb {
  aspect-ratio: 21/9;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--ca-bg);
}

.cg-modal-thumb svg,
.cg-modal-thumb img.cg-logo {
  max-width: 220px;
  max-height: 130px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.cg-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ca-surface);
  border: 1px solid var(--ca-border);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ca-text);
}

.cg-modal-body {
  padding: 22px 26px 26px;
  overflow-y: auto;
}

.cg-modal-cat {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--ca-text-soft);
  margin: 0 0 6px;
}

.cg-modal-name {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.4px;
}

.cg-modal-benefit {
  background: var(--ca-cyan-soft);
  color: var(--ca-navy);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}

.cg-modal-detail {
  font-size: 14px;
  color: var(--ca-text);
  line-height: 1.6;
  margin: 0 0 16px;
}

.cg-modal-meta {
  display: flex;
  gap: 16px;
  font-size: 12.5px;
  color: var(--ca-text-muted);
  padding-top: 14px;
  border-top: 1px solid var(--ca-border);
  flex-wrap: wrap;
}

.cg-modal-meta b { color: var(--ca-text); font-weight: 600; }

.cg-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.cg-btn {
  flex: 1;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.05s, background 0.15s;
}

.cg-btn:active { transform: translateY(1px); }

.cg-btn-primary { background: var(--ca-navy); color: #fff; }
.cg-btn-primary:hover { background: var(--ca-navy-deep); }

.cg-btn-secondary { background: var(--ca-bg); color: var(--ca-text); }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .cg-hero-grid { grid-template-columns: 1fr; }
  .cg-stat-grid { grid-template-rows: auto; }
}

@media (max-width: 900px) {
  .cg-app { grid-template-columns: 1fr; }
  .cg-sidebar {
    flex-direction: row;
    height: auto;
    padding: 12px 16px;
    align-items: center;
    overflow-x: auto;
    gap: 6px;
  }
  .cg-brand { padding: 0 12px 0 0; flex-shrink: 0; }
  .cg-brand-logo { width: 110px; }
  .cg-nav { flex-direction: row; padding: 0; gap: 4px; flex: 0; }
  .cg-nav-item { padding: 8px 12px; flex-shrink: 0; }
  .cg-nav-item span:not(.cg-nav-icon) { display: none; }
  .cg-nav-divider, .cg-sidebar-footer { display: none; }
  .cg-content { padding: 20px; }
  .cg-topbar { padding: 12px 20px; gap: 12px; }
  .cg-stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .cg-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .cg-stat-grid { grid-template-columns: 1fr; }
  .cg-user span { display: none; }
}
