/**
 * Fix für fehlende/unsichtbare Labels in Order Totals
 * Forciert Sichtbarkeit mit maximaler Spezifität
 */

:root {
    --tmv2-order-totals-label-color: #333333;
}

.woocommerce-table--order-details tfoot,
table.shop_table tfoot,
.order_details tfoot {
    display: table-footer-group !important;
    width: 100% !important;
}

.woocommerce-table--order-details tfoot tr,
table.shop_table tfoot tr,
.order_details tfoot tr {
    display: table-row !important;
}

/* Alle möglichen Selektoren abdecken */
.woocommerce-table--order-details tfoot th,
.woocommerce-table--order-details tbody th,
.woocommerce-order-overview__total th,
table.shop_table tfoot th,
.order_details tfoot th,
.woocommerce-checkout-review-order-table tfoot th,
.woocommerce-order-details .woocommerce-table--order-details tfoot th {
    opacity: 1 !important;
    visibility: visible !important;
    display: table-cell !important;
    font-size: inherit !important;
    font-weight: 600 !important;
    text-indent: 0 !important;
    overflow: visible !important;
    clip: unset !important;
    clip-path: none !important;
    width: auto !important;
    height: auto !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    color: var(--tmv2-order-totals-label-color, #333333) !important;
}

/* Auch für <th scope="row"> */
th[scope="row"] {
    opacity: 1 !important;
    visibility: visible !important;
}

/* WICHTIG: Verhindere dass Labels auf 0 Breite/Höhe gesetzt werden */
.woocommerce-table--order-details tfoot th::before,
.woocommerce-table--order-details tfoot th::after,
.woocommerce-table--order-details tbody th::before,
.woocommerce-table--order-details tbody th::after {
    content: none !important;
}

/* Sicherstellen dass Text nicht ausgeblendet wird */
.woocommerce-table--order-details tfoot th > *,
.woocommerce-table--order-details tbody th > * {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Stelle sicher dass Labels nicht versteckt werden */
.woocommerce-table--order-details tfoot th::before,
.woocommerce-table--order-details tbody th::before,
.woocommerce-order-overview__total th::before {
    content: attr(data-label) !important;
}

.woocommerce-table--order-details .tmv2-spedition-summary th,
.woocommerce-table--order-details .tmv2-spedition-summary td {
    color: #333333 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Spezifisch für Germanized */
.woocommerce-gzd-order-details-table tfoot th {
    opacity: 1 !important;
    display: table-cell !important;
}

.tmv2-order-total-label {
    font-weight: 600 !important;
    color: var(--tmv2-order-totals-label-color, #333333) !important;
}

.tmv2-order-total-label-inline {
    display: inline-block;
    font-weight: 600;
    margin-right: 8px;
    color: var(--tmv2-order-totals-label-color, #333333);
    opacity: 1 !important;
    visibility: visible !important;
}

td[data-tmv2-label] {
    position: relative;
}

/* Fallback: erzwinge sichtbaren Text in allen Zellen der Totals-Sektion */
.woocommerce-table--order-details tfoot td,
.woocommerce-table--order-details tfoot th {
    opacity: 1 !important;
    visibility: visible !important;
    color: currentColor !important;
    text-indent: 0 !important;
    clip: auto !important;
    clip-path: none !important;
    display: table-cell !important;
    width: auto !important;
    float: none !important;
    vertical-align: middle !important;
}

.woocommerce-table--order-details tr.order-total {
    background: transparent !important;
}

.woocommerce-table--order-details tfoot td *,
.woocommerce-table--order-details tfoot th * {
    opacity: 1 !important;
    visibility: visible !important;
    color: currentColor !important;
    text-indent: 0 !important;
    clip: auto !important;
    clip-path: none !important;
}

.woocommerce-table--order-details tfoot tr.order-total th,
.woocommerce-table--order-details tfoot tr.order-total td {
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    padding-top: 16px !important;
}

.woocommerce-table--order-details tfoot tr.order-total td {
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.woocommerce-table--order-details tfoot tr.order-total td strong {
    border: 0 !important;
}

.woocommerce-table--order-details tr.order-total th,
.woocommerce-table--order-details tr.order-total td,
.woocommerce-table--order-details tr.order-total td *,
table.shop_table tfoot tr.order-total th,
table.shop_table tfoot tr.order-total td,
table.shop_table tfoot tr.order-total td *,
.order_details tfoot tr.order-total th,
.order_details tfoot tr.order-total td,
.order_details tfoot tr.order-total td * {
    color: #212121 !important;
    font-weight: 700 !important;
    font-size: inherit !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: inherit !important;
}

.woocommerce-table--order-details tr.order-total th {
    text-align: left !important;
}

.woocommerce-table--order-details tr.order-total td {
    text-align: right !important;
}

.woocommerce-table--order-details tr.order-total {
    display: table-row !important;
    background: transparent !important;
}

.woocommerce-table--order-details tr.order-total th,
.woocommerce-table--order-details tr.order-total td,
table.shop_table tfoot tr.order-total th,
table.shop_table tfoot tr.order-total td,
.order_details tfoot tr.order-total th,
.order_details tfoot tr.order-total td {
    display: table-cell !important;
    float: none !important;
    width: auto !important;
    vertical-align: middle !important;
    padding: 12px 0 !important;
    border: none !important;
    background: transparent !important;
}

.woocommerce-table--order-details tr.order-total td strong,
.woocommerce-table--order-details tr.order-total td span,
.woocommerce-table--order-details tr.order-total td b,
table.shop_table tfoot tr.order-total td strong,
table.shop_table tfoot tr.order-total td span,
table.shop_table tfoot tr.order-total td b,
.order_details tfoot tr.order-total td strong,
.order_details tfoot tr.order-total td span,
.order_details tfoot tr.order-total td b {
    display: inline !important;
    font-weight: 700 !important;
    color: #212121 !important;
    text-transform: none !important;
    font-size: inherit !important;
    line-height: inherit !important;
}

.tmv2-order-total-amount-cell {
    text-align: right !important;
    display: table-cell !important;
    float: none !important;
    vertical-align: middle !important;
    font-size: inherit !important;
}

/* Shipping rows need text wrapping */
.tmv2-order-total-no-label.tmv2-order-total-no-label--colspan,
.tmv2-order-total-no-label--colspan .tmv2-order-total-amount-cell {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.woocommerce-order-overview.order_details {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    list-style: none !important;
    display: block !important;
}

.woocommerce-order-overview.order_details li {
    list-style: none !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    gap: 12px !important;
    padding: 8px 0 !important;
    margin: 0 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    color: inherit !important;
}

.woocommerce-order-overview.order_details li + li {
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.tmv2-order-overview-label {
    flex: 1 1 auto;
    font-weight: 600 !important;
    color: var(--tmv2-order-totals-label-color, #333333) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.tmv2-order-overview-value {
    flex: 0 0 auto;
    font-weight: 700 !important;
    white-space: nowrap !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-align: right !important;
}
