/* TCM-Drogen: Übersicht und Detailansicht */

.page-item.active .page-link,
.page-item.active .page-link:focus,
.page-item.active .page-link:hover { background-color: #9d0013 !important; border-color: #9d0013 !important; }


.tcm-filter { margin: 0 0 1.5rem; padding: 1rem 1rem 0; background: #f2f2f2; }
.tcm-filter label { display: block; margin: 0 0 .25rem; font-weight: 600; }
.tcm-filter .custom-select:focus,
.tcm-filter .form-control:focus { border-color: #9d0013; box-shadow: 0 0 0 .2rem rgba(157, 0, 19, .2); }

/* Das Theme gestaltet alle Buttons mit Verlauf, Schatten und Großbuchstaben – hier bewusst schlicht */
.tcm-filter .tcm-filter__reset { display: flex; align-items: center; justify-content: center; width: calc(1.5em + .75rem + 2px); height: calc(1.5em + .75rem + 2px); margin: 0; padding: 0; background: #fff; border: 1px solid #ced4da; border-radius: .25rem; box-shadow: none; color: #9d0013; cursor: pointer; }
.tcm-filter .tcm-filter__reset:hover,
.tcm-filter .tcm-filter__reset:focus { background: #9d0013; border-color: #9d0013; color: #fff; }
.tcm-filter input[type="search"] { width: 100%; margin: 0; }

/* Die Listenregel des Themes (.content ul) würde vor dem Blättern einen Aufzählungspunkt setzen */
#tcm-drugs_wrapper ul.pagination { list-style: none; }

.tcm-loading { margin: 1rem 0 0; color: #666; font-style: italic; }

/* ---------------------------------------------------------------------------
   Tabelle
--------------------------------------------------------------------------- */
#tcm-drugs { width: 100%; margin: 0; border-collapse: collapse; }
#tcm-drugs th { padding: .75rem; background: #f2f2f2; border: 0; border-bottom: 2px solid #9d0013; color: #333; font-size: .8125rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
#tcm-drugs td { padding: .75rem; border: 0; vertical-align: middle; }
#tcm-drugs tbody tr { transition: background-color .15s; }
/* Jede zweite Zeile leicht grau getönt statt Trennlinien */
#tcm-drugs tbody tr:nth-child(even) { background: rgba(0, 0, 0, .04); }
#tcm-drugs tbody tr:hover { background: rgba(0, 0, 0, .08); }

/* Feste Spaltenbreiten, damit die Tabelle beim Nachladen und Blättern nicht springt */
#tcm-drugs th:nth-child(1) { width: 24%; }
#tcm-drugs th:nth-child(2) { width: 18%; }
#tcm-drugs th:nth-child(3) { width: 14%; }
#tcm-drugs th:nth-child(4) { width: 11%; }
#tcm-drugs th:nth-child(5) { width: 14%; }
#tcm-drugs th:nth-child(6) { width: 9%; }
#tcm-drugs th:nth-child(7) { width: 10%; }

#tcm-drugs .tcm-drug { display: flex; align-items: center; gap: .875rem; color: #9d0013; font-weight: 600; text-decoration: none; }
a.tcm-drug:hover .tcm-drug__name,
a.tcm-drug:focus .tcm-drug__name { text-decoration: underline; }
/* multiply lässt den weißen Fotohintergrund auf getönten Zeilen verschwinden */
.tcm-drug__image { flex: 0 0 64px; width: 64px; height: 64px; object-fit: contain; mix-blend-mode: multiply; }
.tcm-drug__image--none { border-radius: 50%; background: rgba(0, 0, 0, .06); mix-blend-mode: normal; }

#tcm-drugs ul.tcm-values,
.tcm-facts ul.tcm-values { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; list-style: none; }
#tcm-drugs ul.tcm-values li,
.tcm-facts ul.tcm-values li { margin: 0; padding: .125rem .625rem; background: rgba(0, 0, 0, .07); border-radius: 999px; font-size: .875rem; line-height: 1.5; white-space: nowrap; }

.tcm-table-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin: 1.25rem 0 3rem; }
.tcm-table-footer .dataTables_info { padding: 0; }
.tcm-table-footer .dataTables_length label { display: flex; align-items: center; gap: .5rem; margin: 0; }
.tcm-table-footer .dataTables_length select { width: auto; margin: 0; }
.tcm-table-footer .dataTables_paginate { margin-left: auto; }
.tcm-table-footer ul.pagination { flex-wrap: wrap; margin: 0; }

/* ---------------------------------------------------------------------------
   Mobil: jede Droge als Karte statt als Tabellenzeile
--------------------------------------------------------------------------- */
@media (max-width: 767px) {
    .module-drug-list > .container { padding-right: 0; padding-left: 0; }

    #tcm-drugs,
    #tcm-drugs tbody { display: block; }
    #tcm-drugs thead { display: none; }

    #tcm-drugs tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .625rem 1rem; margin: 0 0 .875rem; padding: .875rem; border: 1px solid #e2e2e2; border-radius: 6px; background: #fff; }
    #tcm-drugs tbody tr:nth-child(even),
    #tcm-drugs tbody tr:hover { background: #fff; }
    #tcm-drugs td { display: block; padding: 0; border: 0; overflow-wrap: anywhere; hyphens: auto; }
    #tcm-drugs td.is-empty { display: none; }
    #tcm-drugs td.tcm-cell-name { grid-column: 1 / -1; padding-bottom: .625rem; border-bottom: 1px solid #e2e2e2; }
    #tcm-drugs td[data-label]::before { content: attr(data-label); display: block; margin-bottom: .125rem; color: #666; font-size: .6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
    #tcm-drugs td.dataTables_empty { grid-column: 1 / -1; text-align: center; }

    #tcm-drugs .tcm-drug { font-size: 1.0625rem; }

    .tcm-filter { padding: .75rem .75rem 0; }
    .tcm-filter .col-auto { margin-left: auto; }

    .tcm-table-footer { flex-direction: column; align-items: stretch; text-align: center; }
    .tcm-table-footer .dataTables_length label { justify-content: center; }
    .tcm-table-footer .dataTables_paginate { margin: 0; }
    .tcm-table-footer ul.pagination { justify-content: center; }
}

/* ---------------------------------------------------------------------------
   Detailansicht
--------------------------------------------------------------------------- */
.tcm-back { display: inline-block; margin-bottom: 1.25rem; color: #9d0013 !important; font-weight: 600; }
.tcm-back::before { content: "\2039"; display: inline-block; margin-right: .375rem; font-size: 1.25em; line-height: 1; }

.tcm-detail__header { margin: 0 0 1.75rem; padding-bottom: 1rem; border-bottom: 2px solid #9d0013; }
.tcm-detail__header h1 { margin: 0; }
.tcm-detail__subtitle { margin: .375rem 0 0; color: #666; font-size: 1.125rem; }

.tcm-detail__main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; gap: 2rem; }
.tcm-detail__image { padding: 1.25rem; background: rgba(0, 0, 0, .04); }
/* multiply lässt den weißen Fotohintergrund auf der getönten Fläche verschwinden */
.tcm-detail__image img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; }
.tcm-detail__image + .tcm-facts { grid-column: 2; }
.tcm-facts { grid-column: 1 / -1; margin: 0; }

.tcm-facts__row { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: .25rem 1rem; padding: .625rem .875rem; }
.tcm-facts__row:nth-child(even) { background: rgba(0, 0, 0, .04); }
.tcm-facts dt { margin: 0; color: #333; font-weight: 600; }
.tcm-facts dd { margin: 0; overflow-wrap: anywhere; }

.tcm-detail__text { margin: 2.5rem 0 0; }
.tcm-detail__text h2,
.tcm-detail__shop h2 { margin: 0 0 .75rem; }
.tcm-description p:last-child { margin-bottom: 0; }

.tcm-detail__shop { margin: 2.5rem 0 0; padding: 1.25rem 1.5rem; background: #f2f2f2; border-left: 4px solid #9d0013; }
.tcm-detail__shop p { margin: 0; }
.tcm-detail__shop a { color: #9d0013 !important; font-weight: 600; text-decoration: underline; }

.tcm-neighbours { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin: 2.5rem 0 1rem; }
.tcm-neighbour { display: flex; align-items: center; gap: .875rem; padding: .75rem 1rem; background: rgba(0, 0, 0, .04); color: #9d0013 !important; text-decoration: none !important; transition: background-color .15s; }
.tcm-neighbour:hover,
.tcm-neighbour:focus { background: rgba(0, 0, 0, .08); }
.tcm-neighbour--next { grid-column: 2; flex-direction: row-reverse; text-align: right; }
.tcm-neighbour__text { display: flex; flex-direction: column; min-width: 0; }
.tcm-neighbour__label { color: #666; font-size: .6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.tcm-neighbour__name { font-weight: 600; overflow-wrap: anywhere; }
.tcm-neighbour:hover .tcm-neighbour__name,
.tcm-neighbour:focus .tcm-neighbour__name { text-decoration: underline; }
.tcm-neighbour::before { content: "\2039"; flex: none; font-size: 1.75rem; line-height: 1; }
.tcm-neighbour--next::before { content: "\203A"; }

@media (max-width: 767px) {
    .module-drug-detail > .container { padding-top: 1.5rem !important; }
    .module-drug-detail h1 { line-height: 1.3; }

    .tcm-detail__main { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
    .tcm-detail__image + .tcm-facts { grid-column: 1; }
    .tcm-detail__image img { max-width: 18rem; margin: 0 auto; }
    .tcm-facts__row { grid-template-columns: minmax(0, 1fr); }

    .tcm-neighbours { grid-template-columns: minmax(0, 1fr); }
    .tcm-neighbour--next { grid-column: 1; }
}

/* Platz für Trefferzeile und Blättern schon vor dem Start des Skripts reservieren */
.tcm-table { min-height: 4.5rem; }
.tcm-table-footer { min-height: 2.5rem; }
