/* ==========================================================================
   components.css — glass cards, USP popover, configurator sheet,
   merkliste, full-catalogue table, overlays.
   ========================================================================== */

/* ============================ GLASS CARD ============================ */
.glass-card {
  position: relative;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--r-md);
  padding: 16px 16px 14px;
  display: flex; flex-direction: column;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.glass-card:hover { box-shadow: var(--shadow); }
.glass-card.is-open { box-shadow: var(--shadow); border-color: var(--border); }
.glass-card--bestseller { border-color: var(--gold-border); }
.glass-card__badge {
  position: absolute; top: -11px; left: 16px;
}
.glass-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.glass-card__name {
  font-size: 0.92rem; font-weight: 600; color: var(--text); line-height: 1.3;
}
.glass-card__tags { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.64rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--text-muted); background: var(--cream);
  border: 1px solid var(--border-soft);
  padding: 3px 9px; border-radius: var(--r-pill);
}
.chip svg { width: 11px; height: 11px; }
.chip--photo { color: #b07400; background: var(--apricot-bg); border-color: #f3e3c0; }

.info-btn {
  width: 24px; height: 24px; flex-shrink: 0;
  border: 1.5px solid var(--border); border-radius: 50%;
  color: var(--text-muted); background: var(--surface);
  font-size: 0.78rem; font-weight: 700; font-family: var(--font-serif);
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.info-btn:hover { border-color: var(--text); color: var(--white); background: var(--navy); }

.glass-card__price {
  margin-top: 12px;
  font-size: 1.15rem; font-weight: 700; color: var(--text);
  display: flex; align-items: baseline; gap: 8px;
}
.glass-card__price .from { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; }

/* Index dropdown — margin-top:auto pins it to the card bottom, so the index
   rows and upgrade buttons align across a row of equal-height cards even when
   headers differ (chips, two-line names). */
.index-list {
  display: none; flex-direction: column; gap: 6px;
  margin-top: auto; padding-top: 13px;
  border-top: 1px solid var(--border-soft);
}
.glass-card.is-open .glass-card__price { margin-bottom: 13px; }
.glass-card.is-open .index-list { display: flex; }
.index-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--cream); border-radius: var(--r-sm);
  padding: 8px 8px 8px 14px;
  transition: background var(--t-fast);
}
.index-row:hover { background: var(--cream-2); }
.index-row__idx { font-weight: 700; color: var(--text); font-size: 0.9rem; }
.index-row__price { color: var(--text-body); font-size: 0.88rem; margin-left: auto; }

/* Upgrade row below the index prices — same width as the index rows */
.index-upgrade {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  margin-top: 2px; padding: 8px 8px 8px 14px;
  background: var(--apricot-bg);
  border: 1.5px solid var(--gold-border); border-radius: var(--r-sm);
  transition: background var(--t-fast);
}
.index-upgrade:hover { background: var(--apricot-bg-strong); }
.index-upgrade__main { display: flex; flex-direction: column; min-width: 0; }
.index-upgrade__label { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.index-upgrade__sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }
.index-upgrade__price {
  margin-left: auto; white-space: nowrap;
  font-size: 0.82rem; font-weight: 700; color: #b07400;
}
[data-theme="dark"] .index-upgrade__price { color: var(--apricot-soft); }
.index-upgrade__arrow {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--apricot); color: var(--white);
  display: flex; align-items: center; justify-content: center;
}
.index-upgrade__arrow svg { width: 13px; height: 13px; }
.index-row__cta {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--navy); color: var(--white);
  font-size: 0.74rem; font-weight: 600;
  padding: 7px 13px; border-radius: var(--r-pill);
}
.index-row__cta svg { width: 12px; height: 12px; }

/* ============================ OVERLAYS ============================ */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(17, 40, 64, 0.42);
  display: none; opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}
.overlay.is-open { display: flex; opacity: 1; }
.overlay--center { align-items: center; justify-content: center; padding: 20px; }
.overlay--sheet { align-items: flex-end; justify-content: center; }
.overlay--top { align-items: flex-start; justify-content: center; padding: clamp(20px, 6vh, 70px) 16px; overflow-y: auto; }

@keyframes sheetUp { from { transform: translateY(28px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ============================ USP POPOVER ============================ */
.usp-box {
  background: var(--navy); color: var(--white);
  border-radius: var(--r-md); padding: 26px;
  width: min(420px, 100%); box-shadow: var(--shadow-lg);
  animation: pop var(--t-base) var(--ease);
}
.usp-box__title { font-size: 1.05rem; font-weight: 700; margin-bottom: 16px; padding-right: 30px; }
.usp-box__list { display: flex; flex-direction: column; gap: 12px; }
.usp-box__list li { display: flex; gap: 11px; font-size: 0.9rem; line-height: 1.4; opacity: 0.95; }
.usp-box__list li svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; color: var(--apricot-soft); }
/* grouped Kundennutzen: "Glasdesign" / "Beschichtung" + footnote small print */
.usp-box__group {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  opacity: 0.7; margin: 18px 0 10px;
}
.usp-box__title + .usp-box__group { margin-top: 0; }
.usp-box__note { margin-top: 12px; font-size: 0.72rem; line-height: 1.4; opacity: 0.7; }
.usp-box__close {
  margin-top: 22px; width: 100%;
  background: rgba(255,255,255,0.14); color: var(--white);
  border-radius: var(--r-pill); padding: 12px; font-weight: 600;
}
.usp-box__close:hover { background: rgba(255,255,255,0.24); }

/* ============================ CONFIRM DIALOG ============================ */
.confirm-box {
  background: var(--surface); color: var(--text);
  border-radius: var(--r-md); padding: 26px;
  width: min(400px, 100%); box-shadow: var(--shadow-lg);
  animation: pop var(--t-base) var(--ease);
}
.confirm-box__title { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.confirm-box__text { font-size: 0.9rem; line-height: 1.5; color: var(--text-body); }
.confirm-box__btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 22px; }
.confirm-box__btns .btn { padding: 11px 20px; }

/* ============================ IMAGE VIEWER ============================ */
/* Full-screen artwork (Einstieg step). Darker backdrop than the other
   overlays — the image is the only thing to look at. */
.overlay--viewer { background: rgba(8, 18, 30, 0.88); }
.viewer {
  position: relative; margin: 0; max-width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  cursor: zoom-out;
  animation: pop var(--t-base) var(--ease);
}
.viewer__img {
  width: auto; height: auto; max-width: 100%;
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);   /* mobile browser bars */
  border-radius: var(--r-md); background: var(--white);
  box-shadow: var(--shadow-lg);
}
.viewer__cap { color: var(--white); font-size: 0.9rem; font-weight: 600; text-align: center; }
.viewer__close {
  position: absolute; top: 10px; right: 10px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(17, 40, 64, 0.78); color: var(--white);
  display: flex; align-items: center; justify-content: center;
}
.viewer__close:hover { background: var(--navy); }
.viewer__close svg { width: 16px; height: 16px; }

/* ============================ CONFIGURATOR SHEET ============================ */
.config {
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  width: min(720px, 100%); max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: sheetUp var(--t-base) var(--ease);
}
.config__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px clamp(16px, 3vw, 26px) 14px;
  border-bottom: 1px solid var(--border-soft);
}
.breadcrumb { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.breadcrumb__chip {
  background: var(--cream-2); color: var(--text);
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 5px 11px; border-radius: var(--r-pill);
}
.breadcrumb__sep { color: var(--text-muted); }
.config__close, .sheet-close {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%; background: var(--cream-2); color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.config__close:hover, .sheet-close:hover { background: var(--border); }
.config__close svg, .sheet-close svg { width: 15px; height: 15px; }

.config__body {
  padding: 18px clamp(16px, 3vw, 26px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.config__title { font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: 16px; }

/* Fixed line hint (stock lenses: "Lagerglas – nur in bestimmten Stärken
   lieferbar") — glass list, configurator, Merkliste; the table has its own. */
.line__hint, .config__hint, .merk-card__hint {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.8rem; line-height: 1.35; color: var(--text-body);
}
.line__hint svg, .config__hint svg, .merk-card__hint svg {
  width: 17px; height: 17px; flex-shrink: 0;
  border: 1.5px solid var(--apricot); border-radius: 50%; color: var(--apricot);
}
.line__hint { margin: -6px 0 14px; }
.config__hint { margin: -8px 0 16px; }
.merk-card__hint { font-size: 0.74rem; margin: -4px 0 10px; }
/* row colour of .row-line (AA contrast in both themes), just lighter weight */
.gltable__hint { margin-left: 8px; font-weight: 500; color: inherit; }

.config__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.addon-sec {
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  padding: 14px 16px;
}
.addon-sec--base { grid-column: 1 / -1; background: var(--cream); border-color: var(--border-soft); }
.addon-sec__title {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 12px;
}
.addon-sec__title svg { width: 16px; height: 16px; color: var(--text); }
.addon-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border-soft);
}
.addon-row:last-child { border-bottom: none; }
.addon-row__name { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.addon-row__right { display: flex; align-items: center; gap: 12px; }
.addon-row__price { font-size: 0.9rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.addon-row__price--muted { color: var(--text-muted); }
.addon-row__check { color: var(--green); display: flex; }
.addon-row__check svg { width: 19px; height: 19px; }
/* Kundennutzen sublines (inline mode) + the small "i" per row.
   The sublines are the feature's payload → body colour (AA contrast on the
   cream/white surfaces in light mode), not the muted label colour. */
.addon-row__label { display: inline-flex; align-items: center; gap: 7px; }
.addon-row__desc {
  display: block; margin-top: 2px;
  font-size: 0.74rem; font-weight: 400; line-height: 1.35; color: var(--text-body, var(--text));
}
.addon-sec__desc { padding: 8px 0 2px; font-size: 0.76rem; line-height: 1.45; color: var(--text-body, var(--text)); }
/* footnote of a starred index bullet ("UV400-Schutz*") — same colour as the
   text above for contrast, only smaller */
.addon-sec__note { padding: 2px 0 2px; font-size: 0.7rem; line-height: 1.4; color: var(--text-body, var(--text)); }
.addon-row__desc.is-hidden { display: none; }
.addon-sec--base .addon-row { border-bottom: none; }   /* no rule between row and its desc */
/* visually 18px, but a 36px hit area — the only route to the texts in "nur über i" mode */
.info-btn--sm { position: relative; width: 18px; height: 18px; border-width: 1px; }
.info-btn--sm::before { content: ''; position: absolute; inset: -9px; }
.info-btn--sm svg { width: 10px; height: 10px; }

.upgrade {
  margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 2px solid var(--gold-border); border-radius: var(--r-md);
  background: var(--apricot-bg); padding: 14px 16px;
  transition: background var(--t-fast);
}
.upgrade:hover { background: var(--apricot-bg-strong); }
.upgrade__label { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.upgrade__sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.upgrade__right { display: flex; align-items: center; gap: 12px; }
.upgrade__price { font-size: 0.95rem; font-weight: 700; color: #b07400; white-space: nowrap; }
.upgrade__arrow {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--apricot); color: var(--white);
  display: flex; align-items: center; justify-content: center;
}
.upgrade__arrow svg { width: 16px; height: 16px; }

.config__cta {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--navy); color: var(--white);
  margin-top: 4px; padding: 16px clamp(16px, 3vw, 26px);
  padding-bottom: calc(16px + var(--safe-bottom, 0px));
  transition: background var(--t-fast);
}
.config__cta:hover { background: var(--navy-light); }
.config__cta-label { font-size: 0.76rem; color: rgba(255,255,255,0.72); }
.config__cta-price { font-size: 1.6rem; font-weight: 700; }
.config__cta-note { font-size: 0.72rem; color: var(--apricot-soft); margin-top: 2px; }
.config__cta-note[hidden] { display: none; }
.config__cta-heart {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: var(--apricot); color: var(--white);
  display: flex; align-items: center; justify-content: center;
}
.config__cta-heart svg { width: 22px; height: 22px; }
.config__cta-heart:active { transform: scale(0.9); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 90px;
  z-index: 500; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: var(--white);
  padding: 13px 22px; border-radius: var(--r-pill);
  font-size: 0.88rem; font-weight: 600; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 9px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base), transform var(--t-base);
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 17px; height: 17px; color: var(--apricot-soft); }

/* ============================ MERKLISTE ============================ */
.merk {
  background: var(--ice);
  border-radius: var(--r-lg);
  width: min(760px, 100%); max-height: 86vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pop var(--t-base) var(--ease);
}
.merk__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
}
.merk__title { font-family: var(--font-serif); font-size: 1.3rem; color: var(--text); display: flex; align-items: center; gap: 10px; }
.merk__title svg { width: 22px; height: 22px; color: var(--apricot); }
/* own close style: .close-light (white) is invisible on the light-blue header */
.merk__close {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(27, 58, 92, 0.10); color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.merk__close:hover { background: rgba(27, 58, 92, 0.18); }
.merk__close svg { width: 15px; height: 15px; }
.merk__body {
  padding: 0 18px 22px; overflow-y: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: start;
}
.merk-card {
  position: relative; background: var(--surface);
  border-radius: var(--r-md); padding: 18px;
}
.merk-card__tag {
  display: inline-block; margin-bottom: 8px;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text); background: var(--ice); border: 1px solid #d4e3f3;
  padding: 3px 9px; border-radius: var(--r-pill);
}
.merk-card__name { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 4px; padding-right: 24px; }
.merk-card__line { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 10px; }
.merk-card__detail { display: flex; align-items: center; gap: 7px; font-size: 0.78rem; color: var(--text-body); margin-bottom: 5px; }
.merk-card__detail svg { width: 13px; height: 13px; color: var(--text); flex-shrink: 0; }
.merk-card__price { font-size: 1.35rem; font-weight: 700; color: var(--apricot); margin-top: 12px; }
.merk-card__remove {
  position: absolute; top: 14px; right: 14px;
  color: var(--apricot); width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
}
.merk-card__remove svg { width: 20px; height: 20px; }
.merk-empty {
  grid-column: 1 / -1; text-align: center; color: var(--text-muted);
  padding: 50px 20px; font-size: 0.95rem; line-height: 1.6;
}
.merk-empty svg { width: 40px; height: 40px; margin: 0 auto 14px; color: #b9c8d8; }

.stoerer {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--apricot), #f5b833);
  border-radius: var(--r-md); padding: 22px; text-align: center; color: var(--white);
}
.stoerer__pct { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.stoerer__head { font-size: 1rem; font-weight: 700; margin: 4px 0 4px; }
.stoerer__sub { font-size: 0.8rem; opacity: 0.92; }

/* ============================ TABLE ============================ */
.tablesheet {
  background: var(--surface); border-radius: var(--r-lg);
  width: min(880px, 100%); box-shadow: var(--shadow-lg); overflow: hidden;
  display: flex; flex-direction: column; max-height: 88vh;
  animation: pop var(--t-base) var(--ease);
}
.tablesheet__head {
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; flex-shrink: 0;
}
.tablesheet__head h3 { font-size: 1.05rem; }
.tablesheet__scroll { overflow: auto; }
.gltable { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.gltable th {
  position: sticky; top: 0; z-index: 1;
  background: var(--cream-2); color: var(--text-muted);
  text-align: right; padding: 9px 14px; white-space: nowrap;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.gltable th:first-child { text-align: left; }
.gltable td { padding: 9px 14px; border-top: 1px solid var(--border-soft); color: var(--text-body); text-align: right; white-space: nowrap; }
.gltable td:first-child { text-align: left; color: var(--text); font-weight: 600; white-space: normal; min-width: 200px; }
.gltable tr:hover td { background: var(--cream); }
.gltable .row-class td {
  background: var(--navy) !important; color: var(--white) !important;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.72rem; text-align: left;
}
.gltable .row-line td {
  background: var(--apricot-bg) !important; color: #8a5a00 !important;
  font-weight: 700; text-align: left; font-size: 0.74rem;
}
.gltable .star { color: var(--apricot); }

/* close button on dark headers */
.close-light {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.18); color: var(--white);
  display: flex; align-items: center; justify-content: center;
}
.close-light:hover { background: rgba(255,255,255,0.3); }
.close-light svg { width: 15px; height: 15px; }

/* ---- Responsive component tweaks ---- */
@media (max-width: 600px) {
  .config { max-height: 96vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .config__grid { grid-template-columns: 1fr; }
  .config__cta-price { font-size: 1.4rem; }
  .merk { border-radius: var(--r-lg); max-height: 92vh; }
  .merk__body { grid-template-columns: 1fr; }
  .overlay--top { padding: 0; }
  .merk, .tablesheet { border-radius: var(--r-lg) var(--r-lg) 0 0; align-self: flex-end; }
  .overlay--top { align-items: flex-end; }
}
