/* Gallery page (/gallery) — in the shop's own tokens (tokens.css): Inter, red + navy, small radii. */
.gl-main [hidden] { display: none !important; }
.gl-preview-note { margin: 0 0 12px; padding: 10px 14px; background: #fff7e6; border: 1px solid #f0c36d; border-radius: var(--radius-md, 4px); color: #7a5300; font-size: var(--text-base, 0.875rem); }

.gl-hero {
  margin: 8px 0 36px;
  padding: 36px 32px;
  background: var(--color-navy, #2c3e50);
  color: var(--color-white, #fff);
  border-radius: var(--radius-md, 4px);
  border-top: 4px solid var(--color-primary, #d42f33);
  position: relative;
}
.gl-eyebrow {
  margin: 0 0 8px;
  font-size: var(--text-sm, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-border-accent, #e4beba);
}
.gl-title {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--color-white, #fff);
}
.gl-lede {
  max-width: 680px;
  margin: 0 0 24px;
  font-size: var(--text-md, 1rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
}

.gl-finder { position: relative; z-index: 1; max-width: 880px; }
.gl-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 14px;
  margin-bottom: 14px;
  background: var(--color-white, #fff);
  border: 2px solid transparent;
  border-radius: var(--radius-md, 4px);
  color: var(--color-text-muted, #64748b);
}
.gl-search:focus-within { border-color: var(--color-primary, #d42f33); }
.gl-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: var(--text-md, 1rem);
  color: var(--color-text, #191c1e);
}
.gl-search input::-webkit-search-cancel-button { display: none; }
.gl-search__clear {
  border: 0;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--color-text-muted, #64748b);
  cursor: pointer;
}

.gl-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.gl-step { display: flex; flex-direction: column; gap: 6px; }
.gl-step__label {
  font-size: var(--text-sm, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-border-accent, #e4beba);
}
.gl-step select {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, #e0e3e5);
  border-radius: var(--radius-md, 4px);
  font: inherit;
  font-size: var(--text-base, 0.875rem);
  color: var(--color-text, #191c1e);
}
.gl-step select:disabled { background: #e9edf1; color: var(--color-text-muted, #64748b); }
.gl-reset {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-white, #fff);
  font: inherit;
  font-size: var(--text-base, 0.875rem);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.gl-stats {
  margin: 20px 0 0;
  font-size: var(--text-base, 0.875rem);
  color: rgba(255, 255, 255, 0.75);
  position: relative;
  z-index: 1;
}
.gl-stats strong { color: var(--color-white, #fff); }
.gl-stats span { margin: 0 8px; color: var(--color-primary, #d42f33); }

/* Path, title and back button above each view */
.gl-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: var(--text-base, 0.875rem);
  color: var(--color-text-muted, #64748b);
}
.gl-crumb button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--color-primary, #d42f33);
  cursor: pointer;
}
.gl-crumb button:hover { text-decoration: underline; }
.gl-crumb__current { color: var(--color-navy, #2c3e50); font-weight: 600; }
.gl-head { margin-bottom: 20px; }
.gl-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin-bottom: 12px;
  padding: 0 14px;
  border: 1px solid var(--color-navy, #2c3e50);
  border-radius: var(--radius-md, 4px);
  background: transparent;
  font: inherit;
  font-size: var(--text-sm, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-navy, #2c3e50);
  cursor: pointer;
}
.gl-back:hover { background: var(--color-navy, #2c3e50); color: var(--color-white, #fff); }
.gl-head__title { margin: 0 0 6px; font-size: var(--text-2xl, 1.5rem); font-weight: 800; color: var(--color-text, #191c1e); }
.gl-head__sub { margin: 0; color: var(--color-text-muted, #64748b); line-height: 1.6; }

/* Brand / model cards */
.gl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.gl-card {
  display: flex;
  flex-direction: column;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, #e0e3e5);
  border-radius: var(--radius-md, 4px);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.gl-card:hover { border-color: var(--color-primary, #d42f33); box-shadow: 0 8px 24px rgba(44, 62, 80, 0.12); transform: translateY(-2px); }
.gl-card__cover { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--color-bg-alt, #f2f4f6); }
.gl-card__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s; }
.gl-card:hover .gl-card__cover img { transform: scale(1.04); }
.gl-card__count {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 10px;
  min-width: 30px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--color-primary, #d42f33);
  color: var(--color-white, #fff);
  font-size: var(--text-sm, 0.75rem);
  font-weight: 700;
  text-align: center;
}
.gl-card__more {
  position: absolute;
  inset-block-end: 10px;
  inset-inline-end: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-md, 4px);
  background: rgba(44, 62, 80, 0.88);
  color: var(--color-white, #fff);
  font-size: var(--text-sm, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.gl-card__label { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.gl-card__name { font-weight: 800; font-size: var(--text-md, 1rem); color: var(--color-navy, #2c3e50); letter-spacing: 0.02em; }
.gl-card__detail { font-size: var(--text-base, 0.875rem); color: var(--color-text-muted, #64748b); }

/* Search results */
.gl-results { display: grid; gap: 10px; }
.gl-result {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, #e0e3e5);
  border-radius: var(--radius-md, 4px);
  text-align: start;
  font: inherit;
  cursor: pointer;
}
.gl-result:hover { border-color: var(--color-primary, #d42f33); }
.gl-result img { width: 84px; height: 64px; object-fit: cover; border-radius: var(--radius-md, 4px); flex: none; background: var(--color-bg-alt, #f2f4f6); }
.gl-result > span { display: flex; flex-direction: column; gap: 4px; }
.gl-result__name { font-weight: 700; color: var(--color-navy, #2c3e50); }
.gl-result__sub { font-size: var(--text-base, 0.875rem); color: var(--color-text-muted, #64748b); }
.gl-empty { padding: 24px; background: var(--color-white, #fff); border: 1px dashed var(--color-border-light, #d8dadc); border-radius: var(--radius-md, 4px); color: var(--color-text-muted, #64748b); }

/* Photos of one car */
.gl-photos { columns: 3 260px; column-gap: 14px; }
.gl-photo {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  border: 1px solid var(--color-border, #e0e3e5);
  border-radius: var(--radius-md, 4px);
  background: var(--color-bg-alt, #f2f4f6);
  overflow: hidden;
  cursor: zoom-in;
  break-inside: avoid;
}
.gl-photo img { display: block; width: 100%; height: auto; transition: transform 0.25s; }
.gl-photo:hover img { transform: scale(1.03); }

.gl-parts { margin-top: 28px; }
.gl-parts__title, .gl-order__title { margin: 0 0 12px; font-size: var(--text-xl, 1.25rem); font-weight: 800; color: var(--color-text, #191c1e); }
.gl-parts__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gl-part {
  display: flex;
  flex-direction: column;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, #e0e3e5);
  border-radius: var(--radius-md, 4px);
  overflow: hidden;
  text-decoration: none;
  color: var(--color-navy, #2c3e50);
}
.gl-part:hover { border-color: var(--color-primary, #d42f33); }
.gl-part__img { display: block; aspect-ratio: 1; background: var(--color-white, #fff); }
.gl-part__img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gl-part__name { padding: 10px 12px 12px; font-size: var(--text-base, 0.875rem); font-weight: 600; line-height: 1.4; }

.gl-order {
  margin-top: 32px;
  padding: 28px;
  background: var(--color-bg-alt, #f2f4f6);
  border-inline-start: 4px solid var(--color-primary, #d42f33);
  border-radius: var(--radius-md, 4px);
}
.gl-order__text { margin: 0 0 18px; color: var(--color-text-muted, #64748b); }
.gl-order__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.gl-order__actions .btn { min-height: var(--btn-height-md, 48px); padding: 0 24px; font-size: var(--text-base, 0.875rem); text-decoration: none; }
.gl-order__wa { background: #1f9d55; border: 2px solid #1f9d55; color: var(--color-white, #fff); }
.gl-order__wa:hover { background: #17834a; border-color: #17834a; }

/* Photo viewer */
.gl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: rgba(16, 24, 32, 0.96);
  color: var(--color-white, #fff);
}
.gl-lightbox__top, .gl-lightbox__bottom { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.gl-lightbox__title { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-lightbox__count { font-size: var(--text-base, 0.875rem); color: rgba(255, 255, 255, 0.7); }
.gl-lightbox__btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.gl-lightbox__stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 56px; }
.gl-lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-md, 4px); }
.gl-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.gl-lightbox__nav:hover, .gl-lightbox__btn:hover { background: var(--color-primary, #d42f33); }
.gl-lightbox__nav--prev { inset-inline-start: 6px; }
.gl-lightbox__nav--next { inset-inline-end: 6px; }
[dir="rtl"] .gl-lightbox__nav { transform: translateY(-50%) scaleX(-1); }
.gl-lightbox__bottom { justify-content: center; }
.gl-lightbox__link { color: rgba(255, 255, 255, 0.85); font-size: var(--text-base, 0.875rem); }

@media (max-width: 768px) {
  .gl-hero { padding: 24px 18px; margin-bottom: 28px; }
  .gl-steps { grid-template-columns: 1fr; }
  .gl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gl-card__label { padding: 10px; }
  .gl-card__name { font-size: var(--text-base, 0.875rem); }
  .gl-card__detail { font-size: var(--text-sm, 0.75rem); }
  .gl-photos { columns: 2; column-gap: 8px; }
  .gl-photo { margin-bottom: 8px; }
  .gl-order { padding: 20px; }
  .gl-order__actions .btn { flex: 1 1 100%; }
  .gl-lightbox__stage { padding: 0 8px; }
  .gl-lightbox__nav { width: 40px; height: 40px; font-size: 26px; background: rgba(0, 0, 0, 0.45); }
}
