/* ===================================================
   Página de Agradecimiento — Styles
   Mobile-first · Cloudflare Pages ready
   =================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- Design Tokens --- */
:root {
  --green-whatsapp: #25D366;
  --green-dark: #1da851;
  --green-hover: #1b9e4b;
  --bg-page: #2a2a2a;
  --bg-card: #ffffff;
  --bg-summary: #f6f7f8;
  --bg-summary-border: #e8e8e8;
  --text-primary: #1a1a1a;
  --text-secondary: #444444;
  --text-muted: #777777;
  --attention-bg: #fff8e1;
  --attention-border: #f5a623;
  --attention-text: #7a5d00;
  --badge-bg: #e8f5e9;
  --badge-text: #2e7d32;
  --badge-icon: #43a047;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.12);
  --shadow-btn: 0 4px 14px rgba(37, 211, 102, 0.35);
  --radius-card: 18px;
  --radius-inner: 12px;
  --radius-btn: 14px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-card: 460px;
  --transition-speed: 0.25s;
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Card Container --- */
.card {
  background: var(--bg-card);
  width: 100%;
  max-width: var(--max-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 28px 22px 32px;
  text-align: center;
  animation: fadeSlideUp 0.5s ease-out both;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Mascot --- */
.mascot {
  width: 130px;
  height: auto;
  margin: 0 auto 12px;
  animation: gentleBounce 2.5s ease-in-out infinite;
}

@keyframes gentleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 50px;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.badge-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- Headings --- */
.title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.25;
}

.subtitle {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* --- Attention Block --- */
.attention {
  background: var(--attention-bg);
  border: 1.5px solid var(--attention-border);
  border-radius: var(--radius-inner);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
}

.attention-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 1px;
}

.attention-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--attention-text);
  line-height: 1.45;
}

.attention-text strong {
  font-weight: 700;
}

/* --- Order Summary --- */
.summary {
  background: var(--bg-summary);
  border: 1px solid var(--bg-summary-border);
  border-radius: var(--radius-inner);
  padding: 18px 16px;
  margin-bottom: 24px;
  text-align: left;
}

.summary-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  font-size: 0.92rem;
}

.summary-row + .summary-row {
  border-top: 1px solid var(--bg-summary-border);
}

.summary-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.summary-value {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  max-width: 58%;
  word-break: break-word;
}

.summary-row--total {
  padding-top: 12px;
  margin-top: 4px;
  border-top: 2px solid var(--text-primary) !important;
}

.summary-row--total .summary-label {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.summary-row--total .summary-value {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--badge-text);
}

/* --- WhatsApp Button --- */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: var(--green-whatsapp);
  color: #ffffff;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-btn);
  transition: background var(--transition-speed) ease,
              transform var(--transition-speed) ease,
              box-shadow var(--transition-speed) ease;
  letter-spacing: 0.01em;
}

.btn-whatsapp:hover {
  background: var(--green-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

.btn-whatsapp:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: currentColor;
}

/* --- Helper Text --- */
.helper-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
  margin-bottom: 0;
}

/* --- Footer --- */
.footer {
  margin-top: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* --- Accessibility: Focus Visible --- */
.btn-whatsapp:focus-visible {
  outline: 3px solid var(--green-dark);
  outline-offset: 3px;
}

a:focus-visible {
  outline: 2px solid var(--green-whatsapp);
  outline-offset: 2px;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
  }

  .mascot {
    animation: none;
  }

  .btn-whatsapp {
    transition: none;
  }
}

/* --- Responsive Fine-Tuning --- */

/* Very small screens (240px+) */
@media (max-width: 320px) {
  body {
    padding: 8px;
  }

  .card {
    padding: 20px 14px 24px;
    border-radius: 14px;
  }

  .mascot {
    width: 100px;
  }

  .title {
    font-size: 1.2rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .attention {
    padding: 10px 12px;
  }

  .attention-text {
    font-size: 0.82rem;
  }

  .summary {
    padding: 14px 12px;
  }

  .summary-row {
    font-size: 0.84rem;
  }

  .btn-whatsapp {
    font-size: 0.95rem;
    padding: 14px 18px;
  }
}

/* Small phones */
@media (min-width: 321px) and (max-width: 460px) {
  .card {
    padding: 24px 18px 28px;
  }
}

/* Desktop — card floats over dark background */
@media (min-width: 461px) {
  body {
    padding: 40px 20px;
  }

  .card {
    padding: 36px 32px 40px;
  }

  .mascot {
    width: 140px;
  }
}
