/* ============================================================
   TOPJUEGOS HD — ES Theme (topjuegoshd)
   Light portal: white background, black text, red accent #F40235
   Font: Open Sans (injected via layout.tsx CSS variable)
   ============================================================ */

@font-face {
  font-family: "OpenSans-Legacy-Regular";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/open-sans-v17-regular.woff2") format("woff2");
}

@font-face {
  font-family: "OpenSans-Legacy-Bold";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/open-sans-v17-bold.woff2") format("woff2");
}

.theme-topjuegoshd {
  /* ── Brand palette ──────────────────────────────────────── */
  --primary: #F40235;
  --primary-400: #F40235;
  --primary-300: #ff3361;
  --primary-500: #d10028;
  --primary-600: #b00020;
  --primary-foreground: #ffffff;
  --secondary-600: #b00020;

  /* ── Surface / background ────────────────────────────────── */
  --background: #ffffff;
  --foreground: #000000;

  /* ── Cards / popovers ───────────────────────────────────── */
  --card: #f5f5f5;
  --card-foreground: #000000;
  --popover: #ffffff;
  --popover-foreground: #000000;

  /* ── Muted / secondary surfaces ─────────────────────────── */
  --muted: #e5e5e5;
  --muted-foreground: #555555;
  --secondary: #eeeeee;
  --secondary-foreground: #111111;
  --accent: #f0f0f0;
  --accent-foreground: #000000;

  /* ── Borders / inputs ────────────────────────────────────── */
  --border: #dddddd;
  --input: #dddddd;
  --ring: #F40235;

  /* ── Status ─────────────────────────────────────────────── */
  --destructive: #b00020;
  --color-success: #22c55e;
  --color-error: #dc2626;
  --color-error-text: #b00020;
  --color-link: var(--primary);

  /* ── Semantic color tokens ───────────────────────────────── */
  /* Override Tailwind's generated aliases so portal components never fall
     back to next_template orange. */
  --color-primary: var(--primary);
  --color-primary-dark: var(--primary-500);
  --color-focus-outline: var(--ring);
  --color-bg-base: #ffffff;
  --color-bg-card: #f5f5f5;
  --color-text-base: #000000;
  --color-text-muted: #666666;
  --color-text-inverse: #ffffff;
  --color-border: #dddddd;
  --color-input-bg: #f4f2ef;
  --color-input-border: #cccccc;
  /* webs-sdk ContactForm consumes legacy semantic aliases. */
  --color-brand-accent-500: var(--primary);
  --color-text-primary: var(--foreground);
  --color-text-secondary: var(--muted-foreground);
  --color-border-divider: var(--border);
  --neutral-100: var(--color-input-bg);

  /* ── Header / nav ────────────────────────────────────────── */
  --header-bg: #ffffff;
  --header-shadow: none;
  --header-text: #242424;
  --header-text-hover: #FA123F;
  --header-control-hover-bg: #f3f3f3;
  --header-control-hover-text: #FA123F;

  /* ── Footer ──────────────────────────────────────────────── */
  --footer-bg: #ffffff;
  --footer-border: #dddddd;
  --footer-text: #000000;
  --customer-care-image-border: #F40235;
  --customer-care-phone-bg: #ffffff;
  --customer-care-phone-text: #5a7408;
  --home-overlay-text: #ffffff;
  --home-kids-title: #373c8a;
  --login-content-top-space: 60px;

  /* ── Gradient ───────────────────────────────────────────── */
  --gradient-primary-secondary: linear-gradient(112deg, #F40235 0%, #b00020 100%);

  /* ── Misc neutrals ───────────────────────────────────────── */
  --neutral-800: #888888;
  --neutral-900: #dddddd;
  --neutral-950: #eeeeee;
  --neutral-1000: #f5f5f5;

  /* ── Dropdowns ───────────────────────────────────────────── */
  --color-dropdown-bg: #ffffff;
  --color-dropdown-border: #dddddd;
  --color-dropdown-hover: #f5f5f5;
  --color-dropdown-text: #000000;
  --color-dropdown-text-selected: #F40235;

  /* ── Cookie Consent colors ───────────────────────────────── */
  --cookie-banner-bg: #ffffff;
  --cookie-banner-text: #000000;
  --cookie-banner-accent: #F40235;
  --cookie-banner-link: #a0001d;

  /* ── Font ────────────────────────────────────────────────── */
  --font-portal: var(--font-open-sans), 'Open Sans', Arial, sans-serif;
  --font-family-display: var(--font-portal);
}

/* Apply theme to body */
body.theme-topjuegoshd {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-portal);
}

.theme-topjuegoshd .btn-base,
.theme-topjuegoshd .btn,
.theme-topjuegoshd .btn-sm,
.theme-topjuegoshd .btn-lg {
  font-family: var(--font-portal);
}

body.theme-topjuegoshd .portal-header ~ main {
  padding-top: 86px;
}

body.theme-topjuegoshd .portal-header ~ main:has([data-page="home"]) {
  padding-top: 0;
}

.theme-topjuegoshd .portal-header {
  position: fixed;
  inset: 0 0 auto;
  min-height: 86px;
  border-top: 7px solid #1e2020;
  color: var(--header-text);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(3px) grayscale(1) brightness(1.1);
  backdrop-filter: blur(3px) grayscale(1) brightness(1.1);
}

@media (min-width: 992px) {
  body.theme-topjuegoshd .portal-header ~ main {
    padding-top: 86px;
  }

  body.theme-topjuegoshd .portal-header ~ main:has([data-page="home"]) {
    padding-top: 0;
  }

  .theme-topjuegoshd .portal-header {
    min-height: 86px;
    border-top-color: #111111;
    color: var(--header-text);
    background: var(--header-bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .theme-topjuegoshd .portal-header .page-container {
    max-width: none;
    padding: 0 59px;
  }

  .theme-topjuegoshd .portal-header .page-container > div {
    display: grid;
    min-height: 79px;
    grid-template-columns: 201px minmax(0, 1fr) 112px;
    gap: 20px;
  }

  .theme-topjuegoshd .portal-header .page-container > div > div:first-child {
    min-width: 0;
  }

  .theme-topjuegoshd .portal-header nav {
    width: 100%;
    max-width: none;
    padding-right: 12px;
    align-self: stretch;
  }

  .theme-topjuegoshd .portal-header nav > div,
  .theme-topjuegoshd .portal-header nav ul {
    width: 100%;
    min-height: 79px;
  }

  .theme-topjuegoshd .portal-header nav ul {
    transform: none;
    align-content: center;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
  }

  .theme-topjuegoshd .portal-header nav ul > li {
    display: flex;
    height: 32px;
    align-items: center;
    padding-block: 0;
  }

  .theme-topjuegoshd .portal-header .page-container > div > div:last-child {
    width: 112px;
    transform: none;
    align-self: center;
    justify-content: flex-end;
  }

  .theme-topjuegoshd .portal-header-logo {
    width: 201px;
    height: 54px;
  }

  .theme-topjuegoshd .portal-header [data-nav-key] {
    display: flex;
    width: auto;
    height: 32px;
    align-items: center;
    padding: 0 8.75px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--header-text);
    gap: 4px;
    font-family: "OpenSans-Legacy-Regular", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 19px;
    white-space: nowrap;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .theme-topjuegoshd .portal-header [data-nav-key]:hover {
    background: transparent;
    color: #FA123F;
  }

  .theme-topjuegoshd .portal-header [data-nav-key][aria-current="page"] {
    color: var(--primary);
    box-shadow: none;
  }

  .theme-topjuegoshd .portal-header [data-portal-auth-button] {
    width: auto;
    height: 32px;
    padding: 0;
    color: var(--header-text);
    font-family: "OpenSans-Legacy-Bold", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 19px;
    text-decoration: none;
    white-space: nowrap;
  }

  .theme-topjuegoshd .portal-header [data-portal-auth-button]:hover {
    background: transparent;
    color: #FA123F;
    text-decoration: none;
  }

  .theme-topjuegoshd .portal-header [data-nav-key] svg {
    stroke-width: 2;
  }

  .theme-topjuegoshd .portal-header [role="menu"] {
    top: calc(100% + 24px);
    left: 0;
    width: max-content;
    min-width: 200px;
    margin-top: 0;
    padding-block: 6px;
    border: 1px solid var(--border);
    border-radius: 0;
    background: #ffffff;
    box-shadow: 0 10px 24px rgb(0 0 0 / 12%);
    color: var(--header-text);
  }

  .theme-topjuegoshd .portal-header [role="menu"] [data-nav-key] {
    display: flex;
    min-height: 40px;
    align-items: center;
    padding: 10px 14px;
    color: var(--header-text);
    font-family: var(--font-portal);
    font-size: 14px;
    line-height: 20px;
    white-space: nowrap;
  }

  .theme-topjuegoshd .portal-header [role="menu"] [data-nav-key]:hover {
    background: var(--accent);
    color: #FA123F;
  }
}

@media (min-width: 992px) and (max-width: 1279px) {
  .theme-topjuegoshd .portal-header .page-container {
    padding-inline: 12px;
  }

  .theme-topjuegoshd .portal-header .page-container > div {
    grid-template-columns: 184px minmax(0, 1fr) 76px;
    gap: 4px;
  }

  .theme-topjuegoshd .portal-header-logo {
    width: 176px;
    height: 46px;
  }

  .theme-topjuegoshd .portal-header nav ul,
  .theme-topjuegoshd .portal-header .page-container > div > div:last-child {
    transform: none;
  }

  .theme-topjuegoshd .portal-header .page-container > div > div:last-child {
    width: 76px;
  }

  .theme-topjuegoshd .portal-header [data-nav-key] {
    padding-inline: 6px;
    font-size: 12px;
  }

  .theme-topjuegoshd .portal-header [data-portal-auth-button] {
    font-size: 12px;
  }
}

@media (max-width: 991px) {
  .theme-topjuegoshd .portal-header {
    background: #ffffff;
    color: var(--header-text);
  }

  .theme-topjuegoshd .portal-header .page-container {
    padding-block: 6px;
  }

  .theme-topjuegoshd .portal-header [data-mobile-menu-trigger] {
    color: var(--header-text);
  }

  .theme-topjuegoshd .portal-header-logo {
    height: 46px;
  }

  .theme-topjuegoshd .portal-header #mobile-nav {
    border-color: #dddddd;
    background: #ffffff;
    color: #242424;
  }
}

body.theme-topjuegoshd [data-page="home"] > .page-container {
  max-width: 1342px;
  padding-top: 0;
}

.theme-topjuegoshd .portal-section-title {
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--primary);
  color: var(--primary);
  font-size: 32px;
  line-height: 40px;
  text-transform: capitalize;
}

.theme-topjuegoshd .portal-content-detail {
  padding-top: 30px;
}

.theme-topjuegoshd .portal-content-detail > a {
  min-height: 42px;
  margin-bottom: 12px;
  padding-inline: 18px;
  border-radius: 100px;
  color: var(--primary);
  font-family: "OpenSans-Legacy-Bold", sans-serif;
  font-size: 16px;
  font-weight: 400;
}

.theme-topjuegoshd .portal-content-primary-media {
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
}

.theme-topjuegoshd .portal-content-detail-header h1 {
  color: var(--home-kids-title);
  font-family: "OpenSans-Legacy-Bold", sans-serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 42.12px;
}

.theme-topjuegoshd .portal-content-genre,
.theme-topjuegoshd .portal-content-facts {
  display: none;
}

.theme-topjuegoshd .portal-video-detail-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.theme-topjuegoshd .portal-video-player {
  border-radius: 0;
  box-shadow: none;
}

.theme-topjuegoshd .portal-video-player [data-slot="media-player"] {
  --foreground: #ffffff;
  --background: #000000;
  --secondary: #5f5f5f;
  --muted: #5f5f5f;
  --accent: #333333;
  --ring: #ffffff;
  border-radius: 0;
  color: #ffffff;
}

.theme-topjuegoshd .portal-video-player [data-slot="media-player-controls"] {
  color: #ffffff;
  background: linear-gradient(to top, rgb(0 0 0 / 88%), transparent);
}

.theme-topjuegoshd .portal-video-player [data-slot="media-player-controls"] button,
.theme-topjuegoshd .portal-video-player [data-slot="media-player-controls"] [class*="text-foreground"] {
  color: #ffffff;
}

.theme-topjuegoshd .portal-video-player [data-slot="media-player-play-button"] {
  order: 0;
}

.theme-topjuegoshd .portal-video-player [data-slot="media-player-seek-backward"] {
  order: 1;
}

.theme-topjuegoshd .portal-video-player [data-slot="media-player-seek-forward"] {
  order: 2;
}

.theme-topjuegoshd .portal-video-player [data-slot="media-player-seek-container"] {
  order: 3;
}

.theme-topjuegoshd .portal-video-player [data-slot="media-player-time"] {
  order: 4;
}

.theme-topjuegoshd .portal-video-player [data-slot="media-player-volume-container"] {
  order: 5;
}

.theme-topjuegoshd .portal-video-player [data-slot="media-player-settings"] {
  order: 6;
}

.theme-topjuegoshd .portal-video-player [data-slot="media-player-fullscreen"] {
  order: 7;
}

body.theme-topjuegoshd [data-slot="dropdown-menu-content"][data-side="top"],
body.theme-topjuegoshd [data-slot="dropdown-menu-sub-content"] {
  z-index: 100;
  min-width: 180px;
  padding: 6px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 8px;
  background: rgb(10 10 10 / 96%);
  box-shadow: 0 10px 32px rgb(0 0 0 / 55%);
  color: #ffffff;
  backdrop-filter: blur(8px);
}

body.theme-topjuegoshd [data-slot="dropdown-menu-content"][data-side="top"] {
  width: 224px;
}

body.theme-topjuegoshd
  :is(
    [data-slot="dropdown-menu-content"][data-side="top"],
    [data-slot="dropdown-menu-sub-content"]
  )
  :is([data-slot="dropdown-menu-item"], [data-slot="dropdown-menu-sub-trigger"]) {
  position: relative;
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #ffffff;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
  cursor: default;
  outline: none;
}

body.theme-topjuegoshd
  :is(
    [data-slot="dropdown-menu-content"][data-side="top"],
    [data-slot="dropdown-menu-sub-content"]
  )
  :is(
    [data-slot="dropdown-menu-item"][data-highlighted],
    [data-slot="dropdown-menu-sub-trigger"][data-highlighted],
    [data-slot="dropdown-menu-sub-trigger"][data-state="open"]
  ) {
  background: rgb(255 255 255 / 12%);
}

body.theme-topjuegoshd
  :is(
    [data-slot="dropdown-menu-content"][data-side="top"],
    [data-slot="dropdown-menu-sub-content"]
  )
  [data-slot="dropdown-menu-item"][data-disabled] {
  color: rgb(255 255 255 / 52%);
}

body.theme-topjuegoshd
  :is(
    [data-slot="dropdown-menu-content"][data-side="top"],
    [data-slot="dropdown-menu-sub-content"]
  )
  :is([data-slot="dropdown-menu-item"], [data-slot="dropdown-menu-sub-trigger"])
  > svg {
  width: 16px;
  height: 16px;
  flex: none;
}

body.theme-topjuegoshd
  [data-slot="dropdown-menu-content"][data-side="top"]
  [data-slot="dropdown-menu-sub-trigger"]
  > [data-slot="badge"] {
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 4px;
  color: rgb(255 255 255 / 76%);
  font-size: 12px;
  line-height: 18px;
}

.theme-topjuegoshd .portal-video-title-overlay {
  color: #ffffff;
  font-family: "OpenSans-Legacy-Bold", sans-serif;
  font-weight: 400;
  text-shadow: 0 1px 3px rgb(0 0 0 / 70%);
}

.theme-topjuegoshd .portal-video-detail-header {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding: 18px 24px 0;
  text-align: center;
}

.theme-topjuegoshd .portal-video-detail-header h1 {
  margin: 0;
  color: var(--primary);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.35;
}

.theme-topjuegoshd .portal-video-detail-header-long h1 {
  font-size: clamp(30px, 3vw, 36px);
}

.theme-topjuegoshd .portal-content-description {
  padding-inline: 24px;
}

.theme-topjuegoshd .portal-content-description p {
  color: #000000;
  font-size: 18px;
  line-height: 1.35;
}

.theme-topjuegoshd .portal-content-share {
  margin: 36px auto 18px;
}

.theme-topjuegoshd .portal-content-share-button {
  color: #111111;
  transition: opacity 150ms ease;
}

.theme-topjuegoshd .portal-content-share-button:first-child {
  color: #4267b2;
}

.theme-topjuegoshd .portal-content-share-button:hover {
  opacity: 0.78;
}

.theme-topjuegoshd .portal-content-gallery {
  margin-top: 48px;
}

.theme-topjuegoshd .portal-content-action {
  min-height: 54px;
  border-radius: 30px;
  background-color: #fe5e80;
  color: #111111;
  font-family: "OpenSans-Legacy-Bold", sans-serif;
  font-weight: 400;
}

@media (max-width: 991px) {
  .theme-topjuegoshd .portal-content-detail-header h1 {
    font-size: 18px;
    line-height: 21.06px;
  }

  .theme-topjuegoshd .portal-video-detail-header {
    padding: 16px 12px 0;
  }

  .theme-topjuegoshd .portal-video-detail-header h1 {
    font-size: 28px;
    line-height: 1.25;
  }

  .theme-topjuegoshd .portal-video-detail-header-long h1 {
    font-size: 24px;
    line-height: 1.3;
  }

  .theme-topjuegoshd .portal-video-title-overlay {
    top: 12px;
    left: 16px;
    max-width: calc(100% - 32px);
    font-size: 18px;
  }

  .theme-topjuegoshd .portal-content-description {
    padding-inline: 12px;
  }

  .theme-topjuegoshd .portal-content-description p {
    font-size: 16px;
    line-height: 1.45;
  }

  .theme-topjuegoshd .portal-content-share {
    margin-top: 28px;
  }

  .theme-topjuegoshd .portal-content-gallery {
    margin-top: 24px;
  }
}

.theme-topjuegoshd .login-content [data-slot="card-header"] {
  border-bottom: 2px solid var(--primary);
}

.theme-topjuegoshd .login-panel,
.theme-topjuegoshd .login-panel input {
  font-family: "OpenSans-Legacy-Regular", sans-serif !important;
}

.theme-topjuegoshd .login-content [data-slot="card-title"] h1 {
  color: #2b2b2b;
  font-family: "OpenSans-Legacy-Bold", sans-serif !important;
  font-size: 18px;
  font-weight: 400;
}

body.theme-topjuegoshd .login-content .signup-form > p {
  color: #2b2b2b;
}

body.theme-topjuegoshd
  .login-content
  .signup-form
  [data-slot="input-group-control"] {
  color: #2b2b2b;
}

.theme-topjuegoshd .signup-form button[type="submit"] {
  background: #fe5e80;
  color: var(--primary-foreground) !important;
  font-family: "OpenSans-Legacy-Bold", sans-serif !important;
  font-weight: 400;
  line-height: normal;
}

.theme-topjuegoshd .login-no-account-link-label {
  font-family: "OpenSans-Legacy-Bold", sans-serif !important;
}

.theme-topjuegoshd .signup-form button[type="submit"]:disabled {
  cursor: not-allowed;
  opacity: 1;
}

/* SDK PasswordReset overrides */
.theme-topjuegoshd .pr-page { background-color: var(--background); color: var(--foreground); }
.theme-topjuegoshd .pr-card { background-color: var(--card); border-color: var(--border); }
.theme-topjuegoshd .pr-title { color: var(--foreground); }
.theme-topjuegoshd .pr-subtitle { color: var(--muted-foreground); }
.theme-topjuegoshd .pr-label { color: var(--foreground); }
.theme-topjuegoshd .pr-input { background-color: var(--input); border-color: var(--border); color: var(--foreground); }
.theme-topjuegoshd .pr-input:focus { border-color: var(--primary); }
.theme-topjuegoshd .pr-btn { background-color: var(--primary) !important; color: var(--primary-foreground) !important; }

/* CTABtn (DownloadCTA): mismo aspecto que .portal-content-action (rosa #fe5e80, texto #111, píldora 30px) + modal claro */
.theme-topjuegoshd {
  --tj-cta-primary: #fe5e80;
  --tj-cta-on-primary: #111111;
  --tj-cta-radius: 30px;
  --tj-cta-modal-bg: #ffffff;
  --tj-cta-modal-text: #000000;
  --tj-cta-modal-muted: #555555;
  --tj-cta-modal-border: #dddddd;
  --tj-cta-code-bg: #f5f5f5;
  --tj-cta-overlay: rgba(0, 0, 0, 0.6);
}
.theme-topjuegoshd .tj-cta .webs-cta__btn {
  font-family: "OpenSans-Legacy-Bold", sans-serif;
  font-weight: 400;
}
