/* ============================================================
   TestArtikelDetailDesign.css — /test-artikel/{artikelnummer} (Design-Demo)

   Tokens + Body-Neutralisierung sind nach TestDesignSystem.css verschoben
   (.ev-root, gerendert von TestLayout, geladen vor dieser Datei in
   App.razor). .ttd-root bleibt als zusaetzlicher Hook auf dem page-eigenen
   Wrapper-Div erhalten (verschachtelt INNERHALB von .ev-root) und traegt
   weiterhin die nicht-token Basiswerte sowie alle Regeln, die bewusst vom
   gemeinsamen Designsystem abweichen (Galerie/Buybox/Spec-Grid gibt es nur
   hier; .ev-btn/.ev-card/.ev-icon-btn/.ev-accordion__item sind hier bewusst
   anders gestaltet als in TestDesignSystem.css, da die Markup-Konvention
   dieser Seite abweicht — z.B. .ev-card mit <h3>/<p>-Kindern statt der
   BEM-Klassen __kicker/__title/__text). Bei gleichnamigen Klassen gewinnt
   diese Datei gegenueber TestDesignSystem.css, da sie in App.razor danach
   geladen wird.

   WICHTIG: Diese Datei wird (wie jede Page-CSS in diesem Repo) auf JEDER
   Seite geladen, nicht nur auf /test-artikel/{id}. Deshalb OHNE AUSNAHME:
   - jede Regel unter der Wurzelklasse .ttd-root geschachtelt
   - alle @keyframes mit ttd- praefixiert
   - niemals ein nacktes body{}, h1{}, section{}, .btn{} etc.
   - niemals ein nacktes model-viewer{} — nur .ttd-root model-viewer,
     sonst trifft es den echten AR-Viewer auf den Produktseiten.
   ============================================================ */

.ttd-root {
    display: block;
    position: relative;
    width: 100%;
    background: var(--ev-bg);
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--ev-text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: clip;
    isolation: isolate;
    padding-bottom: 4rem;
}

.ttd-root .ttd-loading,
.ttd-root .ttd-notfound {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    padding: 2rem;
    color: var(--ev-text-2);
}

.ttd-root .ttd-notfound h1 {
    font-size: 1.6rem;
    color: var(--ev-text);
    margin: 0;
}

/* ---- Layout helpers ---- */
.ttd-root .ev-container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 40px;
}

.ttd-root .ttd-section {
    padding-block: 96px;
    border-top: 1px solid var(--ev-line);
}

/* ---- Breadcrumb ---- */
.ttd-root .ev-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 1200px;
    margin-inline: auto;
    padding: 24px 40px 0;
    font-size: 0.86rem;
    color: var(--ev-text-3);
}

.ttd-root .ev-breadcrumb a {
    color: var(--ev-text-2);
    text-decoration: none;
    transition: color 0.2s var(--ev-ease);
}

.ttd-root .ev-breadcrumb a:hover {
    color: var(--ev-link);
}

.ttd-root .ev-breadcrumb-current {
    color: var(--ev-text);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 24rem;
}

/* ---- PDP: gallery + buybox grid ---- */
.ttd-root .ev-pdp {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 48px;
    padding-top: 24px;
    padding-bottom: 64px;
    align-items: start;
}

.ttd-root .ev-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ttd-root .ev-stage {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--ev-r-lg);
    overflow: hidden;
    background: var(--ev-surface);
    border: 1px solid var(--ev-line);
}

.ttd-root .ev-stage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s var(--ev-ease);
}

.ttd-root .ev-stage-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--ev-text-3);
}

.ttd-root .ttd-ar-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
}

.ttd-root .ttd-ar-stage {
    aspect-ratio: 4 / 3;
    border-radius: var(--ev-r-lg);
    overflow: hidden;
    background: var(--ev-surface);
    border: 1px solid var(--ev-line);
}

.ttd-root .ttd-ar-stage model-viewer {
    width: 100%;
    height: 100%;
    --poster-color: transparent;
}

.ttd-root .ev-gallery__thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ttd-root .ev-gallery__thumb {
    appearance: none;
    border: 2px solid var(--ev-line);
    border-radius: 12px;
    overflow: hidden;
    width: 64px;
    height: 64px;
    padding: 0;
    cursor: pointer;
    background: var(--ev-surface);
    transition: border-color 0.25s var(--ev-ease), transform 0.2s var(--ev-ease);
}

.ttd-root .ev-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ttd-root .ev-gallery__thumb:hover {
    transform: translateY(-2px);
}

.ttd-root .ev-gallery__thumb.is-active {
    border-color: var(--ev-accent);
}

/* ---- Buybox column ---- */
.ttd-root .ev-buybox-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ttd-root .ttd-type-label {
    align-self: flex-start;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ev-text-2);
    font-weight: 600;
    margin: 0;
}

.ttd-root .ev-h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.08;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}

.ttd-root .ttd-badge {
    align-self: flex-start;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--ev-line);
    border-radius: var(--ev-r-pill);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ev-text-2);
}

.ttd-root .ev-lead {
    color: var(--ev-text-2);
    line-height: 1.6;
    margin: 0;
}

.ttd-root .ev-buybox {
    position: sticky;
    top: 24px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--ev-surface);
    border: 1px solid var(--ev-line);
    border-radius: var(--ev-r-lg);
    padding: 24px;
}

.ttd-root .ttd-price-row {
    display: flex;
    align-items: baseline;
}

.ttd-root .ttd-price-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ev-text);
}

.ttd-root .ttd-pricing-list {
    list-style: none;
    margin: 0;
    padding: 12px 0;
    border-top: 1px solid var(--ev-line);
    border-bottom: 1px solid var(--ev-line);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ttd-root .ttd-pricing-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.92rem;
    color: var(--ev-text-2);
}

.ttd-root .ttd-pricing-list li strong {
    color: var(--ev-text);
}

.ttd-root .ttd-date-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ttd-root .ttd-date-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--ev-text-2);
}

.ttd-root .ttd-date-field input {
    min-height: 44px;
    border-radius: 10px;
    border: 1px solid var(--ev-line);
    background: var(--ev-surface-2);
    color: var(--ev-text);
    padding: 0 10px;
    font: inherit;
    color-scheme: dark;
}

.ttd-root .ttd-check-row {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--ev-text-2);
}

/* ---- Buttons ---- */
.ttd-root .ev-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.8rem 1.6rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.25s var(--ev-ease), box-shadow 0.25s var(--ev-ease), background 0.25s var(--ev-ease);
}

.ttd-root .ev-btn--block {
    width: 100%;
}

.ttd-root .ev-btn--primary {
    background: var(--ev-accent);
    color: #fff;
}

.ttd-root .ev-btn--primary:hover {
    background: var(--ev-accent-hover);
    transform: translateY(-2px);
}

.ttd-root .ev-btn--whatsapp {
    background: var(--ev-success);
    color: #06140f;
}

.ttd-root .ev-btn--whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -12px rgba(48, 209, 88, 0.45);
}

.ttd-root .ev-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--ev-line);
    border-radius: var(--ev-r-pill);
    background: rgba(0, 0, 0, 0.5);
    color: var(--ev-text);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(6px);
}

.ttd-root .ev-icon-btn:hover {
    border-color: var(--ev-link);
    color: var(--ev-link);
}

/* ---- Sections ---- */
.ttd-root .ttd-section-title {
    font-size: 1.3rem;
    font-weight: 650;
    margin: 0 0 1.4rem;
}

/* ---- Spec grid ---- */
.ttd-root .ev-spec {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
}

.ttd-root .ev-spec__item {
    background: var(--ev-surface);
    border: 1px solid var(--ev-line);
    border-radius: var(--ev-r-lg);
    padding: 1.2rem;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.8rem;
    align-items: center;
}

.ttd-root .ev-spec__item i {
    grid-row: 1 / 3;
    width: 24px;
    height: 24px;
    color: var(--ev-link);
}

.ttd-root .ev-spec__item dt {
    font-size: 0.76rem;
    color: var(--ev-text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
}

.ttd-root .ev-spec__item dd {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ev-text);
    margin: 0;
}

/* ---- Prose / description ---- */
.ttd-root .ev-prose {
    width: 100%;
    max-width: 680px;
    color: var(--ev-text-2);
    line-height: 1.7;
}

.ttd-root .ev-prose > div + div {
    margin-top: 1rem;
}

/* ---- Cards ---- */
.ttd-root .ttd-card-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.ttd-root .ev-card {
    display: block;
    background: var(--ev-surface);
    border: 1px solid var(--ev-line);
    border-radius: var(--ev-r-lg);
    padding: 1.5rem;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.25s var(--ev-ease), transform 0.25s var(--ev-ease);
}

.ttd-root a.ev-card:hover {
    border-color: var(--ev-link);
    transform: translateY(-3px);
}

.ttd-root .ev-card i {
    width: 22px;
    height: 22px;
    color: var(--ev-link);
    margin-bottom: 0.6rem;
}

.ttd-root .ev-card h3 {
    font-size: 1.05rem;
    font-weight: 650;
    margin: 0 0 0.5rem;
}

.ttd-root .ev-card p {
    font-size: 0.92rem;
    color: var(--ev-text-2);
    line-height: 1.6;
    margin: 0;
}

/* ---- Documents (Sicherheit & Unterlagen) ---- */
.ttd-root .ttd-doc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ttd-root .ttd-doc-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--ev-link);
    text-decoration: none;
    font-weight: 500;
}

.ttd-root .ttd-doc-list a:hover {
    text-decoration: underline;
}

.ttd-root .ttd-doc-list i {
    width: 18px;
    height: 18px;
}

/* ---- Accordion / FAQ ---- */
.ttd-root .ev-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ttd-root .ev-accordion__item {
    background: var(--ev-surface);
    border: 1px solid var(--ev-line);
    border-radius: 16px;
    padding: 0.2rem 1.2rem;
}

.ttd-root .ev-accordion__item summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ttd-root .ev-accordion__item summary::-webkit-details-marker {
    display: none;
}

.ttd-root .ev-accordion__item summary::after {
    content: "+";
    color: var(--ev-text-2);
    font-size: 1.3rem;
    font-weight: 400;
    margin-left: 1rem;
}

.ttd-root .ev-accordion__item[open] summary::after {
    content: "–";
}

.ttd-root .ev-accordion__item div {
    color: var(--ev-text-2);
    line-height: 1.6;
    padding-bottom: 1rem;
}

/* ---- Shelf (ähnliche Artikel) ---- */
.ttd-root .ev-shelf {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(200px, 1fr);
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x proximity;
}

.ttd-root .ttd-shelf-card {
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-decoration: none;
    color: inherit;
    background: var(--ev-surface);
    border: 1px solid var(--ev-line);
    border-radius: var(--ev-r-lg);
    overflow: hidden;
    transition: border-color 0.25s var(--ev-ease), transform 0.25s var(--ev-ease);
}

.ttd-root .ttd-shelf-card:hover {
    border-color: var(--ev-link);
    transform: translateY(-3px);
}

.ttd-root .ttd-shelf-card img,
.ttd-root .ttd-shelf-card-fallback {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.ttd-root .ttd-shelf-card-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--ev-text-3);
    background: var(--ev-surface-2);
}

.ttd-root .ttd-shelf-card-title {
    padding: 0 0.9rem;
    font-weight: 600;
    font-size: 0.92rem;
}

.ttd-root .ttd-shelf-card-price {
    padding: 0 0.9rem 0.9rem;
    color: var(--ev-text-2);
    font-size: 0.86rem;
}

/* ---- Mobile buybar ---- */
.ttd-root .ev-buybar {
    display: none;
}

/* ---- Responsive ---- */
@media (max-width: 899px) {
    .ttd-root .ev-pdp {
        grid-template-columns: 1fr;
        gap: 1.6rem;
    }

    .ttd-root .ev-container {
        padding-inline: 20px;
    }

    .ttd-root .ev-breadcrumb {
        padding: 20px 20px 0;
    }

    .ttd-root .ttd-section {
        padding-block: 64px;
    }

    .ttd-root .ev-buybox {
        position: static;
    }

    .ttd-root .ev-buybar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        padding: 0.8rem 1.2rem;
        padding-bottom: max(0.8rem, env(safe-area-inset-bottom));
        background: rgba(28, 28, 30, 0.92);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--ev-line);
    }

    .ttd-root .ev-buybar__name {
        font-weight: 600;
        font-size: 0.9rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ttd-root .ev-buybar .ev-btn {
        min-height: 44px;
        flex-shrink: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ttd-root .ev-btn,
    .ttd-root .ev-card,
    .ttd-root .ttd-shelf-card,
    .ttd-root .ev-gallery__thumb {
        transition: none;
    }
}
