/* ==========================================================================
   CoolBet Chile — Stylesheet
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #e6e8ee;
  background-color: #0f1320;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: #d7a42a;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #f0bc40;
}

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

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

h1,
h2,
h3 {
  margin: 0 0 0.6em;
  line-height: 1.25;
  color: #ffffff;
}

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

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

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1.75rem;
  color: #f0bc40;
}

p {
  margin: 0 0 1rem;
}

main p {
  color: #c5cad6;
}

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

/* Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  color: #fff;
}

/* Header buttons */
.btn--register {
  background: linear-gradient(135deg, #6a5cff 0%, #4b35a1 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(106, 92, 255, 0.35);
}

.btn--login {
  background: linear-gradient(135deg, #2bd17e 0%, #1ba968 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(43, 209, 126, 0.3);
}

/* Banner CTA — orange/red gradient */
.btn--cta {
  background: linear-gradient(90deg, #d7a42a 0%, #ac3a31 100%);
  color: #fff;
  font-size: 1.05rem;
  padding: 0.85rem 2rem;
  border-radius: 999px;
}

/* Inline CTA in article — purple */
.btn--inline {
  background: linear-gradient(135deg, #6a5cff 0%, #4b35a1 100%);
  color: #fff;
  font-size: 1.05rem;
  padding: 0.85rem 2.25rem;
  border-radius: 999px;
}

/* Header
   -------------------------------------------------------------------------- */
.site-header {
  background-color: #0a0e18;
  border-bottom: 1px solid #1d2331;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  gap: 1rem;
}

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

.primary-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.primary-nav__list {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.primary-nav__list a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #c5cad6;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.primary-nav__list a img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.primary-nav__list a:hover,
.primary-nav__list a[aria-current="page"] {
  color: #fff;
  background-color: #1d2331;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

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

.header-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #c5cad6;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.header-lang:hover,
.header-lang[aria-expanded="true"] {
  background-color: #1d2331;
  border-color: #2c3447;
  color: #fff;
}

.header-lang img {
  width: 22px;
  height: 16px;
  border-radius: 2px;
  object-fit: cover;
}

.header-lang::after {
  content: "▾";
  font-size: 0.7rem;
  opacity: 0.6;
}

.header-lang__list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background-color: #0a0e18;
  border: 1px solid #2c3447;
  border-radius: 8px;
  padding: 0.4rem;
  margin: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: none;
  z-index: 110;
}

/* Open on hover (desktop) */
.header-lang-wrap:hover .header-lang__list,
.header-lang-wrap:focus-within .header-lang__list,
.header-lang-wrap.is-open .header-lang__list {
  display: block;
}

.header-lang__list li {
  list-style: none;
}

.header-lang__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 5px;
  color: #c5cad6;
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.header-lang__list a:hover {
  background-color: #1d2331;
  color: #fff;
}

.header-lang__list a[aria-current="page"] {
  background-color: #1d2331;
  color: #d7a42a;
}

.header-lang__list img {
  width: 22px;
  height: 16px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-radius: 4px;
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  background-color: #e6e8ee;
  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);
}

/* Hero / Welcome
   -------------------------------------------------------------------------- */
.welcome {
  padding: 2.5rem 0 1rem;
  text-align: center;
}

.welcome p {
  font-size: 1.05rem;
  max-width: 75ch;
  margin: 0 auto;
}

/* Promo Banner
   -------------------------------------------------------------------------- */
.promo-banner {
  position: relative;
  background-color: #4b35a1;
  background-image: linear-gradient(135deg, #4b35a1 0%, #2d1f6b 100%);
  border-radius: 14px;
  overflow: hidden;
  padding: 2rem;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 200px;
}

.promo-banner__image {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 3%;
  height: 110%;
  width: auto;
  object-fit: cover;
  pointer-events: none;
}

.promo-banner__content {
  position: relative;
  z-index: 2;
  margin-left: auto;
  max-width: 55%;
  text-align: right;
}

.promo-banner__label {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.promo-banner__value {
  font-size: clamp(1.1rem, 2.4vw, 1.7rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 1.25rem;
}

/* Quick Categories
   -------------------------------------------------------------------------- */
.quick-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.quick-categories__item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.25rem;
  background-color: transparent;
  border: 1px solid #2c3447;
  border-radius: 999px;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
  color: #e6e8ee;
}

.quick-categories__item:hover {
  transform: translateY(-2px);
  border-color: #d7a42a;
  color: #fff;
}

.quick-categories__item img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: #1d2331;
  border-radius: 50%;
  padding: 4px;
}

.quick-categories__item span {
  color: inherit;
  font-weight: 500;
}

/* Game Grid
   -------------------------------------------------------------------------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2.5rem;
}

.game-grid a {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background-color: #1d2331;
  transition: transform 0.2s ease;
}

.game-grid a:hover {
  transform: translateY(-3px);
}

.game-grid img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Sports Grid
   -------------------------------------------------------------------------- */
.sports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 2.5rem;
}

.sports-grid li {
  background-color: #1d2331;
  border: 1px solid #2c3447;
  border-radius: 14px;
  padding: 1rem 0.5rem;
  text-align: center;
  transition: border-color 0.2s ease;
}

.sports-grid li:hover {
  border-color: #d7a42a;
}

.sports-grid img {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.sports-grid span {
  display: block;
  color: #c5cad6;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Article body
   -------------------------------------------------------------------------- */
.article {
  padding: 1rem 0 3rem;
}

.article ul:not(.toc__list):not(.faq__list) {
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
  list-style: disc;
  color: #c5cad6;
}

.article ul:not(.toc__list):not(.faq__list) li {
  margin-bottom: 0.5rem;
  list-style: disc;
}

.article ul:not(.toc__list):not(.faq__list) li::marker {
  color: #d7a42a;
}

/* Hero image card
   -------------------------------------------------------------------------- */
.hero-image {
  margin: 2rem 0;
  border-radius: 14px;
  overflow: hidden;
  background: #0a0e18;
}

.hero-image img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  display: block;
}

/* Section with side image
   -------------------------------------------------------------------------- */
.section-with-image {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin: 2rem 0;
}

@media (max-width: 768px) {
  .section-with-image {
    grid-template-columns: 1fr;
  }
}

.section-image {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
}

.section-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Table of Contents — horizontal pills
   -------------------------------------------------------------------------- */
.toc {
  margin: 1.5rem 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #2c3447;
}

.toc__title {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 0.75rem;
  color: #8a92a5;
}

.toc__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
}

.toc__list li {
  list-style: none;
}

.toc__list a {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  color: #c5cad6;
  background-color: transparent;
  border: 1px solid #2c3447;
  border-radius: 999px;
  transition: all 0.15s ease;
}

.toc__list a:hover {
  color: #fff;
  border-color: #d7a42a;
  background-color: #1d2331;
}

/* Comparison Tables
   -------------------------------------------------------------------------- */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2.5rem;
  background-color: #1a1f2e;
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.95rem;
}

.comparison-table th,
.comparison-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid #2c3447;
  vertical-align: top;
}

.comparison-table th {
  background-color: #252b3d;
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.comparison-table tbody tr:hover {
  background-color: #232a3b;
}

@media (max-width: 600px) {
  .comparison-table {
    font-size: 0.85rem;
  }
  .comparison-table th,
  .comparison-table td {
    padding: 0.65rem 0.6rem;
  }
}

/* CTA Block
   -------------------------------------------------------------------------- */
.cta-block {
  text-align: center;
  margin: 2.5rem 0;
}

/* FAQ — 2-column grid
   -------------------------------------------------------------------------- */
.faq {
  margin: 1.5rem 0 2rem;
}

.faq__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.faq__item {
  background-color: #1a1f2e;
  border: 1px solid #2c3447;
  border-radius: 10px;
  overflow: hidden;
}

.faq__question {
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
  list-style: none;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question::after {
  content: "▼";
  font-size: 0.7rem;
  color: #d7a42a;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq__item[open] .faq__question::after {
  transform: rotate(180deg);
}

.faq__answer {
  padding: 0 1.25rem 1rem;
  color: #c5cad6;
  font-size: 0.9rem;
}

.faq__answer p {
  margin: 0;
}

/* Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: #0a0e18;
  border-top: 1px solid #1d2331;
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}

.footer-brand img {
  height: 36px;
  margin-bottom: 1rem;
}

.footer-brand__text {
  color: #8a92a5;
  font-size: 0.85rem;
  max-width: 22ch;
  margin: 0 0 1rem;
}

.footer-social {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0;
  margin: 0;
}

.footer-social li {
  list-style: none;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #1d2331;
  color: #c5cad6;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.footer-social a:hover {
  background-color: #d7a42a;
  color: #0a0e18;
}

.footer-heading {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 1rem;
}

.footer-nav__label {
  color: #8a92a5;
  font-size: 0.85rem;
  margin: 0 0 0.25rem;
}

.footer-nav a {
  display: block;
  padding: 0.25rem 0;
  color: #c5cad6;
  font-size: 0.9rem;
}

.footer-nav a:hover {
  color: #d7a42a;
}

.footer-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
  border-top: 1px solid #1d2331;
  border-bottom: 1px solid #1d2331;
}

.footer-logos img {
  height: 28px;
  width: auto;
  opacity: 0.7;
  filter: grayscale(40%);
  transition:
    opacity 0.2s ease,
    filter 0.2s ease;
}

.footer-logos img:hover {
  opacity: 1;
  filter: grayscale(0%);
}

.footer-payments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
}

.footer-payments img {
  height: 22px;
  width: auto;
  opacity: 0.85;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid #1d2331;
}

.copyright {
  font-size: 0.85rem;
  color: #6c7488;
  margin: 0;
}

.footer-partners {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.footer-partners img {
  height: 28px;
  width: auto;
  opacity: 0.85;
}

/* Scroll-to-top
   -------------------------------------------------------------------------- */
.scroll-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #1a1f2e;
  border: 1px solid #2c3447;
  color: #d7a42a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top:hover {
  transform: translateY(-2px);
  border-color: #d7a42a;
}

/* Mobile Nav
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .menu-toggle {
    display: flex;
  }

  .primary-nav {
    position: fixed;
    inset: 64px 0 0 0;
    background-color: #0a0e18;
    padding: 1.5rem 1rem;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    flex: none;
    justify-content: flex-start;
  }

  .primary-nav.is-open {
    transform: translateX(0);
  }

  .primary-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .primary-nav__list a {
    display: flex;
    padding: 0.85rem 1rem;
    font-size: 1.05rem;
    border-bottom: 1px solid #1d2331;
    border-radius: 0;
  }

  .header-actions .btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
  }

  .header-lang-wrap {
    display: none;
  }
}

@media (max-width: 540px) {
  .promo-banner {
    flex-direction: column;
    padding: 1.5rem;
    text-align: center;
  }

  .promo-banner__image {
    display: none;
  }

  .promo-banner__content {
    margin: 0 auto;
    max-width: 100%;
    text-align: center;
  }

  .header-actions .btn--login {
    display: none;
  }
}

/* Error page
   -------------------------------------------------------------------------- */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page__code {
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 800;
  line-height: 1;
  margin: 0;
  background: linear-gradient(90deg, #d7a42a 0%, #ac3a31 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-page__title {
  margin: 0.5rem 0 1rem;
}

.error-page__text {
  max-width: 50ch;
  margin: 0 auto 2rem;
  color: #c5cad6;
}


/* =============================================================================
   MOBILE FIXES — burger right-aligned, flag dropdown on mobile,
   close cue (X), uniform CTA size
   ========================================================================= */
@media (max-width: 900px) {
  /* Burger — keep on the right and above the slide-in nav so it can be tapped to close. */
  .menu-toggle {
    order: 100;
    position: relative;
    z-index: 1101;
  }
  /* Hamburger animates to an X when open — clear visual close cue. */
  .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);
  }
  /* Slide-in nav drawer below burger so the burger stays tappable. */
  .primary-nav {
    z-index: 1100;
  }
  /* Show language dropdown on mobile, anchored to the right of viewport. */
  .header-lang-wrap {
    display: block !important;
    margin-left: 0;
    order: 99;
    position: relative;
    z-index: 1102;
  }
  .header-lang {
    padding: 6px 8px;
  }
  .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) {
  /* Login button kept hidden on very narrow screens to avoid wrap */
  .header-actions .btn--login {
    display: none;
  }
}

/* Push the header actions (which include lang + burger) to the right edge */
@media (max-width: 900px) {
  .header-actions {
    margin-left: auto;
  }
}
