/* WC-Positionsmetadaten: Beschriftungen und Werte stehen wieder nebeneinander.
   Speziell für Gewicht und Preis je 100 Stück, gilt für alle Einträge
   in dl.variation, ohne deren Text/Preisberechnung zu verändern. */
.woocommerce-cart table.shop_table td.product-name dl.variation,
.woocommerce-cart-form table.shop_table td.product-name dl.variation {
    display: grid !important;
    grid-template-columns: max-content minmax(0, 1fr) !important;
    column-gap: 0.5rem !important;
    row-gap: 0.25rem !important;
    align-items: start;
    max-width: 100%;
    margin: 0.45rem 0 0 !important;
    padding: 0 !important;
}
.woocommerce-cart table.shop_table td.product-name dl.variation > dt,
.woocommerce-cart-form table.shop_table td.product-name dl.variation > dt,
.woocommerce-cart table.shop_table td.product-name dl.variation > dd,
.woocommerce-cart-form table.shop_table td.product-name dl.variation > dd {
    float: none !important;
    clear: none !important;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    min-width: 0;
}
.woocommerce-cart table.shop_table td.product-name dl.variation > dt,
.woocommerce-cart-form table.shop_table td.product-name dl.variation > dt {
    white-space: nowrap;
    font-weight: 500;
}
.woocommerce-cart table.shop_table td.product-name dl.variation > dd,
.woocommerce-cart-form table.shop_table td.product-name dl.variation > dd {
    overflow-wrap: break-word;
}
.woocommerce-cart table.shop_table td.product-name dl.variation > dd p,
.woocommerce-cart-form table.shop_table td.product-name dl.variation > dd p {
    margin: 0 !important;
    padding: 0 !important;
}
@media (max-width: 420px) {
    .woocommerce-cart table.shop_table td.product-name dl.variation,
    .woocommerce-cart-form table.shop_table td.product-name dl.variation {
        grid-template-columns: minmax(0, 1fr) !important;
        row-gap: 0.05rem !important;
    }
    .woocommerce-cart table.shop_table td.product-name dl.variation > dd,
    .woocommerce-cart-form table.shop_table td.product-name dl.variation > dd {margin-bottom: .45rem !important;}
}

/* DSK 1.0.22: Positionseigenschaften auch in der Kasse in derselben Zeile
   wie ihre Bezeichnung anzeigen. Der Warenkorb verwendet obige Regeln.
   Das WooCommerce-Markup bleibt unverändert; Preis-/Mengenlogik unberuehrt. */
body.woocommerce-checkout .woocommerce-checkout-review-order-table td.product-name dl.variation,
body.woocommerce-checkout table.shop_table.woocommerce-checkout-review-order-table td.product-name dl.variation,
body.woocommerce-checkout table.shop_table td.product-name dl.variation {
    display: grid !important;
    grid-template-columns: max-content minmax(0, 1fr) !important;
    column-gap: .5rem !important;
    row-gap: .25rem !important;
    align-items: baseline !important;
    max-width: 100% !important;
    margin: .45rem 0 0 !important;
    padding: 0 !important;
    text-align: left !important;
}
body.woocommerce-checkout table.shop_table td.product-name dl.variation > dt,
body.woocommerce-checkout table.shop_table td.product-name dl.variation > dd {
    display: block !important;
    float: none !important;
    clear: none !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    line-height: 1.4 !important;
}
body.woocommerce-checkout table.shop_table td.product-name dl.variation > dt {
    white-space: nowrap;
}
body.woocommerce-checkout table.shop_table td.product-name dl.variation > dd {
    overflow-wrap: anywhere;
}
body.woocommerce-checkout table.shop_table td.product-name dl.variation > dd p {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* DSK 1.0.23: Klassische Kasse wie Positionsansicht (Anlage 2).
   Produktfoto links, Bezeichnung/Menge/100er-Preis rechts davon;
   Artikelreferenzen unter dem Foto. Keine Umstellung des Preis-HTMLs. */
body.woocommerce-checkout table.woocommerce-checkout-review-order-table tr.dsk-checkout-order-row td.product-name .dsk-checkout-product-top {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 1rem;
    align-items: start;
    margin: 0 0 .65rem !important;
    width: 100%;
    min-width: 0;
}
body.woocommerce-checkout table.woocommerce-checkout-review-order-table tr.dsk-checkout-order-row td.product-name .dsk-checkout-product-top.dsk-checkout-has-image {
    grid-template-columns: 140px minmax(0, 1fr);
}
body.woocommerce-checkout .dsk-checkout-product-image {
    width: 140px;
    max-width: 100%;
}
body.woocommerce-checkout .dsk-checkout-product-image img {
    display: block !important;
    width: 140px !important;
    height: 140px !important;
    max-width: 100% !important;
    object-fit: contain;
    float: none !important;
    margin: 0 !important;
}
body.woocommerce-checkout .dsk-checkout-product-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .65rem;
}
body.woocommerce-checkout .dsk-checkout-product-title,
body.woocommerce-checkout .dsk-checkout-product-qty,
body.woocommerce-checkout .dsk-checkout-product-rate {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.5;
    overflow-wrap: break-word;
}
body.woocommerce-checkout .dsk-checkout-product-title > :is(a, span, strong, p) {
    margin: 0 !important;
}
body.woocommerce-checkout .dsk-checkout-product-rate {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 1rem;
    align-items: baseline;
    width: 100%;
}
body.woocommerce-checkout table.shop_table td.product-name dl.variation > .dsk-checkout-moved-rate {
    display: none !important;
}
body.woocommerce-checkout .dsk-checkout-product-top + dl.variation {
    margin-top: .55rem !important;
}
@media (max-width: 760px) {
    body.woocommerce-checkout table.woocommerce-checkout-review-order-table tr.dsk-checkout-order-row td.product-name .dsk-checkout-product-top.dsk-checkout-has-image {
        grid-template-columns: minmax(76px, 100px) minmax(0,1fr);
        column-gap: .65rem;
    }
    body.woocommerce-checkout .dsk-checkout-product-image,
    body.woocommerce-checkout .dsk-checkout-product-image img { width: 100px !important; height: 100px !important; }
    body.woocommerce-checkout .dsk-checkout-product-rate { grid-template-columns: minmax(0, 1fr); row-gap: .15rem; }
}
@media (max-width: 440px) {
    body.woocommerce-checkout table.woocommerce-checkout-review-order-table tr.dsk-checkout-order-row td.product-name .dsk-checkout-product-top.dsk-checkout-has-image {
        grid-template-columns: minmax(64px, 82px) minmax(0,1fr);
    }
    body.woocommerce-checkout .dsk-checkout-product-image,
    body.woocommerce-checkout .dsk-checkout-product-image img { width: 82px !important; height: 82px !important; }
}
@media (max-width: 640px) {
    /* Sehr schmale Kassenansicht: Werte nicht buchstabenweise umbrechen. */
    body.woocommerce-checkout table.woocommerce-checkout-review-order-table tr.dsk-checkout-order-row td.product-name dl.variation {
        grid-template-columns: minmax(0,1fr) !important;
        row-gap: 0 !important;
    }
    body.woocommerce-checkout table.woocommerce-checkout-review-order-table tr.dsk-checkout-order-row td.product-name dl.variation > dt:not(.dsk-checkout-moved-rate) {
        margin-top: .4rem !important;
        white-space: normal !important;
    }
    body.woocommerce-checkout table.woocommerce-checkout-review-order-table tr.dsk-checkout-order-row td.product-name dl.variation > dd:not(.dsk-checkout-moved-rate) {
        margin-top: .1rem !important;
        overflow-wrap: anywhere !important;
    }
}
@media (max-width: 640px) {
    body.woocommerce-checkout table.woocommerce-checkout-review-order-table tr.dsk-checkout-order-row td.product-name .dsk-checkout-product-top.dsk-checkout-has-image {
        display: block !important;
    }
    body.woocommerce-checkout .dsk-checkout-product-image {margin-bottom: .5rem;}
    body.woocommerce-checkout .dsk-checkout-product-rate {display: block !important;}
    body.woocommerce-checkout .dsk-checkout-product-rate-label,
    body.woocommerce-checkout .dsk-checkout-product-rate-value {
        display: block;
        width: 100%;
        overflow-wrap: break-word;
    }
}


/* Positionsnummer in Warenkorb und Kasse als eigene einheitliche Auszeichnung. */
body.woocommerce-cart .dsk-line-position,
body.woocommerce-checkout .dsk-line-position {
    font-weight: 700;
    white-space: nowrap;
    display: inline-block;
    margin-right: .55rem;
}
