/* ==========================================================================
   MyHomeScout V2 – Ergaenzungen fuer die V1-Technik
   (Sprachwahl, Warenkorb, Konto-Button, Formular-Pruefung, Cookie-Banner,
   Modale ausserhalb von .bs, RTL)
   ========================================================================== */

/* Kopf: Sprachwahl, Warenkorb, Konto ------------------------------------- */
.header-tools { display: flex; align-items: center; gap: 6px; }
.lang-switch { position: relative; }
.lang-switch > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line-2); background: #fff; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch img { width: 18px; height: 12px; border-radius: 2px; display: inline-block; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); padding: 6px; min-width: 120px; display: flex; flex-direction: column; }
.lang-menu a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.lang-menu a:hover, .lang-menu a[aria-current="true"] { background: var(--bg-2); color: var(--blue); }
html[dir="rtl"] .lang-menu { right: auto; left: 0; }

.cart-link { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink); text-decoration: none; }
.cart-link:hover { background: var(--bg-2); color: var(--blue); }
.cart-badge { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cart-badge.d-none { display: none !important; }

.burger-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.burger-tools .lang-switch > summary { min-height: 40px; }


/* Hilfsklassen aus V1, die in V2-Seiten weiter genutzt werden ------------ */
.d-none { display: none !important; }
.text-center { text-align: center; }
.w-100 { width: 100%; }
.alert-danger { background: var(--error-bg); color: var(--error); }
.alert-success { background: var(--ok-bg); color: #1F3A12; }
.alert-warning { background: #FFF7E0; color: #6B4E00; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

/* form_validate.js (V1) */
.is-invalid { border-color: var(--error) !important; background: var(--error-bg) !important; }
.invalid-feedback { display: block; margin: 2px 0 0; font-size: 14px; font-weight: 500; color: var(--error); }
.invalid-feedback:empty { display: none; }
.pw-strength, .password-strength { margin-top: 6px; }
.field .input-icon { position: relative; display: block; }
.field .toggle-password, .toggle-password { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; }
html[dir="rtl"] .toggle-password { right: auto; left: 14px; }

/* reCAPTCHA-/Captcha-Bereich */
.captcha-box { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.captcha-box img { border-radius: 10px; border: 1px solid var(--line-2); }

/* Rechtstexte (dsvgo-texte) */
.legal-text h1, .legal-text h2, .legal-text h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; margin: 32px 0 12px; line-height: 1.15; }
.legal-text h1 { font-size: 30px; }
.legal-text h2 { font-size: 24px; }
.legal-text h3 { font-size: 19px; }
.legal-text p, .legal-text ul, .legal-text ol { margin: 0 0 14px; color: var(--ink-2); line-height: 1.75; }
.legal-text a { overflow-wrap: anywhere; }
.legal-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 48px); }

/* Modale: liegen im Footer in <div class="bs bs-modals"> (Bootstrap-CSS) */
.bs.bs-modals { padding: 0 !important; }
.modal-backdrop.show { opacity: .55; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Cookie-Banner (partials/cookie_banner.php) im V2-Stil ------------------- */
body.v2 #mhsCc { border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--shadow); font-family: var(--font); color: var(--ink); padding: 24px; }
body.v2 #mhsCc h5 { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
body.v2 #mhsCc p { color: var(--ink-2); font-size: 14px; }
body.v2 #mhsCc a { color: var(--blue); }
body.v2 #mhsCc .mhs-cc-btn { border-radius: 999px; min-height: 46px; font-size: 15px; }
body.v2 #mhsCc .mhs-cc-accept { background: var(--blue); }
body.v2 #mhsCc .mhs-cc-reject { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
body.v2 #mhsCc .mhs-cc-row { border-color: var(--line); }

/* Pakete (Daten aus der DB) ---------------------------------------------- */
.plan .plan-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 15px; line-height: 1.4; }
.plan .plan-features li { display: flex; gap: 10px; align-items: flex-start; }
.plan .plan-features svg { flex: 0 0 auto; margin-top: 2px; color: var(--blue); }
.plan-featured .plan-features svg { color: var(--lime); }
.plan .plan-features .off { opacity: .5; }
.plan .qty { display: inline-flex; align-items: center; gap: 8px; }
.plan .qty button { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line-2); background: #fff; font-size: 18px; font-weight: 700; cursor: pointer; }
.plan-featured .qty button { background: var(--navy-3); color: #fff; border-color: var(--navy-3); }
.plan .in-cart { font-size: 13px; font-weight: 600; color: var(--blue); }
.plan-featured .in-cart { color: var(--lime); }

/* Arabisch (RTL) ---------------------------------------------------------- */
html[dir="rtl"] body.v2 { font-family: Cairo, "Noto Kufi Arabic", Tajawal, var(--font); }
html[dir="rtl"] .burger-panel { text-align: right; }
html[dir="rtl"] .checklist li, html[dir="rtl"] .plan .plan-features li { text-align: right; }

/* Passwort-Staerke und -Kriterien (form_validate.js) */
.password-strength { margin-top: 6px; }
.password-strength .strength-bar { width: 0; height: 6px; border-radius: 3px; background-color: var(--error); transition: width .3s ease, background-color .3s ease; }
.password-strength .strength-label { font-size: 13px; margin-top: 4px; display: block; font-weight: 500; }
.password-criteria { list-style: none; padding: 0; margin: 6px 0 0; font-size: 13px; font-weight: 500; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .3s ease, opacity .3s ease; }
.password-criteria.show { max-height: 200px; opacity: 1; }
.field .input-group { position: relative; display: block; }
.field .input-group input { padding-right: 52px; }
.field .input-group .toggle-password { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--muted); cursor: pointer; }
.field .input-group .toggle-password:hover { background: var(--bg-2); color: var(--ink); }
html[dir="rtl"] .field .input-group input { padding-right: 16px; padding-left: 52px; }
html[dir="rtl"] .field .input-group .toggle-password { right: auto; left: 6px; }
.field .form-text, .field small.hint { font-weight: 400; font-size: 14px; color: var(--muted); }
.form-section-title { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.plz-suggest { background: #fff !important; border: 1px solid var(--line-2) !important; border-radius: var(--r-sm) !important; box-shadow: var(--shadow) !important; font-size: 15px; }

/* Pakete: Warenkorb-Knoepfe (cart.js schaltet js-add / js-remove) */
.v2-cart-btn { margin-top: auto; }
.v2-cart-btn.js-add { background: var(--blue); color: #fff; border-color: var(--blue); }
.v2-cart-btn.js-add:hover { background: var(--blue-d); color: #fff; }
.plan-featured .v2-cart-btn.js-add { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.v2-cart-btn.js-remove { background: transparent; color: var(--ink); border-color: var(--ink); }
.v2-cart-btn.js-remove::before { content: "✓"; font-weight: 700; }
.plan-featured .v2-cart-btn.js-remove { color: #fff; border-color: #fff; }
.starter .v2-cart-btn.js-add, .starter .v2-cart-btn.js-remove { background: var(--ink); color: #fff; border-color: var(--ink); }
.v2-cart-state { margin-top: auto; background: var(--ok-bg); color: #1F3A12; cursor: default; }
.v2-cart-state.is-off { background: var(--bg-2); color: var(--muted); }
.plan.is-selected { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue) inset; }
.plan-featured.is-selected { box-shadow: 0 0 0 3px var(--lime) inset; }
.plan .alert { margin: 0; }
.hint-text { display: block; font-size: 13px; font-weight: 600; color: #6B4E00; background: #FFF7E0; border-radius: 10px; padding: 8px 10px; }
.hint-text:empty, .hint-text.hint-hidden { display: none; }
[id^="cartMessages_"]:empty { display: none; }

.v2-sticky { position: sticky; bottom: 0; z-index: 40; background: var(--ink); color: #F7F7F2; margin-top: 8px; box-shadow: 0 -8px 24px rgba(14, 26, 43, .15); }
.v2-sticky-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.v2-sticky-total { font-family: var(--display); font-weight: 800; font-size: 24px; margin-right: 8px; }
.mhs-sticky-btn.disabled { opacity: .45; pointer-events: none; }

/* Kopf mit Sprachwahl und Warenkorb braucht etwas mehr Breite als V2
   allein - Burger-Menue deshalb schon unter 1240px. */
.nav-desktop a { white-space: nowrap; }
@media (max-width: 1240px) {
  .nav-desktop, .header-actions { display: none; }
  .burger { display: block; }
  .header-mobile { display: flex; align-items: center; gap: 4px; }
}
@media (min-width: 1241px) {
  .header-mobile { display: none; }
}
@media (min-width: 1241px) and (max-width: 1340px) {
  .nav-desktop { gap: 18px; }
}
/* RTL: links ausgelagerte Elemente vergroessern sonst die Seite seitlich */
html[dir="rtl"] .hp { left: auto; right: -9999px; }
html[dir="rtl"] .skip { left: auto; right: 16px; }
html[dir="rtl"] body { overflow-x: hidden; }

/* Burger-Menue: Sprache + Konto oben, Fusslinks in Gruppen */
.burger-top { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.burger-top .burger-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.burger-top .burger-cta .btn { min-height: 48px; padding: 0 12px; font-size: 15px; }
.burger-top .lang-switch { align-self: flex-start; }
.burger-groups { display: flex; flex-direction: column; gap: 18px; }
.burger-groups h2 { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 2px; }
.burger-groups .burger-more a { min-height: 38px; }
@media (max-width: 360px) { .burger-top .burger-cta { grid-template-columns: 1fr; } }

/* Burger-Menue: Fussbereich (gleicher Inhalt wie der Seitenfuss) */
.burger-footer { border-radius: var(--r); overflow: hidden; flex: 0 0 auto; }
.burger-footer .container { padding-left: 20px; padding-right: 20px; }
.burger-footer .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; padding-top: 28px; padding-bottom: 18px; font-size: 15px; }
.burger-footer .footer-brand { grid-column: 1 / -1; gap: 10px; }
.burger-footer .footer-brand img { width: 190px; height: auto; }
.burger-footer .footer-grid a, .burger-footer .footer-grid .link-button { min-height: 32px; }
.burger-footer .footer-bottom { padding-top: 14px; padding-bottom: 18px; }
@media (max-width: 340px) { .burger-footer .footer-grid { grid-template-columns: 1fr; } }

/* Inhaltsverzeichnis (Rechtstexte): Nummer oben buendig zur ersten
   Zeile, auch bei umbrechenden Titeln */
.toc ol { list-style: none; padding-left: 0; counter-reset: toc; }
.toc li { counter-increment: toc; display: grid; grid-template-columns: 2.1em 1fr; align-items: start; }
.toc li::before { content: counter(toc) "."; color: var(--ink-2); font-size: 14px; line-height: 1.5; padding: 3px 0; text-align: right; padding-right: .45em; font-variant-numeric: tabular-nums; }
.toc li a { display: block; line-height: 1.5; }
html[dir="rtl"] .toc li::before { text-align: left; padding-right: 0; padding-left: .45em; }

/* Auth-Seiten: Ueberschrift auf Desktop einzeilig, darf breiter als die Karte sein */
@media (min-width: 700px) { .auth .auth-title-1line { white-space: nowrap; margin-left: -200px; margin-right: -200px; } }
/* Kompakte Auth-Seite: passt bei 100 % ohne Scrollen auf den Bildschirm */
.section.auth-compact { padding-top: 28px; padding-bottom: 40px; }
.auth-compact .stack.center { gap: 8px !important; margin-bottom: 20px !important; }
.auth-compact .icon-tile { width: 44px !important; height: 44px !important; }
.auth-compact .card-lg { padding: 28px 32px; }
.auth-compact .card-lg h2 { margin-bottom: 12px; }
@media (min-width: 1000px) { .auth-compact .auth-lead-wide { max-width: none; white-space: nowrap; margin-left: -200px !important; margin-right: -200px !important; } }
/* Leere Passwort-Staerkeanzeige nimmt keinen Platz ein, bis getippt wird */
.password-strength:has(.strength-label:empty) { display: none; }
.password-criteria:not(.show) { margin-top: 0; }
.auth-compact .form { gap: 14px; }
.auth-compact .alert { padding: 10px 14px; font-size: 14px; }