:root {
  --md-header-height: 84px;

  /* MODO CLARO (PADRÃO) */
  /* Cabeçalho Principal: Azul Profundo (#010440) */
  --md-primary-fg-color:        #010440;
  
  --md-primary-fg-color--light: #1E2640; 
  --md-primary-fg-color--dark:  #000220; 

  /* Cor de Destaque (Botões, abas ativas, loading) */
  --md-accent-fg-color:         #D92323;

  /* Cor dos Links no texto: Vinho Institucional */
  --md-typeset-a-color:         #731F2E;

  /* --- TIPOGRAFIA & FORMAS --- */
  --md-text-font-family:        "Inter", sans-serif;
  --md-code-font-family:        "JetBrains Mono", monospace;
  
  --md-admonition-radius:       8px;
  --md-code-border-radius:      6px;
  --md-shadow-z1:               0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --md-typeset-font-size:       0.95rem;

  /* Controle do Logo no Rodapé */
  --xmart-logo-opacity:         0.1;
}

/* --- MODO ESCURO (SLATE) --- */
[data-md-color-scheme="slate"] {
  --md-default-bg-color:        #0D0D0D; 
  
  --md-code-bg-color:           #1E2640; 
  
  --md-primary-fg-color:        #1E2640;
  
  --md-accent-fg-color:         #D92323;

  --md-typeset-a-color:         #ff6b6b; 
}

/* --- REFINAMENTOS VISUAIS--- */

/*Blocos de Código com Sombra e Cantos */
.md-typeset pre > code {
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

.md-header__inner {
  align-items: center;
}

.xmart-hero {
  /* Slim hero wrapper: transparent to avoid a dominating colored band */
  background: transparent;
  color: var(--md-default-fg-color, #fff);
  padding: 0;
  margin-bottom: 1rem;
  position: relative;
}

.xmart-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.xmart-hero img {
  max-width: 340px; /* Tamanho do logo na capa */
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 1rem auto;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.35)); /* Sombra para destacar do fundo */
}

.xmart-hero h1 {
  color: white !important;
  font-weight: 800;
  font-size: 2rem;
  margin-top: 0;
  letter-spacing: 0em;
}

.xmart-hero p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.8rem;
  line-height: 1.6;
  margin: 0;
  opacity: 0.90;
}

/* New: inner grid to avoid full-width giant block */
.xmart-hero .hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: center;
}

.xmart-hero .hero-content {
  text-align: left;
}

.xmart-hero .hero-cta {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.xmart-hero .hero-card {
  /* Main slim card container */
  max-width: 100%;
  margin: 0;
  background: linear-gradient(180deg, rgba(3,10,30,0.7), rgba(7,14,40,0.6));
  border-radius: 12px;
  padding: 1.1rem 1.4rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  box-shadow: 0 12px 30px rgba(3,10,30,0.18);
  border: 1px solid rgba(255,255,255,0.04);
}

.xmart-hero .hero-card img {
  width: 84px;
  height: auto;
  border-radius: 8px;
  flex: 0 0 84px;
}

.xmart-hero .hero-meta {
  flex: 1 1 auto;
}

.xmart-hero .hero-meta h1 {
  margin: 0 0 0.35rem 0;
  font-size: 1.8rem;
  color: #fff;
}

.xmart-hero .hero-meta p {
  margin: 0;
  color: rgba(255,255,255,0.9);
}

.xmart-hero .hero-actions p {
  gap: 0.5rem;
  align-items: center;
  margin: 0 !important; 
  padding: 0 !important;
}

.xmart-hero .hero-actions {
  gap: 0; 
}

.xmart-hero .hero-actions .md-button {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
}

.xmart-hero .hero-card--no-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.xmart-hero .hero-card--no-logo .hero-meta {
  text-align: left;
}

.md-header .md-header__button.md-logo img {
  height: 64px; 
  width: auto;
  min-width: 64px; 
}

/*Botões Modernos (Pílula) */
.md-button {
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.4s ease;
  padding: 0.6em 1.6em; 
}
.md-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(217, 35, 35, 0.3); /* Sombra avermelhada */
}
.md-button--primary {
  background-color: var(--md-accent-fg-color) !important;
  border-color: var(--md-accent-fg-color) !important;
  color: #fff !important;
}

/* Feature cards below hero to break the big block */
.home-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}
.home-features .feature {
  background: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,250,0.98));
  color: var(--md-primary-fg-color--dark);
  padding: 1.1rem;
  border-radius: 10px;
  box-shadow: 0 8px 20px -10px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.03);
}
.home-features .feature h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.05rem;
}
.home-features .feature p {
  margin: 0;
  color: rgba(0,0,0,0.7);
  font-size: 0.95rem;
}

/*Tabelas Profissionais  */
.md-typeset table:not([class]) {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--md-default-fg-color--lightest);
}
.md-typeset table:not([class]) th {
  background-color: var(--md-primary-fg-color);
  color: white;
  font-weight: 600;
}

/*Scrollbar Personalizada */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--md-accent-fg-color); /* Vermelho ao passar o mouse */
}

/* --- ESTILOS DE IMPRESSÃO --- */
@media print {
  .grid, .grid.cards, .cards {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
  }
  
  .grid > *, .grid.cards > ul > li {
    display: block !important;
    width: 100% !important;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    padding: 10px;
    page-break-inside: avoid;
  }

  .md-footer-meta__inner {
    justify-content: center;
    text-align: center;
  }

  /* Ajuste para garantir que o logo saia nítido na impressão */
  .md-header .md-header__button.md-logo img {
    height: 42px;
    width: auto;
  }

  .md-nav, .md-header, .md-footer {
    display: none !important;
  }
}

/* --- MARCA DÁGUA --- */
/* Exibe o logo no canto inferior direito das páginas */
.md-content:after {
  content: "";
  background: url('../assets/img/Xmart-logo.png') no-repeat;
  background-size: contain;
  opacity: 0.1; /* Bem sutil */
  position: fixed;
  bottom: 120px; 
  right: 20px;
  width: 120px;
  height: 60px;
  z-index: 0;
  pointer-events: none;
  filter: grayscale(100%); /* Mantém discreto */
}

/* Oculta marca dágua em telas pequenas para não atrapalhar leitura */
/* Hero tweaks: keep actions inline and allow meta to shrink */
.xmart-hero .hero-card { max-width: 100%; }
.xmart-hero .hero-meta { flex: 1 1 0; min-width: 0; }
.xmart-hero .hero-actions { flex: 0 0 auto; white-space: nowrap; }
.xmart-hero .hero-actions .md-button { padding: 0.4rem 0.85rem; font-size: 0.9rem; }
.xmart-hero .hero-meta p { max-width: 60ch; overflow-wrap: anywhere; }

@media screen and (max-width: 768px) {
    .md-content:after { display: none; }
    .xmart-hero {
      padding: 2rem 1rem;
    }
    .xmart-hero .hero-inner {
      grid-template-columns: 1fr;
      text-align: center;
    }
    .xmart-hero .hero-content { text-align: center; }
    .xmart-hero img { margin: 1rem auto; }
    .home-features {
      grid-template-columns: 1fr;
    }

    /* stack hero-card on small screens and center text/actions */
    .xmart-hero .hero-card {
      flex-direction: column;
      text-align: center;
      gap: 0.75rem;
    }
    .xmart-hero .hero-card--no-logo .hero-meta { text-align: center; }
    .xmart-hero .hero-actions { justify-content: center; margin-top: 0.5rem; }
}

@media screen and (min-width: 769px) and (max-width: 1100px) {
  .xmart-hero .hero-inner { grid-template-columns: 1fr 280px; }
  .home-features { grid-template-columns: repeat(2,1fr); }
}

.xmart-hero {
  display: flex;
  flex-direction: column;              /* move ações para baixo do texto */
  gap: 14px;

  padding: 22px 24px;
  border-radius: 14px;

  background: linear-gradient(180deg, rgba(0, 2, 32, 0.521), rgba(0, 2, 32, 0.274));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}

.xmart-hero h1,
.xmart-hero h2,
.xmart-hero .xmart-hero__title {
  margin: 0;
}

.xmart-hero p,
.xmart-hero .xmart-hero__subtitle {
  margin: 6px 0 0;
  max-width: 72ch;
  opacity: 0.92;
}

/* Área dos botões (embaixo do texto) */
.xmart-hero .xmart-hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
}

/* Base dos botões (não afeta outros .md-button do site) */
.xmart-hero .xmart-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;

  padding: 10px 14px;
  min-height: 44px;                    /* alvo de toque */
  font-weight: 700;
  letter-spacing: 0.2px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  cursor: pointer;
  text-decoration: none;

  transition:
    transform 120ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease,
    opacity 140ms ease;
}

.xmart-hero .xmart-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(217, 35, 35, 0.35);
}

/* Primário: "Começar" */
.xmart-hero .xmart-btn--primary {
  background: var(--md-accent-fg-color);
  color: #fff;
  box-shadow: 0 10px 18px rgba(217, 35, 35, 0.25);
}

.xmart-hero .xmart-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(217, 35, 35, 0.30);
  color: rgba(255, 240, 240, 0.658);
}

/* Secundário: "Ver instalação" */
.xmart-hero .xmart-btn--secondary {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.88);
  border-color: rgba(255, 255, 255, 0.12);
}

.xmart-hero .xmart-btn--secondary:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

.xmart-hero .xmart-btn[aria-disabled="true"],
.xmart-hero .xmart-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}