/* ==========================================================================
   CoolBet Perú — Stylesheet
   Visual identity from the Peru original:
   - Dark navy palette (#090F1d body, #1A2337 cards, #1d2331 menu)
   - Inter font, 50px pill buttons, 30px section radius, 12px image radius
   - Gold/red gradient CTAs (per project decision, unifying with banner)
   ========================================================================== */

/* CSS variables / design tokens
   -------------------------------------------------------------------------- */
:root {
  --bg: #090f1d;
  --surface: #1a2337;
  --surface-2: #1d2331;
  --border: rgba(255, 255, 255, 0.06);
  --text: #ffffff;
  --text-muted: #c5cad6;
  --text-dim: #5c6278;
  --primary: #1079d6;
  --primary-hover: #0d61ab;
  --success: #2db865;
  --accent-gold: #d7a42a;
  --accent-red: #ac3a31;
  --cta-grad: linear-gradient(90deg, #d7a42a 0%, #ac3a31 100%);
  --cta-grad-hover: linear-gradient(90deg, #e7b73d 0%, #c54739 100%);

  --radius-section: 30px;
  --radius-button: 50px;
  --radius-image: 12px;

  --container-max: 1200px;
  --header-h: 70px;
}

/* Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

ul,
ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0 0 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 700;
  text-align: center;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-top: 2.5rem;
}

h3 {
  font-size: 1.2rem;
  margin-top: 1.75rem;
}

p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

strong {
  color: var(--text);
  font-weight: 600;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 10px 28px;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-button);
  transition: all 0.2s ease;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

/* Per project decision: unify all CTAs under the gold/red gradient */
.btn--cta,
.btn--register {
  background: var(--cta-grad);
  color: #fff;
}

.btn--cta:hover,
.btn--register:hover {
  background: var(--cta-grad-hover);
  color: #fff;
  transform: translateY(-1px);
}

.btn--login {
  background: var(--success);
  color: #fff;
}

.btn--login:hover {
  background: #25a157;
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn--ghost:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
}

.site-logo {
  display: block;
  flex-shrink: 0;
}

.site-logo img {
  width: auto;
  max-height: 38px;
}

.primary-nav__list {
  display: flex;
  gap: 4px;
}

.primary-nav a {
  display: block;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  border-radius: var(--radius-button);
  transition: all 0.2s ease;
}

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

.primary-nav a[aria-current="page"] {
  color: var(--accent-gold);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  width: 28px;
  height: 24px;
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 0;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s ease;
}

/* Language dropdown
   -------------------------------------------------------------------------- */
.header-lang-wrap {
  position: relative;
  margin-left: 4px;
}

.header-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  border-radius: var(--radius-button);
  background: transparent;
}

.header-lang img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.header-lang__list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 6px;
  padding: 10px;
  min-width: 110px;
  background-color: var(--surface-2);
  border-radius: 12px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: all 0.2s ease;
  z-index: 10;
}

.header-lang-wrap:hover .header-lang__list,
.header-lang-wrap.is-open .header-lang__list {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.header-lang__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
}

.header-lang__list a:hover,
.header-lang__list a[aria-current="page"] {
  color: var(--accent-gold);
}

.header-lang__list img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

/* Main wrap
   -------------------------------------------------------------------------- */
.main {
  padding-top: calc(var(--header-h) + 1.5rem);
  padding-bottom: 3rem;
}

/* Welcome / hero
   -------------------------------------------------------------------------- */
.welcome {
  text-align: center;
  margin: 1.5rem auto 2rem;
  max-width: 800px;
}

.welcome p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Hero gallery (capped per playbook) */
.hero-gallery {
  max-width: 800px;
  margin: 2rem auto;
}

.hero-gallery img {
  border-radius: var(--radius-image);
  width: 100%;
}

/* Bonus banner
   -------------------------------------------------------------------------- */
.bonus-banner {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 32px;
  margin-bottom: 2rem;
  background-color: #4b35a1; /* preserved from Peru original — banner uses purple bg */
  border-radius: var(--radius-section);
  overflow: hidden;
  min-height: 220px;
}

.bonus-banner__art {
  position: absolute;
  top: 0;
  left: 40px;
  bottom: 0;
  display: flex;
  align-items: center;
  z-index: 1;
}

.bonus-banner__art img {
  height: 100%;
  width: auto;
  max-height: 220px;
  object-fit: contain;
}

.bonus-banner__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 12px;
  max-width: 60%;
}

.bonus-banner__label {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.bonus-banner__value {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  margin: 0;
  color: #fff;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .bonus-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    min-height: auto;
    background-position: top center;
  }
  .bonus-banner__art {
    position: static;
    justify-content: center;
    margin-bottom: 1rem;
  }
  .bonus-banner__art img {
    max-height: 160px;
  }
  .bonus-banner__content {
    align-items: center;
    text-align: center;
    max-width: 100%;
  }
  .bonus-banner__content .btn {
    width: 100%;
  }
}

/* Short menu (4 quick categories)
   -------------------------------------------------------------------------- */
.short-menu {
  margin-bottom: 2rem;
}

.short-menu__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.short-menu__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 65px;
  padding: 0 22px;
  background-color: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-section);
  transition: transform 0.2s ease, background 0.2s ease;
}

.short-menu__list a:hover {
  transform: translateY(-2px);
  background-color: #232a3e;
  color: var(--text);
}

.short-menu__list img {
  max-width: 47px;
  width: auto;
  flex-shrink: 0;
}

.short-menu__list span {
  text-align: right;
}

@media (max-width: 768px) {
  .short-menu__list {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .short-menu__list a {
    padding: 0 14px;
    font-size: 0.85rem;
  }
}

/* Casino tile grid (auto-fit per playbook)
   -------------------------------------------------------------------------- */
.games-grid {
  margin-bottom: 2.5rem;
}

.games-grid h2 {
  margin-bottom: 1rem;
  margin-top: 0;
}

.games-grid__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.games-grid__list a {
  display: block;
}

.games-grid__list img {
  width: 100%;
  border-radius: var(--radius-image);
  transition: transform 0.3s ease;
}

.games-grid__list a:hover img {
  transform: scale(1.05);
}

/* Sports grid (7 per row at 1200px)
   -------------------------------------------------------------------------- */
.sports-grid {
  margin-bottom: 2.5rem;
}

.sports-grid h2 {
  margin-bottom: 1rem;
  margin-top: 0;
}

.sports-grid__list {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

.sports-grid__list a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  height: 140px;
  padding: 0 14px;
  background-color: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: var(--radius-section);
  transition: background 0.2s ease, transform 0.2s ease;
}

.sports-grid__list a:hover {
  background-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.sports-grid__list img {
  max-height: 60px;
  width: auto;
}

.sport-name {
  text-align: center;
  line-height: 1.2;
  font-weight: 500;
}

@media (max-width: 1100px) {
  .sports-grid__list {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .sports-grid__list {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .sports-grid__list a {
    height: 110px;
    font-size: 0.85rem;
  }
  .sports-grid__list img {
    max-height: 45px;
  }
}

/* TOC navigation
   -------------------------------------------------------------------------- */
.toc {
  margin-bottom: 2rem;
}

.toc__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toc__list a {
  display: inline-block;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text);
  background-color: transparent;
  border: 1px solid var(--primary);
  border-radius: var(--radius-button);
  text-decoration: none;
  transition: all 0.2s ease;
}

.toc__list a:hover {
  color: var(--primary);
  background-color: rgba(16, 121, 214, 0.08);
}

/* Article body
   -------------------------------------------------------------------------- */
.article-body {
  max-width: 100%;
  font-size: 1rem;
}

.article-body section {
  margin-bottom: 2.5rem;
  clear: both;
}

.article-body h2 {
  scroll-margin-top: 90px;
}

.article-body p {
  margin-bottom: 1rem;
}

/* Floated images — per playbook: 38% width, max 449px, drop float on mobile */
.article-body img.float-right,
.article-body img.float-left {
  max-width: 449px;
  width: 38%;
  border-radius: var(--radius-image);
  margin: 0 0 1rem 1.5rem;
}

.article-body img.float-right {
  float: right;
  margin: 0 0 1rem 1.5rem;
}

.article-body img.float-left {
  float: left;
  margin: 0 1.5rem 1rem 0;
}

@media (max-width: 991px) {
  .article-body img.float-right,
  .article-body img.float-left {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0 0 1rem;
  }
}

/* Bullet lists with custom marker */
.bullet-list {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.bullet-list li {
  position: relative;
  padding: 6px 0 6px 0;
  color: var(--text-muted);
}

.bullet-list li + li {
  border-top: 1px solid var(--border);
}

/* Comparison table */
.comparison-table {
  margin: 1.25rem 0 1.5rem;
  overflow-x: auto;
}

.comparison-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 8px;
}

.comparison-table th,
.comparison-table td {
  padding: 14px 12px;
  text-align: left;
  background-color: var(--surface);
  color: var(--text);
  border-radius: var(--radius-image);
  vertical-align: top;
}

.comparison-table th {
  font-weight: 700;
  background-color: var(--surface-2);
}

.comparison-table td {
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .comparison-table table {
    font-size: 0.875rem;
  }
  .comparison-table th,
  .comparison-table td {
    padding: 10px 8px;
  }
}

/* FAQ
   -------------------------------------------------------------------------- */
.faq {
  margin-top: 2rem;
}

.faq__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 32px;
}

.faq-item {
  background-color: var(--surface);
  border-radius: var(--radius-image);
  padding: 16px 18px;
  transition: background 0.2s ease;
}

.faq-item summary {
  position: relative;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  padding-right: 30px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "▾";
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  color: var(--accent-gold);
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: translateY(-50%) rotate(180deg);
}

.faq-answer {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .faq__grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 2.5rem 0 2rem;
  background-color: var(--bg);
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

.site-footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.site-footer__brand .footer-logo {
  width: auto;
  max-height: 38px;
  margin-bottom: 1rem;
}

.footer-tagline {
  font-size: 14px;
  font-weight: 300;
  max-width: 260px;
  color: var(--text-dim);
}

.footer-social {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: #fff;
  border-radius: 8px;
  background-color: var(--surface-2);
  transition: all 0.2s ease;
}

.footer-social a:hover {
  color: var(--accent-gold);
  transform: translateY(-2px);
}

.footer-social a svg {
  width: 18px;
  height: 18px;
}

.footer-heading {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  margin: 0 0 1rem;
  color: var(--text);
}

.footer-nav ul li {
  padding: 4px 0;
}

.footer-nav a {
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}

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

.footer-support__label {
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text-dim);
}

.footer-support a {
  font-size: 14px;
  color: var(--text);
}

.footer-support a:hover {
  color: var(--accent-gold);
}

/* Footer image rows — capped sizes per playbook */
.footer-partners,
.footer-payments {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.footer-partners li {
  max-width: 75px;
}

.footer-partners img {
  width: 100%;
  max-height: 50px;
  object-fit: contain;
}

.footer-payments li {
  max-width: 65px;
}

.footer-payments img {
  width: 100%;
  max-height: 19px;
  object-fit: contain;
}

.site-footer__bottom {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding-top: 2rem;
  align-items: center;
}

.copyright {
  font-size: 14px;
  color: var(--text-dim);
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: flex-end;
}

.footer-badges li {
  max-width: 90px;
}

.footer-badges img {
  width: 100%;
  max-height: 28px;
  object-fit: contain;
}

@media (max-width: 991px) {
  .site-footer__top {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    text-align: left;
  }
  .footer-partners,
  .footer-payments {
    justify-content: center;
    gap: 16px;
    padding: 18px 0;
  }
  .footer-partners li {
    max-width: 50px;
  }
  .site-footer__bottom {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-badges {
    justify-content: center;
  }
}

/* Scroll-to-top
   -------------------------------------------------------------------------- */
.scroll-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface);
  color: var(--accent-gold);
  border-radius: 12px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 50;
  border: 1px solid var(--border);
}

.scroll-top.is-visible {
  opacity: 0.85;
  visibility: visible;
}

.scroll-top:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .scroll-top {
    width: 40px;
    height: 40px;
    right: 12px;
    bottom: 12px;
  }
}

/* 404
   -------------------------------------------------------------------------- */
.page-404 {
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.not-found {
  text-align: center;
  padding: 3rem 1rem;
}

.not-found__code {
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 800;
  margin: 0 0 1rem;
  color: var(--accent-gold);
  line-height: 1;
}

.not-found p {
  max-width: 480px;
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
}

.not-found__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Mobile menu
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .menu-toggle {
    display: flex;
    order: 3;
  }
  .header-actions {
    order: 2;
    margin-left: auto;
  }
  .primary-nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 90vw;
    background-color: var(--surface);
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    border-left: 1px solid var(--border);
  }
  .primary-nav.is-open {
    transform: translateX(0);
  }
  .primary-nav__list {
    flex-direction: column;
    gap: 4px;
  }
  .primary-nav a {
    padding: 12px 16px;
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .header-actions .btn {
    padding: 8px 14px;
    font-size: 13px;
  }
  .header-lang span {
    display: none;
  }
  .header-lang {
    padding: 4px;
  }
}


/* =============================================================================
   MOBILE FIXES — burger right-aligned, flag dropdown on mobile,
   close cue (X), uniform CTA size
   ========================================================================= */
@media (max-width: 991px) {
  .menu-toggle {
    order: 100;
    position: relative;
    z-index: 1101;
  }
  .menu-toggle span {
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .primary-nav {
    z-index: 1100;
  }
  /* Show language dropdown on mobile too */
  .header-lang-wrap,
  .header-lang {
    display: inline-flex !important;
  }
  .header-lang-wrap {
    margin-left: 0;
    order: 99;
    position: relative;
    z-index: 1102;
  }
  .header-lang {
    padding: 6px 8px;
    align-items: center;
  }
  .header-lang__list {
    right: 0;
    left: auto;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  /* Equal-sized header CTAs */
  .header-actions .btn--register,
  .header-actions .btn--login {
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
    line-height: 1.2;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 540px) {
  .header-actions .btn--login {
    display: none;
  }
}

/* Push header-actions to right edge so lang sits right next to burger */
@media (max-width: 991px) {
  .header-actions {
    margin-left: auto;
  }
}
