/*
 * Custom CSS for Nexus Cart Orderform
 *
 * This file allows you to customize the theme colors and styles for the Nexus Cart orderform.
 *
 * To customize colors:
 * - Replace the var() references with your own hex colors or other CSS values.
 * - For example, instead of --vl-primary: var(--zinc-900); use --vl-primary: #your-color;
 * - You can also override any CSS properties here.
 *
 * Note: Changes here will apply to the orderform's Shadow DOM.
 */

/* Add you custom styles here */
:host, :root {
    /* Primary colors */
    --vl-primary: var(--primary);
    --vl-primary-lifted: var(--primary-lifted);
    --vl-primary-accented: var(--primary-accented);

    /* Secondary colors */
    --vl-secondary: var(--secondary);
    --vl-secondary-lifted: var(--secondary-lifted);
    --vl-secondary-accented: var(--secondary-accented);

    /* Success colors */
    --vl-success: var(--success);
    --vl-success-lifted: var(--success-lifted);
    --vl-success-accented: var(--success-accented);

    /* Info colors */
    --vl-info: var(--info);
    --vl-info-lifted: var(--info-lifted);
    --vl-info-accented: var(--info-accented);

    /* Notice colors */
    --vl-notice: var(--notice);
    --vl-notice-lifted: var(--notice-lifted);
    --vl-notice-accented: var(--notice-accented);

    /* Warning colors */
    --vl-warning: var(--warning);
    --vl-warning-lifted: var(--warning-lifted);
    --vl-warning-accented: var(--warning-accented);

    /* Error colors */
    --vl-error: var(--error);
    --vl-error-lifted: var(--error-lifted);
    --vl-error-accented: var(--error-accented);

    /* Grayscale colors */
    --vl-grayscale: var(--grayscale);
    --vl-grayscale-lifted: var(--grayscale-lifted);
    --vl-grayscale-accented: var(--grayscale-accented);

    /* Neutral colors */
    --vl-neutral: var(--neutral);
    --vl-neutral-lifted: var(--neutral-lifted);
    --vl-neutral-accented: var(--neutral-accented);

    /* Text neutral colors */
    --vl-text-inverted: var(--text-inverted);
    --vl-text-muted: var(--text-muted);
    --vl-text-lifted: var(--text-lifted);
    --vl-text-accented: var(--text-accented);
    --vl-text: var(--text);

    /* Border neutral colors */
    --vl-border-muted: var(--border-muted);
    --vl-border: var(--border);
    --vl-border-lifted: var(--border-lifted);
    --vl-border-accented: var(--border-accented);

    /* Background neutral colors */
    --vl-bg: var(--bg);
    --vl-bg-muted: var(--bg-muted);
    --vl-bg-lifted: var(--bg-lifted);
    --vl-bg-accented: var(--bg-accented);
    --vl-bg-inverted: var(--bg-inverted);

    /* Additional custom properties */
    /* Font Sizes */
    --vl-text-xs: var(--text-xs);
    --vl-text-sm: var(--text-sm);
    --vl-text-md: var(--text-md);
    --vl-text-lg: var(--text-lg);

    /* Spacing */
    --vl-outline-sm: var(--outline-sm);
    --vl-outline-md: var(--outline-md);
    --vl-outline-lg: var(--outline-lg);

    /* Rounding */
    --vl-rounding-sm: var(--rounding-sm);
    --vl-rounding-md: var(--rounding-md);
    --vl-rounding-lg: var(--rounding-lg);

    /* Other */
    --vl-letter-spacing: var(--letter-spacing);
    --vl-disabled-opacity: var(--disabled-opacity);
}

/* ===== 5.3: tema dark dentro do shadow do nexus cart =====
   O bundle monta em shadow root e usa utilitarios com cores fixas (bg-default branco).
   Estas regras entram pelo custom.css que o proprio bundle injeta no shadow. */
:host-context([data-theme="dark"]) [class*="bg-default"],
:host-context([data-theme="dark"]) .bg-default,
:host-context([data-theme="dark"]) [class*="bg-white"] {
  background-color: #1a222b !important;
}
:host-context([data-theme="dark"]) [class*="bg-muted"] {
  background-color: #141b25 !important;
}
:host-context([data-theme="dark"]) [class*="bg-subtle"],
:host-context([data-theme="dark"]) [class*="bg-neutral"] {
  background-color: #161e2b !important;
}
:host-context([data-theme="dark"]) [class*="border-muted"] {
  border-color: #343b45 !important;
}
/* inputs/selects do carrinho */
:host-context([data-theme="dark"]) select,
:host-context([data-theme="dark"]) input,
:host-context([data-theme="dark"]) textarea {
  background-color: #121519 !important;
  border-color: #343b45 !important;
  color: #f7f7f7 !important;
}
/* texto secundario que estava cinza-claro sobre branco */
:host-context([data-theme="dark"]) [class*="text-muted"],
:host-context([data-theme="dark"]) [class*="text-gray"] {
  color: #a8b3d6 !important;
}

/* texto principal no dark (titulos usam classe fixa escura) */
:host-context([data-theme="dark"]) [class*="text-default"],
:host-context([data-theme="dark"]) [class*="text-black"],
:host-context([data-theme="dark"]) h1,
:host-context([data-theme="dark"]) h2,
:host-context([data-theme="dark"]) h3 {
  color: #f7f7f7 !important;
}

/* CTA primario do carrinho (o override de bg-default deixava o botao igual ao fundo) */
:host-context([data-theme="dark"]) button[class*="w-full"][class*="bg-default"],
:host-context([data-theme="dark"]) a[class*="w-full"][class*="bg-default"],
:host-context([data-theme="dark"]) button[class*="bg-default"][class*="border-solid"] {
  background-color: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}
/* cartoes claros remanescentes (upsell e afins) */
:host-context([data-theme="dark"]) [class*="bg-gray-50"],
:host-context([data-theme="dark"]) [class*="bg-zinc-50"],
:host-context([data-theme="dark"]) [class*="bg-neutral-50"],
:host-context([data-theme="dark"]) [class*="bg-white"] {
  background-color: #1a222b !important;
}

/* 5.3.1: (removido na 5.4.2 — a regra ampla pintava botoes secundarios de azul) */



/* 5.4.1: cartao de upsell ('Última Chance') usa bg-accented (cinza claro no dark) */
:host-context([data-theme="dark"]) [class*="bg-accented"] {
  background-color: #1a222b !important;
  border-color: #343b45 !important;
}
/* botoes secundarios: volta ao cinza em vez do azul do CTA */
:host-context([data-theme="dark"]) button[class*="bg-accented"],
:host-context([data-theme="dark"]) a[class*="bg-accented"] {
  background-color: #2563eb !important;
  color: #fff !important;
}

/* 5.4.2: botoes — primario azul apenas no resumo (sticky); secundarios voltam a superficie */
:host-context([data-theme="dark"]) button {
  background-color: #1a222b !important;
  border-color: #343b45 !important;
  color: #f7f7f7 !important;
}
:host-context([data-theme="dark"]) button[class*="border-0"],
:host-context([data-theme="dark"]) button[class*="bg-transparent"] {
  background-color: transparent !important;
  border-color: transparent !important;
}
/* 5.12: (regra :last-of-type removida — pintava o cupom de azul) */

/* 5.5: superficies do carrinho na cor do fundo (pedido do souzadavi) */
:host-context([data-theme="dark"]) [class*="bg-default"],
:host-context([data-theme="dark"]) .bg-default,
:host-context([data-theme="dark"]) [class*="bg-white"] {
  background-color: #121519 !important;
}

/* 5.38: registro de dominio (dark) — texto legivel e borda do campo de busca escura */
:host([data-app="domain-module"]) [class*="text-muted"],
:host([data-app="domain-module"]) [class*="text-gray"],
:host([data-app="domain-module"]) [class*="text-neutral"],
:host([data-app="domain-module"]) [class*="text-slate"] {
  color: #a8b3d6 !important;
}
:host([data-app="domain-module"]) h1,
:host([data-app="domain-module"]) h2,
:host([data-app="domain-module"]) h3,
:host([data-app="domain-module"]) h4,
:host([data-app="domain-module"]) h5,
:host([data-app="domain-module"]) h6 {
  color: #f7f8fb !important;
}
:host([data-app="domain-module"]) p,
:host([data-app="domain-module"]) small,
:host([data-app="domain-module"]) label {
  color: #a8b3d6 !important;
}
:host([data-app="domain-module"]) .input-group,
:host([data-app="domain-module"]) .input-group.input-group-lg,
:host([data-app="domain-module"]) .input-group.input-group-box {
  background-color: #121519 !important;
  border: 1px solid #343b45 !important;
  box-shadow: none !important;
}
:host([data-app="domain-module"]) .input-group .input-group-text,
:host([data-app="domain-module"]) .input-group input,
:host([data-app="domain-module"]) .input-group textarea,
:host([data-app="domain-module"]) .input-group select {
  background-color: #121519 !important;
  border-color: #343b45 !important;
  color: #f7f8fb !important;
}
:host([data-app="domain-module"]) .input-group input::placeholder,
:host([data-app="domain-module"]) .input-group textarea::placeholder {
  color: #7f8aa6 !important;
  opacity: 1 !important;
}
:host([data-app="domain-module"]) [class*="border-white"],
:host([data-app="domain-module"]) [class*="ring-white"],
:host([data-app="domain-module"]) [class*="outline-white"] {
  border-color: #343b45 !important;
}
:host([data-app="domain-module"]) .input-group:focus-within {
  box-shadow: 0 0 0 1px rgba(37, 99, 235, .28) !important;
}

/* 5.39: pagina de registrar dominio — ocultar apenas o bloco interno de titulo/descricao do UPage */
:host([data-app="domain-module"]) [data-test="domain-register-page"] .flex.items-start.justify-between.mb-4.md\:mb-6 {
  display: none !important;
}
/* 5.40: filtros avancados do registro de dominio — UI oculta, defaults forçados no POST do search */
:host([data-app="domain-module"]) [data-test="domain-search-toggle-filters-button"],
:host([data-app="domain-module"]) [data-test="domain-search-transfer-link"],
:host([data-app="domain-module"]) [data-test="domain-search-tlds-filter"],
:host([data-app="domain-module"]) [data-test="domain-search-max-length-filter"],
:host([data-app="domain-module"]) [data-test="domain-search-safe-search-checkbox"],
:host([data-app="domain-module"]) [data-test="domain-register-page"] .flex.flex-row.flex-wrap.w-full.gap-2.items-end.justify-start.content-start.lg\:flex-nowrap.-mt-2\.5,
:host([data-app="domain-module"]) [data-test="domain-register-page"] .flex.justify-between.mb-4:has([data-test="packages-card-button"]) {
  display: none !important;
}
/* 5.40.1: fallback para a versao icon-only do atalho de transferencia */
:host([data-app="domain-module"]) [data-test="domain-register-page"] a:has(svg.bi.bi-globe),
:host([data-app="domain-module"]) [data-test="domain-register-page"] button:has(svg.bi.bi-globe),
:host([data-app="domain-module"]) [data-test="domain-register-page"] svg.bi-arrow-left-right {
  display: none !important;
}
/* 5.41: drawer final de compra — CTA sempre legível nos dois temas */
:host([data-app="domain-module"]) .fixed.bottom-6 button,
:host([data-app="domain-module"]) [data-test="cart-bottom-drawer-checkout-button"] {
  background-color: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
:host([data-app="domain-module"]) .fixed.bottom-6 button svg,
:host([data-app="domain-module"]) [data-test="cart-bottom-drawer-checkout-button"] svg {
  color: currentColor !important;
  fill: currentColor !important;
}

/* 5.43: drawer flutuante — precisa viver na layer `theme`.
   Motivo medido: o bundle do order form declara `@layer properties, theme, base, components, utilities`
   e as utilidades usam `!important` (ex.: `.\\\\!bg-default{... !important}`). Declaração
   `!important` em layer vence `!important` sem layer, então regra solta nunca vence o utilitário. */
@layer theme {
  /* 5.44: cor fixa (light e dark) + largura util. O seletor continua ancorado na classe
     original `max-w-[53.5rem]` de propósito: a classe é a chave de match, a largura vem do CSS. */
  :host([data-app="domain-module"]) [class*="fixed"][class*="bottom-6"][class*="max-w-[53.5rem]"] {
    background-color: #9ba613 !important;
    background-image: linear-gradient(100deg, #9ba613 0%, #87920f 100%) !important;
    border-color: #9ba613 !important;
    color: #ffffff !important;
    max-width: 78.5rem !important;
    box-shadow: none !important;
  }
  :host([data-app="domain-module"]) [class*="fixed"][class*="bottom-6"][class*="max-w-[53.5rem]"] [class*="text-2xl"],
  :host([data-app="domain-module"]) [class*="fixed"][class*="bottom-6"][class*="max-w-[53.5rem]"] [class*="text-medium"] {
    color: #ffffff !important;
  }
  :host([data-app="domain-module"]) [class*="fixed"][class*="bottom-6"][class*="max-w-[53.5rem]"] [data-test="cart-bottom-drawer-checkout-button"] {
    background-color: #2563eb !important;
    background-image: none !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
    box-shadow: none !important;
  }
  :host([data-app="domain-module"]) [class*="fixed"][class*="bottom-6"][class*="max-w-[53.5rem]"] [data-test="cart-bottom-drawer-checkout-button"] svg {
    color: #ffffff !important;
    fill: #ffffff !important;
  }
}
/* 5.47: destaque da linha de correspondência exata (mesma âncora estrutural do 5.45) */
:host([data-app="domain-module"]) [data-test="domain-register-page"] div:has(> [data-test="suggested-ai-domains-section"]) > div:has(+ [data-test="suggested-ai-domains-section"]) > div[data-test^="domain-search-results-item-"] {
  border: 3px solid #ffffff !important;
}

/* 5.46: link WHOIS na linha de domínio indisponível (inserido por JS em domainregister.tpl) */
:host([data-app="domain-module"]) a[data-lkn-whois] {
  color: inherit !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  font-size: .875rem;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  margin-left: .35rem;
}
:host([data-app="domain-module"]) a[data-lkn-whois]:hover {
  color: #ffffff !important;
}

/* 5.45: ordem dos blocos de resultado — "Correspondência exata" antes de "Melhor sugestão de IA".
   Medido no render: o container é `display:flex; flex-direction:column` e os blocos são filhos diretos
   (busca, melhor sugestão, correspondência exata, sugestões de domínios, resultados da pesquisa).
   Reordenar por `order` evita mover nós que o Vue re-renderiza. Âncoras: `closest-match-card-add-to-cart`
   (melhor sugestão) e o bloco imediatamente anterior a `suggested-ai-domains-section`. */
:host([data-app="domain-module"]) [data-test="domain-register-page"] div:has(> [data-test="suggested-ai-domains-section"]) > div:has(+ [data-test="suggested-ai-domains-section"]) {
  order: 1 !important;
}
:host([data-app="domain-module"]) [data-test="domain-register-page"] div:has(> [data-test="suggested-ai-domains-section"]) > div:has([data-test="closest-match-card-add-to-cart"]) {
  order: 2 !important;
}
:host([data-app="domain-module"]) [data-test="domain-register-page"] [data-test="suggested-ai-domains-section"] {
  order: 3 !important;
}
:host([data-app="domain-module"]) [data-test="domain-register-page"] [data-test="domain-search-results-section"] {
  order: 4 !important;
}

/* 5.10: #151b25 SO nos cards (secoes de plano e 'Última Chance'), nao na coluna inteira */
:host-context([data-theme="dark"]) [class*="rounded-large"][class*="border-solid"],
:host-context([data-theme="dark"]) [class*="rounded-large"][class*="bg-accented"] {
  background-color: #151b25 !important;
}
:host-context([data-theme="light"]) [class*="bg-default"],
:host-context([data-theme="light"]) .bg-default,
:host-context([data-theme="light"]) [class*="bg-white"] {
  background-color: #f0f4f7 !important;
}

/* 5.7: menu nativo do select — deixa o proprio Chrome pintar (dark) em vez de forcar option */
:host-context([data-theme="dark"]) { color-scheme: dark; }

/* 5.7: pontinhos do loader (classe real: rounded-full bg-primary + ease-[cubic-bezier...]) */
:host-context([data-theme="dark"]) [class*="cubic-bezier"] {
  background-color: #f7f7f7 !important;
  opacity: .92 !important;
}

/* 5.8: combobox customizado do SPA (role=listbox/option) no dark
   A linha selecionada herdava bg-accented (escuro) + texto escuro = invisivel. */
:host-context([data-theme="dark"]) [role="listbox"] {
  background-color: #121519 !important;
  border-color: #343b45 !important;
  color: #f7f7f7 !important;
}
:host-context([data-theme="dark"]) [role="option"] {
  color: #f7f7f7 !important;
}
:host-context([data-theme="dark"]) [role="option"][aria-selected="true"],
:host-context([data-theme="dark"]) [role="option"][data-state="checked"],
:host-context([data-theme="dark"]) [role="option"][data-highlighted],
:host-context([data-theme="dark"]) [role="option"]:hover {
  background-color: #DAE300 !important;
  color: #121519 !important;
}
/* combobox fechado */
:host-context([data-theme="dark"]) [role="combobox"] {
  background-color: #1a222b !important;
  border-color: #343b45 !important;
  color: #f7f7f7 !important;
}

/* 5.8.1: reforco — qualquer destaque dentro do listbox fica azul com texto branco */
:host-context([data-theme="dark"]) [role="listbox"] [class*="bg-accented"],
:host-context([data-theme="dark"]) [role="listbox"] [class*="bg-lifted"],
:host-context([data-theme="dark"]) [role="listbox"] [class*="bg-secondary"],
:host-context([data-theme="dark"]) [role="listbox"] [aria-selected="true"],
:host-context([data-theme="dark"]) [role="listbox"] li:hover {
  background-color: #DAE300 !important;
  color: #121519 !important;
}

/* 5.11: link "Procurar produtos/serviços" — azul com hover lime (padrao do checkout) */
/* escopo estreito: so o link de voltar (inline-block + cursor-pointer + leading-none) */
[class*="inline-block"][class*="cursor-pointer"][class*="leading-none"] { color: #2563eb !important; }
[class*="inline-block"][class*="cursor-pointer"][class*="leading-none"]:hover,
[class*="inline-block"][class*="cursor-pointer"][class*="leading-none"]:focus { color: #DAE300 !important; }

/* 5.11: no hover/selecionado do combobox o texto (inclusive filhos) fica escuro */
:host-context([data-theme="dark"]) [role="option"]:hover,
:host-context([data-theme="dark"]) [role="option"]:hover *,
:host-context([data-theme="dark"]) [role="option"][aria-selected="true"],
:host-context([data-theme="dark"]) [role="option"][aria-selected="true"] *,
:host-context([data-theme="dark"]) [role="listbox"] [class*="bg-accented"],
:host-context([data-theme="dark"]) [role="listbox"] [class*="bg-accented"] * {
  color: #121519 !important;
}

/* 5.12: hierarquia de CTAs no resumo (UX)
   1 primario (Finalizar) = solido azul
   2 secundario (cupom)   = ghost/texto, sem fundo
   3 informativo (chip do imposto) = badge discreto
   Vale nos dois temas; o CTA e o ultimo botao do bloco sticky. */
[class*="md:sticky"] button {
  background: transparent !important;
  border-color: transparent !important;
  color: #6b7280 !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}
[class*="md:sticky"] button:hover { color: #111827 !important; }
[data-theme="dark"] [class*="md:sticky"] button { color: #a8b3d6 !important; }
[data-theme="dark"] [class*="md:sticky"] button:hover { color: #f7f7f7 !important; }

/* chip do imposto: badge, nao botao */
[class*="md:sticky"] button[class*="rounded-full"] {
  background: rgba(11, 18, 32, .05) !important;
  border: 1px solid rgba(11, 18, 32, .12) !important;
  color: #4b5563 !important;
  font-size: .78rem !important;
  padding: 2px 10px !important;
}
[data-theme="dark"] [class*="md:sticky"] button[class*="rounded-full"] {
  background: rgba(255, 255, 255, .06) !important;
  border-color: #343b45 !important;
  color: #a8b3d6 !important;
}

/* primario por ultimo, para vencer a regra ghost */
/* 5.12.1: primario identificado por classe real (bg-primary + text-large) */

/* 5.12.1: hierarquia por CLASSE REAL do app
   CTA  = bg-primary + text-large
   cupom= bg-transparent + text-medium
   chip = bg-primary/5 (informacional) */
:host-context([data-theme="dark"]) button[class*="bg-primary"][class*="text-large"],
:host-context([data-theme="light"]) button[class*="bg-primary"][class*="text-large"] {
  background-color: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}
:host-context([data-theme="dark"]) button[class*="bg-transparent"][class*="text-medium"],
:host-context([data-theme="light"]) button[class*="bg-transparent"][class*="text-medium"] {
  background-color: transparent !important;
  border-color: transparent !important;
  color: #a8b3d6 !important;
  font-weight: 500 !important;
}
:host-context([data-theme="dark"]) button[class*="bg-transparent"][class*="text-medium"]:hover {
  color: #f7f7f7 !important;
  background-color: rgba(255, 255, 255, .06) !important;
}
:host-context([data-theme="dark"]) button[class*="bg-primary/5"] {
  background-color: rgba(255, 255, 255, .06) !important;
  border: 1px solid #343b45 !important;
  color: #a8b3d6 !important;
  font-weight: 500 !important;
}

/* 5.13: titulo e descricao do carrinho na escala do hero do checkout (so no titulo do hero) */
.lkn-cart-title {
  font-size: 2.6rem !important;
  line-height: 1.06 !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
  max-width: 620px;
}
@media (max-width: 575px) {
  .lkn-cart-title { font-size: 1.9rem !important; }
}
.lkn-cart-title .lkn-cart-sub,
.lkn-cart-sub {
  display: block;
  margin-top: 10px;
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 400;
  color: #6b7280;
  max-width: 620px;
}
:host-context([data-theme="dark"]) .lkn-cart-sub { color: #a8b3d6; }

/* 5.21: cards de adicional — cores por tema (light neutro / dark token) */
.lkn-addon-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.lkn-addon-card.is-checked {
  border-color: #2563eb;
  background: #f1f5f9;
}
:host-context([data-theme="dark"]) .lkn-addon-card {
  border-color: #343b45;
}
:host-context([data-theme="dark"]) .lkn-addon-card.is-checked {
  border-color: #2563eb;
  background: rgba(37, 99, 235, .10);
}

/* 5.36: items do carrinho com o background do tema (var do proprio tema).
   Escopo por tema: as regras existentes usam :host-context(), que tem especificidade maior.
   No dark o valor de --background-color-muted medido e claro (#fbf9fa), entao mantemos o token escuro. */
:host-context([data-theme="light"]) [data-test="cart-item"][class*="rounded-large"] {
  background-color: var(--background-color-muted) !important;
}
