/* Catalog product cards: shared by the generator preview, editor and PDF export.
   Scope these typography rules to product cards only. */

/* ProductName's inline dimensions were designed for two separate language
   lines. Allow the selected-language title itself to use both lines. */
.catalog-card div[style*="min-height:"][style*="max-height:"]:has(> div[style*="white-space: nowrap"]) {
    min-height: 0 !important;
    max-height: none !important;
}

/* The first ProductName child is already selected by settings.language. */
.catalog-card div[style*="min-height:"][style*="max-height:"] > div:first-child[style*="white-space: nowrap"] {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    white-space: normal !important;
    overflow: hidden !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Do not display the other language as a subtitle. */
.catalog-card div[style*="min-height:"][style*="max-height:"] > div:not(:first-child)[style*="white-space: nowrap"] {
    display: none !important;
}

/* SkuStrip (and the SKU cell in compact mode) are monospace. */
.catalog-card [style*="font-family: monospace"] {
    text-align: center !important;
}

/* Keep the image chooser inside even the shortest compact product row. */
#catalog-print-root .catalog-image-select-button {
    top: 3px !important;
    inset-inline-end: 3px !important;
    width: 25px !important;
    height: 25px !important;
}

/* Selection controls are editing UI, never catalog/PDF content. */
#catalog-print-root.catalog-exporting .catalog-image-select-button { display: none !important; }
@media print {
    .catalog-image-select-button { display: none !important; }
}
