/* ==========================================================================
   ALWIDOR — shared custom CSS
   Tailwind is loaded via the Play CDN (see each page's <head>) and covers
   almost all styling through utility classes. This file only holds the
   handful of things utility classes can't express: glassmorphism blur,
   gradient text, mega-menu open/close transitions, the product gallery,
   and print rules for the logo.
   ========================================================================== */

/* Background behind every product photo (cards, product-page gallery,
   thumbnails, "what's in the set" strip). Change this ONE colour to restyle
   them all. Transparent PNG photos show this colour through.
   #020617 = near-black navy (same as the page). Try #000000 for pure black,
   or #0f172a for the lighter navy the gallery used before. */
:root { --photo-bg: #020617; }
.photo-bg { background-color: var(--photo-bg); }

body { font-family: 'Inter', sans-serif; }

.glass-nav {
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Mega menu --- */
.mega-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.has-mega-menu:hover .mega-menu,
.has-mega-menu.is-open .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Scroll progress bar --- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  width: 0%; z-index: 999; transition: width 0.1s linear;
}

/* --- Product gallery --- */
.gallery-main {
  aspect-ratio: 3 / 4;
  overflow: hidden;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb {
  background-color: var(--photo-bg);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.gallery-thumb.is-active { opacity: 1; border-color: #38bdf8; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* --- Gallery prev/next arrows (desktop click, also usable on touch) --- */
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
  backdrop-filter: blur(4px);
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.gallery-nav:hover { background: rgba(14, 165, 233, 0.35); border-color: rgba(56, 189, 248, 0.6); }
.gallery-nav:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.gallery-nav--prev { left: 0.75rem; }
.gallery-nav--next { right: 0.75rem; }
@media (max-width: 639px) {
  .gallery-nav { width: 2.25rem; height: 2.25rem; }
}

/* --- Video embed, responsive 16:9 --- */
.video-embed { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.video-embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* --- Language switch pill --- */
.lang-switch a {
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 9999px;
  color: #94a3b8;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.lang-switch a.is-active {
  color: #020617;
  background: #38bdf8;
}
.lang-switch a:not(.is-active):hover { color: #e2e8f0; }

/* --- Print: logo must render even if a print stylesheet elsewhere hides images --- */
@media print {
  img.brand-logo { display: inline-block !important; }
  .no-print { display: none !important; }
}

/* --- Selectable option / spare-part boxes on machine pages ---------------
   A checkbox on the left: empty rounded square; when selected it fills and
   shows a tick. State lives in aria-checked (toggled by initOptionPicker()
   in main.js). */
.opt-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.9rem 1rem;
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.35;
  color: #cbd5e1;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.opt-item:hover { border-color: rgba(14, 165, 233, 0.55); }
.opt-item:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.opt-item .opt-check {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.4rem;          /* square with rounded corners */
  border: 2px solid #475569;
  background: transparent;
  color: #020617;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.opt-item:hover .opt-check { border-color: #38bdf8; }
.opt-item .opt-check svg {
  width: 0.95rem;
  height: 0.95rem;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.opt-item[aria-checked="true"] {
  color: #fff;
  border-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.08);
}
.opt-item[aria-checked="true"] .opt-check {
  background: #38bdf8;
  border-color: #38bdf8;
}
.opt-item[aria-checked="true"] .opt-check svg {
  opacity: 1;
  transform: scale(1);
}
.opt-hint { transition: color 0.15s ease; }
.opt-hint.is-active { color: #38bdf8; }
