.tm-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 0 1.5rem;
    font-family: inherit;
    position: relative;
    z-index: 0; /* verhindert, dass Inhalte über Template-Navigation/Dropdowns liegen */
    isolation: isolate; /* eigener Stapelkontext, unabhängig vom Rest der Seite */
}

/* YOOtheme Section-Padding oberhalb der Komponente stark reduzieren */
.tm-main.uk-section:has(.tm-wrap) {
    padding-top: 0.75rem;
}

/* Fallback ohne :has() – greift, wenn Body die Itemid der Occasionen trägt */
body.itemid-223 .tm-main.uk-section {
    padding-top: 0.75rem;
}

.tm-alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.tm-alert-message { background: #e6f6ec; color: #1a7a3c; }
.tm-alert-warning  { background: #fff6e0; color: #9a6a00; }
.tm-alert-error    { background: #fde8e8; color: #b3261e; }
.tm-alert-notice   { background: #eef3fb; color: #1c4e91; }

.tm-intro {
    margin: 0 0 1.5rem;
    color: #344054;
}
.tm-intro-title {
    margin: 0 0 0.85rem;
    padding: 0;
    font-size: clamp(1.55rem, 2.2vw, 1.9rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #101828;
}
.tm-intro-body {
    line-height: 1.6;
}
.tm-intro-body p { margin: 0 0 0.85rem; }
.tm-intro-body p:last-child { margin-bottom: 0; }
.tm-intro-body ul,
.tm-intro-body ol {
    margin: 0.35rem 0 0.95rem;
    padding-left: 1.35rem;
}
.tm-intro-body li { margin: 0.25rem 0; }
.tm-intro-body a {
    color: #1c4e91;
    text-decoration: underline;
    word-break: break-word;
}
.tm-intro-body strong,
.tm-intro-body b { font-weight: 700; }

.tm-filterbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tm-input {
    flex: 1 1 160px;
    padding: 0.6rem 0.8rem;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
}

.tm-empty {
    text-align: center;
    color: #667085;
    padding: 2rem 0;
}

.tm-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 560px) {
    .tm-grid { grid-template-columns: 1fr 1fr; }
}

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

.tm-card {
    display: block;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: box-shadow .15s ease, transform .15s ease;
}
.tm-card:hover {
    box-shadow: 0 4px 16px rgba(16, 24, 40, 0.08);
    transform: translateY(-2px);
}

.tm-card-img {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #f2f4f7;
}
.tm-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tm-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: #98a2b3;
}
.tm-badge-reserviert { background: #dc8a00; }
.tm-badge-verkauft   { background: #98a2b3; }

.tm-card-body { padding: 0.9rem 1rem 1.1rem; }
.tm-card-title { font-size: 1.05rem; margin: 0 0 0.35rem; }
.tm-card-desc  { font-size: 0.9rem; color: #475467; margin: 0 0 0.5rem; }
.tm-card-price { font-weight: 700; margin: 0; }

.tm-back {
    display: inline-block;
    margin-bottom: 0.85rem;
    color: inherit;
    text-decoration: none;
}
.tm-back:hover { text-decoration: underline; }

.tm-detail {
    display: block;
    max-width: 100%;
}

.tm-detail > .tm-intro-title {
    margin-bottom: 1rem;
}

.tm-detail-gallery {
    margin: 0 0 1.25rem;
}

.tm-detail-img {
    width: 100%;
    background: #f2f4f7;
    border-radius: 12px;
    overflow: hidden;
}
.tm-detail-img img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    object-fit: contain;
    aspect-ratio: auto;
    max-height: min(70vh, 720px);
    margin: 0 auto;
    background: #f2f4f7;
}

.tm-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 2px;
}

.tm-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    flex: 0 0 auto;
    opacity: 0.75;
    transition: opacity .15s ease, border-color .15s ease;
}
.tm-thumb:hover { opacity: 1; }
.tm-thumb.is-active {
    opacity: 1;
    border-color: #1c4e91;
}

.tm-detail-body {
    max-width: 48rem;
}

.tm-detail-price {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1rem;
}

.tm-badge-inline {
    position: static;
    display: inline-block;
    margin: 0.5rem 0 0;
}
.tm-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}
.tm-lightbox[hidden] { display: none; }

.tm-lightbox-img {
    max-width: 92vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 6px;
    user-select: none;
}

.tm-lightbox-close,
.tm-lightbox-prev,
.tm-lightbox-next {
    position: absolute;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: none;
    border-radius: 999px;
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.tm-lightbox-close:hover,
.tm-lightbox-prev:hover,
.tm-lightbox-next:hover { background: rgba(255,255,255,0.25); }

.tm-lightbox-close { top: 1rem; right: 1rem; }
.tm-lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.tm-lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }

.tm-lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.85rem;
    background: rgba(0,0,0,0.4);
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
}

@media (max-width: 480px) {
    .tm-lightbox-prev, .tm-lightbox-next { width: 38px; height: 38px; font-size: 1.1rem; }
}

.tm-detail-desc {
    line-height: 1.5;
    margin-bottom: 1.5rem;
}
.tm-detail-desc p { margin: 0 0 0.75rem; }
.tm-detail-desc ul,
.tm-detail-desc ol {
    margin: 0.5rem 0 0.9rem;
    padding-left: 1.35rem;
}
.tm-detail-desc li { margin: 0.2rem 0; }
.tm-detail-desc a {
    color: #1c4e91;
    text-decoration: underline;
    word-break: break-word;
}
.tm-detail-desc strong,
.tm-detail-desc b { font-weight: 700; }

.tm-form {
    border-top: 1px solid #e4e7ec;
    padding-top: 1.2rem;
}
.tm-form h2 { margin-top: 0; font-size: 1.1rem; }
.tm-hint { color: #667085; font-size: 0.9rem; margin-top: -0.5rem; }
.tm-form label { display: block; font-weight: 600; margin: 0.8rem 0 0.3rem; font-size: 0.9rem; }

.tm-hp { position: absolute; left: -9999px; top: -9999px; }

.tm-btn {
    margin-top: 1.2rem;
    width: 100%;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 8px;
    background: #1c4e91;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
.tm-btn:hover { background: #163c70; }

@media (min-width: 480px) {
    .tm-btn { width: auto; }
}
