/* ═══════════════════════════════════════════════
   takeKONTROL — Header, drawer, footer and cart badge
   Shared by every page. A rule earns a place here by being
   byte-identical on at least 5 of the 7 pages.
   ═══════════════════════════════════════════════ */

.tesla-header .logo img { height: 35px; width: auto; margin-right: 12px; }

.drawer-header .logo { display: flex; align-items: center; font-weight: 700; font-size: 1.1rem; color: var(--text-heading); }

.drawer-header .logo img { height: 28px; width: auto; margin-right: 10px; }

.tesla-header nav { display: flex; gap: 8px; }

.tesla-header nav a:hover { background-color: rgba(128,128,128,0.2); }

.right-nav { display: flex; align-items: center; }

.controls-wrapper { display: flex; align-items: center; gap: 5px; margin-right: 20px; }

.lang-toggle:hover { background-color: rgba(128,128,128,0.2); }

.theme-toggle:hover { background-color: rgba(128,128,128,0.2); }

.theme-toggle svg { width: 20px; height: 20px; fill: currentColor; }

.cart-wrapper:hover { background-color: rgba(128,128,128,0.2); }

.account-wrapper {
    position: relative; display: flex; align-items: center; cursor: pointer; padding: 8px;
    border-radius: var(--radius-corp); transition: background var(--transition-speed) ease;
    margin-left: 5px; color: inherit;
}

.account-wrapper:hover { background-color: rgba(128,128,128,0.2); }

.cart-badge { position: absolute; top: 0px; right: 0px; background-color: var(--primary-red); color: #ffffff; font-size: 0.65rem; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: 0; transform: scale(0.5); transition: all 0.3s cubic-bezier(0.175,0.885,0.32,1.275); }

.cart-badge.active { opacity: 1; transform: scale(1); }

.mobile-toggle { display: none; background: none; border: none; color: inherit; cursor: pointer; padding: 8px; }

.desktop-only { display: inline-flex; }

.drawer-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1999; opacity: 0; visibility: hidden; transition: opacity 0.3s ease; }

.drawer-overlay.active { opacity: 1; visibility: visible; }

.mobile-drawer { position: fixed; top: 0; right: -100%; width: 320px; max-width: 85%; height: 100vh; background-color: var(--secondary-bg); z-index: 2000; box-shadow: -5px 0 25px rgba(0,0,0,0.5); transition: right 0.3s ease; display: flex; flex-direction: column; overflow-y: auto; }

.mobile-drawer.active { right: 0; }

.drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 24px 20px; border-bottom: 1px solid var(--border-color); }

.close-drawer { background: none; border: none; color: var(--text-heading); cursor: pointer; padding: 5px; }

.drawer-nav { display: flex; flex-direction: column; padding: 20px; }

.drawer-nav a { padding: 16px 0; color: var(--text-heading); font-size: 1.1rem; font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--border-color); transition: color 0.3s ease; }

.drawer-nav a:hover { color: var(--primary-red); }

.footer-grid { display: grid; grid-template-columns: 1.3fr 0.7fr 1fr; gap: 60px; margin-bottom: 60px; }

@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .footer-grid { grid-template-columns: 1fr; }
}

.footer-links-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.footer-links-list a { color: var(--text-heading); text-decoration: none; opacity: 0.85; transition: color var(--transition-speed) ease; }

.footer-links-list a:hover { opacity: 1; color: var(--primary-red); }

.footer-col h3 { color: var(--text-heading); margin-bottom: 20px; font-size: 1.5rem; }

.footer-col h4 { color: var(--text-heading); margin-bottom: 20px; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; }

.footer-col p { font-size: 1rem; margin-bottom: 15px; line-height: 1.8; }

.footer-form { display: flex; gap: 15px; margin-top: 30px; }

.footer-form input[type="email"] { flex: 1; padding: 14px 20px; border: 1px solid var(--border-color); border-radius: 50px; outline: none; font-size: 1rem; background: var(--card-bg); color: var(--text-main); transition: border var(--transition-speed) ease,background-color var(--transition-speed) ease,color var(--transition-speed) ease; }

.footer-form input[type="email"]:focus { border-color: var(--primary-red); }

.footer-contact-info { list-style: none; padding: 0; margin: 0; }

.footer-contact-info li { margin-bottom: 15px; display: flex; align-items: flex-start; gap: 10px; }

.footer-contact-info a { color: var(--text-heading); text-decoration: none; transition: color var(--transition-speed) ease; }

.footer-contact-info a:hover { color: var(--primary-red); }

.footer-bottom p { margin: 0; font-size: 0.85rem; }

/* ── New global footer (brand / shop / legal / service) ──────────
   Deliberately dark regardless of page theme — a distinct "footer
   band" like the reference — but built from our own red accent
   rather than the reference's maroon/orange. #footer id selector
   beats any page-specific `footer{...}` rule already loaded from a
   page's own stylesheet (chrome.css loads first; without the id bump
   those would win on source order). */
#footer {
    background: #1a0508; border-top: none; padding: 56px 0 0;
    color: rgba(255, 255, 255, 0.75); transition: background-color var(--transition-speed) ease;
}

[data-theme="dark"] #footer { background: #050101; }

.footer-grid-new { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }

@media (max-width: 900px) { .footer-grid-new { grid-template-columns: 1fr 1fr; } }

@media (max-width: 600px) { .footer-grid-new { grid-template-columns: 1fr; } }

.footer-brand-logo { font-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: 14px; letter-spacing: -0.01em; }

.footer-brand-logo span { color: var(--primary-red); }

.footer-brand-desc { font-size: 0.9rem; line-height: 1.7; color: rgba(255, 255, 255, 0.62); margin: 0 0 18px; max-width: 34ch; }

.footer-brand-company { font-weight: 700; color: #fff; margin: 0 0 4px; font-size: 0.88rem; }

.footer-brand-address { font-size: 0.85rem; color: rgba(255, 255, 255, 0.6); line-height: 1.7; margin: 0 0 18px; }

.footer-brand-address a { color: rgba(255, 255, 255, 0.8); text-decoration: none; }

.footer-brand-address a:hover { color: #fff; }

.pay-badges { display: flex; gap: 8px; flex-wrap: wrap; }

.pay-badge { display: inline-flex; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }

.pay-badge svg { display: block; }

.footer-col-new h4 {
    font-size: 0.72rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
    color: var(--primary-red); margin: 0 0 18px;
}

.footer-col-new ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }

.footer-col-new a { color: rgba(255, 255, 255, 0.75); text-decoration: none; font-size: 0.9rem; transition: color 0.2s ease; }

.footer-col-new a:hover { color: #fff; }

.footer-col-new a.is-accent { color: var(--primary-red); font-weight: 700; }

.footer-col-new a.is-accent:hover { color: #fff; }

.footer-bottom-new {
    border-top: 1px solid rgba(255, 255, 255, 0.12); padding: 20px 0; display: flex; flex-wrap: wrap;
    gap: 8px 26px; font-size: 0.78rem; color: rgba(255, 255, 255, 0.5);
}

.footer-bottom-new a { color: inherit; text-decoration: none; }

.footer-bottom-new a:hover { color: #fff; }

.tesla-header nav a { font-size: 0.9rem; font-weight: 500; padding: 8px 16px; border-radius: var(--radius-corp); transition: background var(--transition-speed) ease; }

/* ═══════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════ */

#tk-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

#tk-lightbox.open {
  display: flex;
  animation: lbFadeIn 0.2s ease;
}

@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#tk-lb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#tk-lb-img-wrap {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 900px);
  max-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#tk-lb-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 12px;
  transition: opacity 0.2s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  cursor: default;
}

#tk-lb-loader {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.tk-lb-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lbSpin 0.6s linear infinite;
}

@keyframes lbSpin {
  to { transform: rotate(360deg); }
}

/* Close button */
#tk-lb-close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

#tk-lb-close:hover { background: rgba(255,255,255,0.2); }

/* Prev / Next */
#tk-lb-prev,
#tk-lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

#tk-lb-prev { left: 20px; }
#tk-lb-next { right: 20px; }
#tk-lb-prev:hover, #tk-lb-next:hover { background: rgba(255,255,255,0.2); }

/* Counter */
#tk-lb-counter {
  position: relative;
  z-index: 1;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* Thumbnails */
#tk-lb-thumbnails {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 90vw;
}

.tk-lb-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.5;
  border: 2px solid transparent;
  transition: opacity 0.2s, border-color 0.2s;
}

.tk-lb-thumb:hover { opacity: 0.8; }
.tk-lb-thumb.active {
  opacity: 1;
  border-color: #fff;
}

/* Mobile tweaks */
@media (max-width: 768px) {
  #tk-lb-prev { left: 8px; width: 40px; height: 40px; }
  #tk-lb-next { right: 8px; width: 40px; height: 40px; }
  #tk-lb-close { top: 12px; right: 12px; }
  #tk-lb-img { border-radius: 8px; }
  .tk-lb-thumb { width: 48px; height: 48px; }
}
