/**
 * Khani Motors – globales Erscheinungsbild (an Next.js angelehnt)
 */

:root {
  --khani-bg: #0a0a0a;
  --khani-card: #161616;
  --khani-fg: #f4f4f5;
  --khani-muted: #a1a1aa;
  --khani-gold: #cba052;
  --khani-gold-light: #d4b068;
  --khani-gold-dark: #a88543;
  --khani-border: #2e2e2e;
  --khani-blur-header: rgba(13, 13, 13, 0.88);
  /* Gesamthöhe fixierter Kopfzeile inkl. Shop-Leiste (für Content-Padding & Flyout) */
  --khani-header-offset: 5.25rem;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--khani-bg) !important;
  color: var(--khani-fg) !important;
}

::selection {
  background-color: rgba(203, 160, 82, 0.35);
  color: var(--khani-fg);
}

/* Dunkle Scrollbar wie im Next-Frontend */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #141414;
}

::-webkit-scrollbar-thumb {
  background: #404040;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Site-Basis (Block-Theme) */
.wp-site-blocks {
  min-height: 100vh;
}

/* Eingebettete Woo-Seiten im Next.js-Frontend: nur der eigentliche Shop-Inhalt, keine zweite Shell */
body.khani-embed .wp-site-blocks {
  padding-top: 0 !important;
  min-height: auto;
}

body.khani-embed .wp-site-blocks header.wp-block-template-part,
body.khani-embed .wp-site-blocks footer.wp-block-template-part,
body.khani-embed .wp-site-blocks > header,
body.khani-embed .wp-site-blocks > footer,
body.khani-embed .wp-site-blocks > .wp-block-template-part,
body.khani-embed .khani-header-mount,
body.khani-embed .khani-footer-mount,
body.khani-embed .khani-motors-header,
body.khani-embed .khani-shop-footer {
  display: none !important;
}

body.khani-embed main#wp--skip-link--target,
body.khani-embed main#wp--skip-link--target.has-global-padding {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
}

body.khani-embed .woocommerce-page .woocommerce,
body.khani-embed .woocommerce {
  padding-bottom: 0 !important;
}

/* Theme-Kopfzeile / -footer ausblenden, wenn Khani Shell automatisch geladen wird */
body.khani-auto-header .wp-site-blocks header.wp-block-template-part,
body.khani-auto-header .wp-site-blocks > header {
  display: none !important;
}

body.khani-auto-footer .wp-site-blocks footer.wp-block-template-part,
body.khani-auto-footer .wp-site-blocks > footer {
  display: none !important;
}

/* Kopfzeilen-Bereich – dezent abgesetzt wie Navigation mit Border */
header.wp-block-template-part,
.block-editor-block-list__layout header.wp-block-template-part {
  border-bottom: 1px solid var(--khani-border) !important;
  background: var(--khani-blur-header) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Site-Titel = Playfair-Anmut im Editor + Frontend */
.wp-block-site-title a,
.wp-block-site-title .wp-block-site-title__link {
  font-family: "Playfair Display", Georgia, serif !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em;
  color: var(--khani-fg) !important;
  text-decoration: none !important;
}

.wp-block-site-title a:hover {
  color: var(--khani-gold) !important;
}

/* Navigation – Tabs-ähnlich: ruhige Links, Hover Gold */
.wp-block-navigation .wp-block-navigation-item__content {
  color: var(--khani-muted) !important;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}

.wp-block-navigation .wp-block-navigation-item__content:hover,
.wp-block-navigation .current-menu-item .wp-block-navigation-item__content {
  color: var(--khani-gold) !important;
}

.wp-block-navigation__responsive-container-open svg,
.wp-block-navigation__responsive-container-close svg {
  filter: brightness(0) invert(1);
}

/* Gruppen / Abschnitte */
.wp-block-group.has-khani-card-background-color,
.has-khani-card-background-color {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
}

/* Einträge & Seiteninhalte */
.entry-content,
.wp-block-post-content {
  font-size: 1rem;
  line-height: 1.65;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.wp-block-post-content h1,
.wp-block-post-content h2,
.wp-block-post-content h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--khani-fg);
}

.entry-content a,
.wp-block-post-content a {
  color: var(--khani-gold);
}

.entry-content a:hover {
  color: var(--khani-gold-light);
}

/* Footer */
footer.wp-block-template-part {
  border-top: 1px solid var(--khani-border);
  background: var(--khani-bg) !important;
  margin-top: auto;
}

footer .wp-block-site-title a,
footer .wp-block-navigation-item__content {
  color: var(--khani-muted) !important;
}

footer .wp-block-navigation-item__content:hover {
  color: var(--khani-fg) !important;
}

/* Allgemeine WP-Blöcke */
.wp-block-button__link.wp-element-button {
  border-radius: 9999px;
  font-weight: 600;
  background: var(--khani-gold) !important;
  color: #0d0d0d !important;
}

.wp-block-button__link.wp-element-button:hover {
  background: var(--khani-gold-dark) !important;
  color: #0d0d0d !important;
}

.wp-block-quote {
  border-left: 3px solid var(--khani-gold);
  padding-left: 1.25rem;
  color: var(--khani-muted);
}

hr.wp-block-separator {
  border-color: var(--khani-border);
  opacity: 1;
}

/* Text Gold-Verlauf (optional für Überschriften) */
.khani-text-gold-gradient {
  background: linear-gradient(135deg, #cba052 0%, #d4b068 50%, #cba052 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

a.khani-main-site-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--khani-gold) !important;
  text-decoration: none;
}

a.khani-main-site-link:hover {
  color: var(--khani-gold-light) !important;
}

/* ─── Khani Kopfzeile (Next.js-Parität) ─── */
.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.khani-nav-checkbox {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  appearance: none;
}

.khani-motors-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100050;
}

body.admin-bar .khani-motors-header {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar .khani-motors-header {
    top: 46px;
  }
}

body.khani-auto-header:not(.admin-bar) .wp-site-blocks {
  padding-top: var(--khani-header-offset);
}

body.khani-auto-header.admin-bar .wp-site-blocks {
  padding-top: calc(32px + var(--khani-header-offset));
}

@media (max-width: 782px) {
  body.khani-auto-header.admin-bar .wp-site-blocks {
    padding-top: calc(46px + var(--khani-header-offset));
  }
}

body:has(.khani-nav-checkbox:checked) {
  overflow: hidden;
}

.khani-motors-header__bar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(13, 13, 13, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.khani-motors-header__inner {
  box-sizing: border-box;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.55rem clamp(1rem, 4vw, 2rem);
  min-height: 4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.khani-motors-header__spacer {
  flex: 1 1 0;
  min-width: 1rem;
}

.khani-brand-cluster {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.khani-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.khani-shop-badge {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0d0d0d;
  background: var(--khani-gold);
  padding: 0.28rem 0.5rem;
  border-radius: 0.25rem;
  line-height: 1;
}

.khani-brand__img {
  max-height: 2.25rem;
  width: auto;
  display: block;
}

@media (min-width: 640px) {
  .khani-brand__img {
    max-height: 2.5rem;
  }
}

.khani-brand__text {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--khani-fg);
}

.khani-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.khani-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 9999px;
  padding: 0.48rem 0.75rem;
  line-height: 1.2;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  border: none;
  cursor: pointer;
  background: transparent;
  box-sizing: border-box;
  white-space: nowrap;
}

.khani-ico {
  flex-shrink: 0;
}

.khani-action--ext {
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: transparent !important;
  color: var(--khani-muted) !important;
  font-size: 0.7rem !important;
}

.khani-action--ext:hover {
  border-color: rgba(203, 160, 82, 0.45) !important;
  color: var(--khani-gold) !important;
}

.khani-action--account {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--khani-fg) !important;
}

.khani-action--account:hover {
  border-color: rgba(203, 160, 82, 0.45) !important;
  color: var(--khani-gold) !important;
}

.khani-action--cart {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--khani-fg) !important;
  padding: 0.55rem !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.khani-action--icon-touch {
  border-radius: 9999px !important;
}

.khani-action--cart:hover {
  border-color: rgba(203, 160, 82, 0.45) !important;
  color: var(--khani-gold) !important;
}

.khani-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--khani-fg);
  border-radius: 0.375rem;
  margin-left: 0.1rem;
}

.khani-burger:hover {
  color: var(--khani-gold);
}

@media (min-width: 768px) {
  .khani-burger {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .khani-action--ext {
    display: none !important;
  }

  .khani-action--account .khani-action__label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    white-space: nowrap !important;
  }
}

.khani-motors-header__flyout {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: var(--khani-header-offset);
  z-index: 100040;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s ease, visibility 0.35s;
}

body.admin-bar .khani-motors-header__flyout {
  top: calc(32px + var(--khani-header-offset));
}

@media (max-width: 782px) {
  body.admin-bar .khani-motors-header__flyout {
    top: calc(46px + var(--khani-header-offset));
  }
}

.khani-nav-checkbox:checked + .khani-motors-header .khani-motors-header__flyout {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.khani-flyout__inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.khani-flyout__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 13, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.khani-flyout__panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
  text-align: center;
}

.khani-flyout__head {
  display: flex;
  width: 100%;
  max-width: 22rem;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--khani-border);
}

.khani-flyout__title {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--khani-muted);
}

.khani-flyout__close {
  cursor: pointer;
  padding: 0.35rem;
  color: var(--khani-fg);
  line-height: 0;
}

.khani-flyout__close:hover {
  color: var(--khani-gold);
}

.khani-flyout__pills {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 22rem;
}

.khani-flyout__pills .khani-pill {
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.khani-flyout__tuning {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 22rem;
}

.khani-flyout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.khani-flyout-btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--khani-fg);
}

.khani-flyout-btn--ghost:hover {
  border-color: rgba(203, 160, 82, 0.4);
}

.khani-flyout-btn--gold {
  border: 1px solid rgba(203, 160, 82, 0.5);
  background: rgba(203, 160, 82, 0.1);
  color: var(--khani-gold);
}

.khani-flyout-btn--gold:hover {
  background: rgba(203, 160, 82, 0.2);
}

.khani-flyout__section {
  margin: 0;
  width: 100%;
  max-width: 22rem;
  text-align: center;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--khani-muted);
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.khani-flyout-home,
.khani-flyout-catalog {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 22rem;
  padding: 0.65rem 1rem;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--khani-fg);
}

.khani-flyout-home:hover,
.khani-flyout-catalog:hover {
  border-color: rgba(203, 160, 82, 0.45);
  color: var(--khani-gold);
}

.khani-flyout-catalog {
  margin-top: -0.35rem;
  border-color: rgba(203, 160, 82, 0.25);
  background: rgba(203, 160, 82, 0.06);
  color: var(--khani-gold);
}

.khani-flyout__grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
  max-width: 22rem;
}

.khani-flyout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--khani-fg);
  font-size: 0.875rem;
  text-decoration: none;
}

.khani-flyout-link:hover {
  border-color: rgba(203, 160, 82, 0.45);
  color: var(--khani-gold);
}

.khani-flyout-link--gold {
  border-color: rgba(203, 160, 82, 0.4);
  background: rgba(203, 160, 82, 0.1);
  color: var(--khani-gold);
}

.khani-flyout-checkout,
.khani-flyout-cart,
.khani-flyout-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 22rem;
  padding: 0.65rem 1rem;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0.5rem;
  box-sizing: border-box;
}

.khani-flyout-checkout {
  border: 1px solid rgba(245, 245, 245, 0.25);
  background: rgba(245, 245, 245, 0.05);
  color: var(--khani-fg);
}

.khani-flyout-checkout:hover {
  border-color: rgba(203, 160, 82, 0.5);
  background: rgba(203, 160, 82, 0.1);
}

.khani-flyout-cart {
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--khani-fg);
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.khani-flyout-cart:hover {
  border-color: rgba(203, 160, 82, 0.45);
  color: var(--khani-gold);
}

.khani-flyout-cta {
  border: 1px solid rgba(245, 245, 245, 0.2);
  color: var(--khani-fg);
  padding: 0.85rem;
}

.khani-flyout-cta:hover {
  background: var(--khani-fg);
  color: var(--khani-bg);
}

/* ─── Khani Shop-Footer (Marke konsistent, Links zur Haupt-URL) ─── */
.khani-footer-mount {
  margin-top: auto;
}

.khani-shop-footer {
  border-top: 1px solid var(--khani-border);
  background: var(--khani-bg);
  padding: 2.5rem clamp(1rem, 4vw, 2rem) 2rem;
  margin-top: 3rem;
}

.khani-shop-footer__inner {
  box-sizing: border-box;
  max-width: 80rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 2rem 2.5rem;
}

.khani-shop-footer__heading {
  margin: 0 0 0.85rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--khani-muted);
}

.khani-shop-footer__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.khani-shop-footer__list li {
  margin-bottom: 0.5rem;
}

.khani-shop-footer__list a {
  color: var(--khani-fg);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.khani-shop-footer__list a:hover {
  color: var(--khani-gold);
}

.khani-shop-footer__note {
  box-sizing: border-box;
  max-width: 80rem;
  margin: 1.75rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: var(--khani-muted);
  line-height: 1.5;
}

/* WordPress backend gateway */
.khani-backend-gateway {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 5vw, 4rem);
  background:
    radial-gradient(circle at 50% 0%, rgba(203, 160, 82, 0.16), transparent 28rem),
    linear-gradient(180deg, #0b0b0b 0%, #050505 100%);
  color: #f5f2ea;
  font-family: Inter, Arial, sans-serif;
}

.khani-backend-gateway__inner {
  width: min(100%, 34rem);
  display: grid;
  justify-items: center;
  gap: 1.35rem;
  padding: clamp(1.5rem, 5vw, 3rem);
  text-align: center;
  border: 1px solid rgba(203, 160, 82, 0.22);
  border-radius: 8px;
  background: rgba(12, 12, 12, 0.78);
  box-shadow: 0 1.25rem 4rem rgba(0, 0, 0, 0.32);
}

.khani-backend-gateway__brand {
  display: flex;
  justify-content: center;
}

.khani-backend-gateway__logo {
  display: block;
  width: min(16rem, 72vw);
  height: auto;
}

.khani-backend-gateway__wordmark {
  color: #f7f0df;
  font-size: clamp(1.6rem, 8vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.khani-backend-gateway__message {
  max-width: 26rem;
  margin: 0;
  color: rgba(245, 242, 234, 0.78);
  font-size: clamp(0.98rem, 2vw, 1.08rem);
  line-height: 1.6;
}

.khani-backend-gateway__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.75rem 1.35rem;
  border: 1px solid rgba(203, 160, 82, 0.65);
  border-radius: 8px;
  background: #cba052;
  color: #050505;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.khani-backend-gateway__button:hover,
.khani-backend-gateway__button:focus-visible {
  background: #e0bb72;
  border-color: #e0bb72;
  transform: translateY(-1px);
}

.khani-backend-gateway__button:focus-visible {
  outline: 2px solid #f5f2ea;
  outline-offset: 3px;
}

.khani-standalone-main {
  box-sizing: border-box;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}
