.site-header {
  position: sticky;
  z-index: 80;
  top: 0;
  border-bottom: 1px solid transparent;
  background: rgba(6, 16, 29, 0.68);
  backdrop-filter: blur(20px) saturate(145%);
  transition:
    border-color var(--transition),
    background-color var(--transition),
    box-shadow var(--transition);
}

html[data-theme="light"] .site-header {
  background: rgba(244, 248, 253, 0.76);
}

.site-header.is-scrolled {
  border-color: var(--line);
  box-shadow: 0 12px 36px rgba(1, 7, 15, 0.12);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  color: #06101d;
  background: var(--gradient-brand);
  box-shadow: 0 12px 28px rgba(49, 143, 255, 0.28);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}

.brand-mark-large {
  width: 68px;
  height: 68px;
  border-radius: 22px;
}

.brand-mark-large svg {
  width: 39px;
  height: 39px;
}

.brand-copy {
  display: grid;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 0.98rem;
  font-weight: 950;
  letter-spacing: 0.055em;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.desktop-nav a,
.mobile-nav a {
  color: var(--muted-strong);
  font-size: 0.91rem;
  font-weight: 800;
  transition: color var(--transition), transform var(--transition);
}

.desktop-nav a:hover,
.mobile-nav a:hover {
  color: var(--text);
}

.desktop-nav a:hover {
  transform: translateY(-1px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.icon-button {
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text-soft);
  background: var(--surface-light);
  cursor: pointer;
  transition:
    color var(--transition),
    border-color var(--transition),
    background-color var(--transition),
    transform var(--transition);
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.search-trigger {
  min-width: 185px;
  justify-content: flex-start;
}

.search-trigger-label {
  margin-right: auto;
  color: var(--muted-strong);
  font-size: 0.86rem;
  font-weight: 750;
}

kbd {
  display: inline-grid;
  min-width: 24px;
  min-height: 22px;
  place-items: center;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-bottom-color: rgba(148, 174, 207, 0.3);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-light);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 850;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

.menu-toggle {
  display: none;
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
}

.mobile-nav-inner {
  display: grid;
  gap: 4px;
  padding-block: 12px 18px;
}

.mobile-nav a {
  padding: 12px 4px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 0.91rem;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition),
    background-color var(--transition),
    color var(--transition),
    opacity var(--transition);
}

.button:hover {
  transform: translateY(-2px);
}

.button svg {
  width: 17px;
  height: 17px;
}

.button-large {
  min-height: 52px;
  padding-inline: 22px;
  border-radius: 16px;
}

.button-primary {
  color: #06101d;
  background: var(--gradient-brand);
  box-shadow: 0 16px 34px rgba(49, 143, 255, 0.24);
}

.button-primary:hover {
  box-shadow: 0 20px 42px rgba(49, 143, 255, 0.34);
}

.button-secondary {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-light);
}

.button-secondary:hover {
  border-color: var(--line-strong);
  background: var(--primary-soft);
}

.button-light {
  color: #081321;
  background: #f8fbff;
  box-shadow: 0 16px 34px rgba(3, 10, 21, 0.2);
}

.button[disabled],
.button[aria-disabled="true"] {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 900;
}

.text-link svg {
  transition: transform var(--transition);
}

.text-link:hover svg {
  transform: translateX(4px);
}

.section-center {
  display: flex;
  justify-content: center;
  margin-top: 34px;
}

.category-card,
.tool-card,
.step-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--gradient-surface);
  box-shadow: var(--shadow-small);
}

.category-card::before,
.tool-card::before,
.step-card::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent, var(--primary)) 22%, transparent), transparent 44%);
  transition: opacity var(--transition-slow);
}

.category-card:hover::before,
.tool-card:hover::before,
.step-card:hover::before {
  opacity: 1;
}

.category-card,
.tool-card {
  transition:
    transform var(--transition-slow),
    border-color var(--transition),
    box-shadow var(--transition-slow);
}

.category-card:hover,
.tool-card:hover {
  border-color: color-mix(in srgb, var(--accent, var(--primary)) 50%, var(--line));
  box-shadow: var(--shadow-medium);
  transform: translateY(-7px);
}

.card-icon,
.tool-icon,
.step-icon {
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent, var(--primary)) 38%, var(--line));
  color: var(--accent, var(--primary));
  background: color-mix(in srgb, var(--accent, var(--primary)) 13%, transparent);
}

.card-icon svg,
.tool-icon svg,
.step-icon svg {
  width: 24px;
  height: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted-strong);
  background: var(--surface-light);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.025em;
}

.badge.is-ready {
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(74, 222, 128, 0.1);
}

html[data-theme="light"] .badge.is-ready {
  color: #166534;
}

.badge.is-planned {
  color: #cbd5e1;
}

.skeleton-card {
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(
      100deg,
      var(--surface-light) 30%,
      color-mix(in srgb, var(--surface-light) 60%, var(--primary-soft)) 50%,
      var(--surface-light) 70%
    );
  background-size: 300% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

.search-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(720px, calc(100dvh - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  color: var(--text);
  background: transparent;
  box-shadow: var(--shadow-large);
}

.search-dialog::backdrop {
  background: rgba(1, 7, 15, 0.72);
  backdrop-filter: blur(10px);
}

.search-dialog-panel {
  display: grid;
  max-height: min(720px, calc(100dvh - 28px));
  grid-template-rows: auto minmax(180px, 1fr) auto;
  background: var(--bg-elevated);
}

.search-dialog-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}

.search-field {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-light);
}

.search-field > span {
  color: var(--muted);
}

.search-field input {
  min-width: 0;
  min-height: 50px;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search-field input::placeholder {
  color: var(--muted);
}

.dialog-close {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--muted-strong);
  background: var(--surface-light);
  cursor: pointer;
}

.search-dialog-body {
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
}

.search-hint {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: var(--primary-soft);
}

.search-hint > span {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: var(--primary);
  background: rgba(94, 185, 255, 0.1);
}

.search-hint strong {
  display: block;
  margin-bottom: 4px;
}

.search-hint p {
  font-size: 0.88rem;
  line-height: 1.6;
}

.search-results {
  display: grid;
  gap: 8px;
}

.search-result {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.search-result:hover,
.search-result.is-active {
  border-color: var(--line);
  background: var(--surface-light);
  transform: translateX(3px);
}

.search-result-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  color: var(--result-accent, var(--primary));
  background: color-mix(in srgb, var(--result-accent, var(--primary)) 13%, transparent);
}

.search-result-copy {
  display: grid;
  min-width: 0;
  flex: 1;
}

.search-result-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-empty {
  padding: 34px 20px;
  text-align: center;
}

.search-empty strong {
  display: block;
  margin-bottom: 6px;
}

.search-dialog-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
}

.search-dialog-footer span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 22px;
  bottom: 22px;
  display: flex;
  max-width: min(430px, calc(100% - 28px));
  align-items: center;
  gap: 12px;
  padding: 15px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  color: var(--text);
  background: var(--surface-solid);
  box-shadow: var(--shadow-medium);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition:
    opacity var(--transition-slow),
    transform var(--transition-slow);
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

.toast > span {
  color: var(--primary);
}

.toast p {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(3, 10, 19, 0.34);
}

html[data-theme="light"] .site-footer {
  background: rgba(230, 239, 249, 0.45);
}

.footer-main {
  display: grid;
  grid-template-columns: 1.55fr repeat(3, 0.72fr);
  gap: 48px;
  padding-block: 72px 54px;
}

.footer-brand p {
  max-width: 390px;
  margin-top: 20px;
  line-height: 1.75;
}

.footer-column {
  display: grid;
  align-content: start;
  gap: 11px;
}

.footer-column strong {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 0.89rem;
}

.footer-column a {
  color: var(--muted);
  font-size: 0.86rem;
  transition: color var(--transition), transform var(--transition);
}

.footer-column a:hover {
  color: var(--text);
  transform: translateX(3px);
}

.footer-bottom {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}


/* =========================================================
   HOME MODERNA CLARA · COMPONENTES
   ========================================================= */
html[data-theme="light"] .site-header {
  border-bottom-color: rgba(37, 64, 102, 0.08);
  background: rgba(255,255,255,.82);
  box-shadow: 0 10px 34px rgba(30,64,110,.045);
}

html[data-theme="light"] .site-header.is-scrolled {
  background: rgba(255,255,255,.93);
  box-shadow: 0 14px 42px rgba(30,64,110,.10);
}

html[data-theme="light"] .brand-mark {
  border-color: rgba(37,99,235,.12);
  box-shadow: 0 12px 28px rgba(37,99,235,.20);
}

html[data-theme="light"] .icon-button,
html[data-theme="light"] .button-secondary {
  border-color: rgba(37,64,102,.10);
  background: rgba(255,255,255,.86);
  box-shadow: 0 8px 22px rgba(30,64,110,.055);
}

html[data-theme="light"] .icon-button:hover,
html[data-theme="light"] .button-secondary:hover {
  border-color: rgba(37,99,235,.28);
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(37,99,235,.10);
}

html[data-theme="light"] .category-card,
html[data-theme="light"] .tool-card,
html[data-theme="light"] .step-card {
  border-color: rgba(37,64,102,.09);
  background: rgba(255,255,255,.94);
  box-shadow: 0 14px 38px rgba(30,64,110,.07);
}

html[data-theme="light"] .category-card:hover,
html[data-theme="light"] .tool-card:hover,
html[data-theme="light"] .step-card:hover {
  border-color: color-mix(in srgb, var(--accent, var(--primary)) 34%, rgba(37,64,102,.08));
  box-shadow: 0 24px 58px rgba(30,64,110,.13);
}

html[data-theme="light"] .badge {
  background: #f7f9fd;
}

html[data-theme="light"] .site-footer {
  background: linear-gradient(180deg, rgba(238,244,251,.72), rgba(245,248,252,.96));
}

/* =========================================================
   XIPALAPLUTS · COMPONENTES CLAROS PREMIUM V3
   ========================================================= */
html[data-theme="light"] .site-header {
  border-bottom-color: rgba(31, 57, 94, 0.08);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 34px rgba(30, 58, 96, 0.045);
}

html[data-theme="light"] .site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 44px rgba(30, 58, 96, 0.10);
}

html[data-theme="light"] .desktop-nav a,
html[data-theme="light"] .mobile-nav a {
  color: #52637a;
}

html[data-theme="light"] .desktop-nav a:hover,
html[data-theme="light"] .mobile-nav a:hover {
  color: #0b1b33;
}

html[data-theme="light"] .icon-button,
html[data-theme="light"] .button-secondary {
  color: #18304d;
  border-color: rgba(31, 57, 94, 0.11);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(30, 58, 96, 0.055);
}

html[data-theme="light"] .button-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #3978ee 54%, #7c3aed 100%);
  box-shadow: 0 16px 32px rgba(49, 92, 214, 0.25);
}

html[data-theme="light"] .button-primary:hover {
  box-shadow: 0 20px 40px rgba(49, 92, 214, 0.31);
}

html[data-theme="light"] .category-card,
html[data-theme="light"] .tool-card,
html[data-theme="light"] .step-card,
html[data-theme="light"] .faq-item {
  border-color: rgba(31, 57, 94, 0.10);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 15px 38px rgba(28, 52, 86, 0.075);
}

html[data-theme="light"] .category-card:hover,
html[data-theme="light"] .tool-card:hover {
  box-shadow: 0 25px 58px rgba(28, 52, 86, 0.14);
}

html[data-theme="light"] .category-card::after,
html[data-theme="light"] .tool-card::after {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  content: "";
  opacity: 0.82;
  background: linear-gradient(90deg, var(--accent, #2563eb), transparent 82%);
}

html[data-theme="light"] .site-footer {
  color: #dce7f6;
  border-top-color: rgba(148, 163, 184, 0.14);
  background:
    radial-gradient(circle at 86% 0%, rgba(124, 58, 237, 0.19), transparent 28rem),
    linear-gradient(145deg, #071426 0%, #0b1c34 52%, #101d39 100%);
}

html[data-theme="light"] .site-footer .brand-copy strong,
html[data-theme="light"] .site-footer .footer-column strong {
  color: #ffffff;
}

html[data-theme="light"] .site-footer p,
html[data-theme="light"] .site-footer a,
html[data-theme="light"] .site-footer .footer-bottom {
  color: #9fb0c8;
}

html[data-theme="light"] .site-footer a:hover {
  color: #ffffff;
}

html[data-theme="light"] .site-footer .footer-bottom {
  border-top-color: rgba(148, 163, 184, 0.14);
}
