/* Theme D: catalog pages. Scope every rule to html.sg-modern.sg-theme-d plus a page or component class. */
/*
 * Wall products (list, create/edit, sizes and prices, CSV import, load from Swift Galleries) and
 * add-ons (manage, import). Templates: ProductBundle/Resources/views/**, UserBundle/Resources/views/
 * Product/* and AddOn/*. Shared markup helpers: ProductBundle/Resources/views/Catalog/catalog.html.twig.
 * Every class here starts with sg-cat- or sits under .sg-cat; ids are the pages' existing JS hooks.
 */

/* ------------------------------------------------------------ shared bits */

html.sg-modern.sg-theme-d .sg-cat { --sg-cat-gap: 24px; }

/* Product thumbnail (96x64, 10px radius): frame moulding, add-on photo or a small line drawing. */
html.sg-modern.sg-theme-d .sg-cat-thumb {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 96px;
    height: 64px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--d-wash);
    box-shadow: inset 0 0 0 1px rgba(58, 87, 109, 0.06);
    vertical-align: middle;
}
html.sg-modern.sg-theme-d .sg-cat-thumb svg { display: block; width: 96px; height: 64px; }
/* A frame border image is the right edge of the moulding; turned on its side it fills the tile. */
html.sg-modern.sg-theme-d .sg-cat-moulding {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 64px;
    height: 96px;
    object-fit: cover;
    transform: translate(-50%, -50%) rotate(90deg);
}
html.sg-modern.sg-theme-d .sg-cat-photo { position: absolute; inset: 0; background-position: center; background-size: cover; background-repeat: no-repeat; }

/* Small "eyebrow" pill used in callouts. */
html.sg-modern.sg-theme-d .sg-cat-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--d-white);
    color: var(--d-blue);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
html.sg-modern.sg-theme-d .sg-cat-step .sg-i { width: 14px; height: 14px; }

/* Callout: the soft blue panel with the hanging-frame art (just imported, new product, ...). */
html.sg-modern.sg-theme-d .sg-cat-callout {
    position: relative;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px 28px;
    margin: 0 0 28px;
    padding: 22px 56px 22px 22px;
    border: 0;
    border-radius: var(--d-r-xl);
    background: var(--d-blue-wash);
    color: var(--d-ink);
    font-size: 14.5px;
}
html.sg-modern.sg-theme-d .sg-cat-callout-art { width: 120px; height: 84px; }
html.sg-modern.sg-theme-d .sg-cat-callout h2 {
    margin: 10px 0 6px;
    font: 600 19px/1.25 var(--d-display);
    letter-spacing: -0.01em;
    color: var(--d-ink);
}
html.sg-modern.sg-theme-d .sg-cat-callout p,
html.sg-modern.sg-theme-d .sg-cat-callout ul { margin: 0; color: var(--d-ink-2); }
html.sg-modern.sg-theme-d .sg-cat-callout ul { padding-left: 18px; }
html.sg-modern.sg-theme-d .sg-cat-callout li + li { margin-top: 4px; }
html.sg-modern.sg-theme-d .sg-cat-callout a:not(.btn) { color: var(--d-blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
html.sg-modern.sg-theme-d .sg-cat-callout .sg-cat-tip { margin-top: 10px; font-size: 13.5px; }
html.sg-modern.sg-theme-d .sg-cat-callout-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
html.sg-modern.sg-theme-d .sg-cat-callout .sg-cat-callout-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    color: var(--d-ink-2);
    opacity: 1;
    text-shadow: none;
    float: none;
}
html.sg-modern.sg-theme-d .sg-cat-callout .sg-cat-callout-close:hover { background: var(--d-white); color: var(--d-ink); }
/* Amber variant: something on the page needs attention (customised sizes). */
html.sg-modern.sg-theme-d .sg-cat-callout.is-amber { background: var(--d-amber-wash); }
html.sg-modern.sg-theme-d .sg-cat-callout.is-amber .sg-cat-step { color: var(--d-amber-ink); }

/* Empty state: picture-frame art, a short explanation and the action. */
html.sg-modern.sg-theme-d .sg-cat-empty { padding: 40px 16px 48px; }
html.sg-modern.sg-theme-d .sg-cat-empty-art { display: block; width: 150px; height: 104px; margin: 0 auto 18px; }
html.sg-modern.sg-theme-d .sg-cat-empty p { margin: 0 auto 6px; max-width: 520px; }
html.sg-modern.sg-theme-d .sg-cat-empty ul { display: inline-block; margin: 4px auto 12px; padding-left: 18px; text-align: left; }
html.sg-modern.sg-theme-d .sg-cat-empty .btn { margin-top: 12px; }

/* Section heading inside a hairline card. */
html.sg-modern.sg-theme-d .sg-cat-head { margin: 0 0 20px; }
html.sg-modern.sg-theme-d .sg-cat-head .card-title,
html.sg-modern.sg-theme-d .sg-cat-head h2 { margin: 0; font: 600 18px/1.3 var(--d-display); letter-spacing: -0.01em; color: var(--d-ink); }
html.sg-modern.sg-theme-d .sg-cat-head .card-subtitle,
html.sg-modern.sg-theme-d .sg-cat-head p { margin: 4px 0 0; color: var(--d-ink-2); font-size: 14px; font-weight: 400; line-height: 1.45; }
html.sg-modern.sg-theme-d .sg-cat-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }

/* ------------------------------------------------- list (wall products) */

html.sg-modern.sg-theme-d .sg-cat-list .sg-table-tools { margin-bottom: 4px; }
html.sg-modern.sg-theme-d .sg-cat-list table.dataTable { margin-top: 0 !important; }
html.sg-modern.sg-theme-d .sg-cat-list table.dataTable thead th:first-child,
html.sg-modern.sg-theme-d .sg-cat-list table.dataTable tbody td:first-child { width: 96px; padding-left: 4px; padding-right: 4px; }
html.sg-modern.sg-theme-d .sg-cat-list table.dataTable tbody td { padding-top: 14px; padding-bottom: 14px; }
html.sg-modern.sg-theme-d .sg-cat-list table.dataTable thead th:last-child,
html.sg-modern.sg-theme-d .sg-cat-list table.dataTable tbody td:last-child { padding-right: 4px; text-align: right; }
html.sg-modern.sg-theme-d .sg-cat-name { color: var(--d-ink) !important; font-weight: 600; font-size: 15.5px; text-decoration: none; }
html.sg-modern.sg-theme-d .sg-cat-name:hover { color: var(--d-blue) !important; }
html.sg-modern.sg-theme-d .sg-cat-list .sg-chip { height: 24px; padding: 0 9px; margin-left: 6px; font-size: 12px; vertical-align: 1px; }
html.sg-modern.sg-theme-d .sg-cat-meta { display: none; }
/* Long product-type names wrap instead of pushing the table sideways. */
html.sg-modern.sg-theme-d #user-product-types tbody td:nth-child(3) { white-space: normal; min-width: 180px; color: var(--d-ink-2); }
html.sg-modern.sg-theme-d #user-product-types tbody td:nth-child(6) { color: var(--d-ink-2); }

/* Load from Swift Galleries (products and add-ons): checkbox, thumbnail, name, details. */
html.sg-modern.sg-theme-d .sg-cat-import-list .sg-cat-list table.dataTable thead th:first-child,
html.sg-modern.sg-theme-d .sg-cat-import-list .sg-cat-list table.dataTable tbody td:first-child { width: 56px; padding-left: 8px; padding-right: 4px; text-align: center; }
html.sg-modern.sg-theme-d .sg-cat-import-list .sg-cat-list table.dataTable thead th:nth-child(2),
html.sg-modern.sg-theme-d .sg-cat-import-list .sg-cat-list table.dataTable tbody td:nth-child(2) { width: 96px; padding-left: 4px; padding-right: 4px; }
html.sg-modern.sg-theme-d .sg-cat-import-list .sg-cat-list table.dataTable tbody td:last-child { text-align: inherit; }
html.sg-modern.sg-theme-d .sg-cat-import-list .sg-cat-list table.dataTable tbody td.sg-num { text-align: right; }
html.sg-modern.sg-theme-d .sg-cat-import-list .sg-cat-list table.dataTable tbody td { white-space: normal; }
html.sg-modern.sg-theme-d .sg-cat-import-list .sg-cat-list table.dataTable tbody td:nth-child(3) { min-width: 170px; }
html.sg-modern.sg-theme-d .sg-cat-list #user-product-types tbody td:nth-child(2) { min-width: 160px; }
html.sg-modern.sg-theme-d .sg-cat-import-list .sg-cat-list table.dataTable tbody tr:has(input:checked) { --sg-table-row-background: var(--d-blue-wash); background: var(--d-blue-wash); }
/* ui-extend.css sets `label { pointer-events: none; }` globally; this label wraps the iCheck box,
   so it (and the iCheck helper inside it) must take clicks again or nothing can be ticked. */
html.sg-modern.sg-theme-d .sg-cat-check { position: relative !important; top: auto !important; display: inline-grid; place-items: center; min-width: 32px; min-height: 32px; margin: 0; cursor: pointer; pointer-events: auto; }
html.sg-modern.sg-theme-d .sg-cat-check [class*="icheckbox_"] { margin: 0; }
html.sg-modern.sg-theme-d .sg-cat-check input[type=checkbox] { width: 20px; height: 20px; margin: 0; accent-color: var(--d-blue); cursor: pointer; }
html.sg-modern.sg-theme-d .sg-cat-import-list .sg-cat-actions { margin-top: 20px; }
html.sg-modern.sg-theme-d .sg-cat-empty-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px !important; }

/* Danger zone (admin-only "remove all products"). */
html.sg-modern.sg-theme-d .sg-cat-danger { margin-top: 40px; border-color: var(--d-blush-2); }
html.sg-modern.sg-theme-d .sg-cat-danger > .card-block { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
html.sg-modern.sg-theme-d .sg-cat-danger-text { flex: 1 1 420px; min-width: 0; }
html.sg-modern.sg-theme-d .sg-cat-danger .card-title { margin: 0; font-size: 16px; color: var(--d-rose-ink); }
html.sg-modern.sg-theme-d .sg-cat-danger .card-subtitle { margin: 2px 0 0; color: var(--d-ink-2); font-size: 13px; font-weight: 500; }
html.sg-modern.sg-theme-d .sg-cat-danger p { margin: 8px 0 0; color: var(--d-ink-2); font-size: 14px; }
html.sg-modern.sg-theme-d .sg-cat-danger .btn { white-space: normal; text-align: center; }
html.sg-modern.sg-theme-d .sg-cat-nowrap { white-space: nowrap; }

/* "Create a new product" dialog: three ways in, the fastest first. */
html.sg-modern.sg-theme-d .sg-cat-modal .modal-dialog { max-width: 560px; }
html.sg-modern.sg-theme-d .sg-cat-modal .modal-footer { background: transparent; }
html.sg-modern.sg-theme-d .sg-cat-options { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
html.sg-modern.sg-theme-d .sg-cat-option {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: start;
    gap: 4px 14px;
    padding: 16px;
    border: 1px solid var(--d-line);
    border-radius: 16px;
}
html.sg-modern.sg-theme-d .sg-cat-option.is-recommended { border-color: transparent; background: var(--d-blue-wash); }
html.sg-modern.sg-theme-d .sg-cat-option-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--d-blue-wash); color: var(--d-blue); }
html.sg-modern.sg-theme-d .sg-cat-option.is-recommended .sg-cat-option-icon { background: var(--d-white); }
html.sg-modern.sg-theme-d .sg-cat-option-body strong { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 2px; font: 600 15.5px/1.3 var(--d-display); color: var(--d-ink); }
html.sg-modern.sg-theme-d .sg-cat-option-body strong .sg-chip { height: 22px; padding: 0 8px; background: var(--d-white); font: 600 11.5px var(--sg-font); }
html.sg-modern.sg-theme-d .sg-cat-option-body > span { display: block; color: var(--d-ink-2); font-size: 14px; line-height: 1.45; }
html.sg-modern.sg-theme-d .sg-cat-option .btn { grid-column: 2; justify-self: start; margin-top: 8px; }

/* ------------------------------------------ product form (create / edit) */

html.sg-modern.sg-theme-d .sg-cat-tabs { margin: 0 0 20px; }
html.sg-modern.sg-theme-d .sg-cat-tabs .nav-link .sg-i { opacity: 0.85; }
html.sg-modern.sg-theme-d .sg-cat-tab-short { display: none; }

/* Hairline section cards, two per row on wide screens, equal heights. */
html.sg-modern.sg-theme-d .sg-cat-grid > [class*="col-"] { display: flex; }
html.sg-modern.sg-theme-d .sg-cat-section { flex: 1 1 auto; width: 100%; margin: 0 0 var(--sg-cat-gap); }
html.sg-modern.sg-theme-d .sg-cat-section > .card-block { padding: 24px; }
html.sg-modern.sg-theme-d .sg-cat-form .form-group { margin: 0 0 18px; }
html.sg-modern.sg-theme-d .sg-cat-form .sg-cat-section .form-group:last-child { margin-bottom: 0; }
html.sg-modern.sg-theme-d .sg-cat-form textarea.form-control { min-height: 112px; }
html.sg-modern.sg-theme-d .sg-cat-form .form-control:disabled { background: var(--d-wash); color: var(--d-ink-2); border-color: var(--d-line); }
html.sg-modern.sg-theme-d .sg-cat-pair { margin-left: -8px; margin-right: -8px; }
html.sg-modern.sg-theme-d .sg-cat-pair > [class*="col-"] { padding-left: 8px; padding-right: 8px; }
html.sg-modern.sg-theme-d .sg-cat-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: -4px 0 0;
    color: var(--d-ink-2);
    font-size: 13px;
    line-height: 1.45;
}
html.sg-modern.sg-theme-d .sg-cat-note .sg-i { margin-top: 1px; color: var(--d-mist); }
html.sg-modern.sg-theme-d .sg-cat-label { margin: 0 0 8px; font: 600 13.5px/1.4 var(--sg-font); letter-spacing: 0; color: var(--d-ink); }

/* Frame border image: a tall preview tile beside the upload instructions. */
html.sg-modern.sg-theme-d .sg-cat-frame-media { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 20px; margin: 0 0 22px; }
html.sg-modern.sg-theme-d .sg-cat-frame-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    overflow: hidden;
    border-radius: var(--d-r);
    background: var(--d-wash);
    box-shadow: inset 0 0 0 1px var(--d-line);
}
html.sg-modern.sg-theme-d .sg-cat-frame-empty { display: block; width: 64px; height: 120px; }
html.sg-modern.sg-theme-d #frame-border-preview-container { height: 100%; padding: 10px; text-align: center; }
html.sg-modern.sg-theme-d #frame-border-preview { width: auto; height: auto; max-width: 100%; max-height: 100%; border-radius: 4px; }
html.sg-modern.sg-theme-d #image-name-container { margin: 0 0 10px; }
html.sg-modern.sg-theme-d #image-name-container .sg-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
html.sg-modern.sg-theme-d .sg-cat-frame-copy ul { margin: 0 0 14px; padding-left: 18px; color: var(--d-ink-2); font-size: 14px; line-height: 1.5; }
html.sg-modern.sg-theme-d .sg-cat-frame-copy li + li { margin-top: 4px; }
html.sg-modern.sg-theme-d .sg-cat-frame-copy strong { color: var(--d-ink); }
html.sg-modern.sg-theme-d .sg-cat-frame-acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* Customised sizes callout: an icon in place of the illustration. */
html.sg-modern.sg-theme-d .sg-cat-override { grid-template-columns: 48px minmax(0, 1fr) auto; padding-right: 22px; }
html.sg-modern.sg-theme-d .sg-cat-callout-icon {
    display: inline-grid;
    place-items: center;
    align-self: start;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--d-white);
    color: var(--d-amber-ink);
}

/* Save bar: archive / duplicate on the left, save on the right. */
html.sg-modern.sg-theme-d .sg-cat-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: 8px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid var(--d-line);
}
html.sg-modern.sg-theme-d .sg-cat-actions-secondary { display: flex; flex-wrap: wrap; gap: 10px; margin-right: auto; }
html.sg-modern.sg-theme-d .sg-cat-actions-secondary .btn { margin: 0 !important; }
html.sg-modern.sg-theme-d .sg-cat-actions .save-product-class,
html.sg-modern.sg-theme-d .sg-cat-actions > button[type=submit] { min-width: 150px; }
html.sg-modern.sg-theme-d .sg-cat-actions .sg-cat-preview-btn {
    background: var(--d-blue);
    border-color: var(--d-blue);
    color: var(--d-white);
}
html.sg-modern.sg-theme-d .sg-cat-actions .sg-cat-preview-btn:hover,
html.sg-modern.sg-theme-d .sg-cat-actions .sg-cat-preview-btn:focus,
html.sg-modern.sg-theme-d .sg-cat-actions .sg-cat-preview-btn:active {
    background: var(--d-blue-600) !important;
    border-color: var(--d-blue-600) !important;
    color: var(--d-white) !important;
}

/* ------------------------------------------- editable grids (sizes, add-ons) */

/* Quick pricing strip: "Set all prices to [ ] X my cost. [Update Prices]". */
html.sg-modern.sg-theme-d .sg-cat-pricing {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 16px;
    background: var(--d-wash);
    color: var(--d-ink);
    font-size: 14px;
}
html.sg-modern.sg-theme-d .sg-cat-pricing-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--d-white); color: var(--d-blue); }
html.sg-modern.sg-theme-d .sg-cat-pricing-icon .sg-i { width: 17px; height: 17px; }
html.sg-modern.sg-theme-d .sg-cat-pricing .sg-cat-pricing-label {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 0;
    padding: 0;
    color: var(--d-ink) !important;
    font-size: 14px !important;
    font-weight: 600;
    pointer-events: auto;
}
html.sg-modern.sg-theme-d .sg-cat-pricing-field { display: inline-flex; align-items: center; gap: 8px; }
html.sg-modern.sg-theme-d .sg-cat-pricing #multiplier {
    width: 76px !important;
    height: 40px;
    min-height: 40px;
    margin: 0;
    padding: 0 12px !important;
    border-radius: 999px;
    background: var(--d-white);
    font-weight: 600;
}
html.sg-modern.sg-theme-d .sg-cat-pricing-x { color: var(--d-ink-2); white-space: nowrap; }
html.sg-modern.sg-theme-d .sg-cat-pricing-x strong { color: var(--d-ink); font-weight: 700; }
html.sg-modern.sg-theme-d .sg-cat-pricing .sg-cat-rounding {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: static;
    transform: none;
    margin: 0;
    min-height: 40px;
    color: var(--d-ink-2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    pointer-events: auto;
}
html.sg-modern.sg-theme-d .sg-cat-rounding input[type="checkbox"] {
    position: static !important;
    left: auto !important;
    opacity: 1 !important;
    appearance: auto;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--d-blue);
    cursor: pointer;
}
html.sg-modern.sg-theme-d .sg-cat-rounding input:focus-visible { outline: 2px solid var(--d-blue); outline-offset: 3px; }
html.sg-modern.sg-theme-d .sg-cat-pricing #apply-multiplier { margin-left: auto; min-height: 40px; }

html.sg-modern.sg-theme-d .sg-cat-grid-table { overflow-x: auto; overflow-y: hidden; padding: 0 0 2px; text-align: left; }
/* One scroller per grid (this one, which gets ui-modern's edge fade), not a second one inside DataTables. */
html.sg-modern.sg-theme-d .sg-cat-grid-table > .dataTables_wrapper { overflow: visible !important; }
html.sg-modern.sg-theme-d .sg-cat-edit-table { border: 0 !important; border-collapse: separate; border-spacing: 0; margin: 0 !important; }
html.sg-modern.sg-theme-d .sg-cat-edit-table thead th {
    padding: 12px 6px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--d-line) !important;
    text-align: center !important;
    white-space: nowrap;
}
html.sg-modern.sg-theme-d .sg-cat-edit-table thead th:first-child { width: 44px; }
html.sg-modern.sg-theme-d .sg-cat-edit-table tbody td {
    padding: 8px 4px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--d-line) !important;
    background: transparent !important;
    vertical-align: middle;
}
html.sg-modern.sg-theme-d .sg-cat-edit-table tbody tr,
html.sg-modern.sg-theme-d .sg-cat-edit-table tbody tr:nth-of-type(odd) { background: var(--sg-table-row-background, transparent) !important; }
html.sg-modern.sg-theme-d .sg-cat-edit-table tbody tr:hover { background: var(--d-wash) !important; }
html.sg-modern.sg-theme-d .sg-cat-edit-table td.dataTables_empty { padding: 28px 8px !important; text-align: center !important; color: var(--d-ink-2); }

/* Cell inputs: soft fields that show a hairline on hover and the blue ring on focus. */
html.sg-modern.sg-theme-d .sg-cat-edit-table .form-control.excel-style,
html.sg-modern.sg-theme-d .sg-cat-edit-table tbody tr td input.excel-style,
html.sg-modern.sg-theme-d .sg-cat-edit-table select.excel-style {
    height: 40px;
    min-height: 40px;
    min-width: 84px;
    padding: 0 12px !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    outline: 0 !important;
    background-color: var(--d-wash) !important;
    color: var(--d-ink);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    box-shadow: none;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
html.sg-modern.sg-theme-d .sg-cat-edit-table tbody tr:hover input.excel-style,
html.sg-modern.sg-theme-d .sg-cat-edit-table tbody tr:hover select.excel-style { background-color: var(--d-white) !important; }
/* Selects keep the theme's chevron (a background image) and leave room for it. The
   select.form-control selector outranks the `.form-control.excel-style` padding above. */
html.sg-modern.sg-theme-d .sg-cat-edit-table select.excel-style,
html.sg-modern.sg-theme-d .sg-cat-edit-table select.form-control.excel-style { padding-right: 34px !important; }
html.sg-modern.sg-theme-d .sg-cat-edit-table .form-control.excel-style:hover,
html.sg-modern.sg-theme-d .sg-cat-edit-table select.excel-style:hover { border-color: var(--d-line-2) !important; }
html.sg-modern.sg-theme-d .sg-cat-edit-table .form-control.excel-style:focus,
html.sg-modern.sg-theme-d .sg-cat-edit-table select.excel-style:focus {
    border-color: var(--d-blue) !important;
    background-color: var(--d-white) !important;
    box-shadow: 0 0 0 4px var(--d-blue-wash) !important;
}
html.sg-modern.sg-theme-d .sg-cat-edit-table input.excel-style.parsley-success,
html.sg-modern.sg-theme-d .sg-cat-edit-table select.excel-style.parsley-success { background-color: var(--d-wash) !important; }
/* Unsaved grid edits remain distinct, including on hover and focus. */
html.sg-modern.sg-theme-d .sg-cat-edit-table tbody tr td .excel-style.sg-cell-unsaved:not(.parsley-error) {
    background-color: #edf7ef !important;
    border-color: #c7e3cf !important;
    color: #28623c;
    font-weight: 600;
}
html.sg-modern.sg-theme-d .sg-cat-edit-table tbody tr td input.excel-style.sg-price-below-cost:not(.parsley-error) {
    background-color: var(--d-blush) !important;
    border-color: #f0bbc7 !important;
    color: var(--d-rose-ink);
    font-weight: 600;
}
html.sg-modern.sg-theme-d .sg-price-warning { display: block; padding: 3px 4px 0; color: var(--d-rose-ink); font-size: 11px; font-weight: 600; line-height: 1.3; }
html.sg-modern.sg-theme-d .sg-price-update-dialog .swal2-styled.swal2-cancel {
    background: var(--d-blue) !important;
    border-color: var(--d-blue) !important;
    color: var(--d-white) !important;
}
html.sg-modern.sg-theme-d .sg-price-update-dialog .swal2-styled.swal2-confirm {
    background: var(--d-cta) !important;
    border-color: var(--d-cta) !important;
    color: var(--d-white) !important;
}
html.sg-modern.sg-theme-d .sg-cat-edit-table input.excel-style.parsley-error,
html.sg-modern.sg-theme-d .sg-cat-edit-table select.excel-style.parsley-error,
html.sg-modern.sg-theme-d .table-striped.striped-input.sg-cat-edit-table tbody tr td input.parsley-error {
    border-color: var(--d-rose-ink) !important;
    background-color: var(--d-blush) !important;
}
html.sg-modern.sg-theme-d .sg-cat-edit-table .parsley-error-wrapper .parsley-required,
html.sg-modern.sg-theme-d .sg-cat-edit-table .parsley-errors-list li {
    border-color: var(--d-rose-ink);
    border-radius: 8px;
    color: var(--d-rose-ink);
    font-size: 12.5px;
}

/* Row remove button (was a bare icon; still .remove-product-icon / .remove-add-on-icon). */
html.sg-modern.sg-theme-d .sg-cat-remove {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--d-ink-2);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
html.sg-modern.sg-theme-d .sg-cat-remove:hover,
html.sg-modern.sg-theme-d .sg-cat-remove:focus-visible { background: var(--d-blush); color: var(--d-rose-ink); }
html.sg-modern.sg-theme-d .sg-cat-remove .sg-i { width: 17px; height: 17px; }
html.sg-modern.sg-theme-d .sg-cat-edit-table tr.bg-red,
html.sg-modern.sg-theme-d .sg-cat-edit-table tr.bg-red td { background: var(--d-blush) !important; }

html.sg-modern.sg-theme-d .sg-cat-sizes .dataTables_info { padding-top: 14px; }
html.sg-modern.sg-theme-d #product-holder { padding-left: 15px; padding-right: 15px; }
html.sg-modern.sg-theme-d #product-holder .sg-cat-add-row,
html.sg-modern.sg-theme-d .sg-cat-add-row { margin: 14px 0 0; }

/* ---------------------------------------------------------------- add-ons */

html.sg-modern.sg-theme-d .sg-cat-addon-card .sg-cat-head-row { align-items: center; }
html.sg-modern.sg-theme-d .sg-cat-export .dropdown-menu { min-width: 210px; }
html.sg-modern.sg-theme-d .sg-cat-export .dropdown-menu small { margin-left: auto; color: var(--d-ink-2); font-weight: 500; }
/* Column widths: wide enough to edit comfortably; the grid scrolls inside its card when needed. */
html.sg-modern.sg-theme-d .sg-cat-addon-table .min-width-400 { min-width: 0 !important; }
/* Category: wide enough for "Miscellaneous / Other" beside the chevron. */
html.sg-modern.sg-theme-d .sg-cat-addon-table:not(.sg-cards) tbody td:nth-child(2) { min-width: 212px; }
html.sg-modern.sg-theme-d .sg-cat-addon-table:not(.sg-cards) tbody td:nth-child(3) { min-width: 140px; }
html.sg-modern.sg-theme-d .sg-cat-addon-table:not(.sg-cards) tbody td:nth-child(4) { min-width: 230px; }
html.sg-modern.sg-theme-d .sg-cat-addon-table:not(.sg-cards) tbody td:nth-child(5) { min-width: 220px; }
html.sg-modern.sg-theme-d .sg-cat-addon-table:not(.sg-cards) tbody td:nth-child(6) { min-width: 100px; }
html.sg-modern.sg-theme-d .sg-cat-addon-table:not(.sg-cards) tbody td:nth-child(7) { min-width: 260px; }
html.sg-modern.sg-theme-d .sg-cat-addon-table:not(.sg-cards) tbody td:nth-child(8),
html.sg-modern.sg-theme-d .sg-cat-addon-table:not(.sg-cards) tbody td:nth-child(9) { min-width: 110px; }
html.sg-modern.sg-theme-d .sg-cat-addon-table .form-control.excel-style,
html.sg-modern.sg-theme-d .sg-cat-addon-table select.excel-style { width: 100%; }

/* Product image cell: a 64px thumbnail with Change / Delete, or the Choose button. */
html.sg-modern.sg-theme-d .sg-cat-addon-table .add-on-image { position: relative; display: flex; align-items: center; gap: 10px; width: auto; }
html.sg-modern.sg-theme-d .sg-cat-addon-table .add-on-image .first-column {
    flex: none;
    width: 64px;
    height: 64px;
    margin: 0;
    border-radius: 10px;
    background-color: var(--d-wash);
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    box-shadow: inset 0 0 0 1px rgba(58, 87, 109, 0.08);
}
html.sg-modern.sg-theme-d .sg-cat-addon-table .add-on-image .second-column {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: auto;
    transform: none;
}
html.sg-modern.sg-theme-d .sg-cat-addon-table .add-on-image .btn,
html.sg-modern.sg-theme-d .sg-cat-addon-table .add-on-file { margin: 0 !important; white-space: nowrap; }
html.sg-modern.sg-theme-d .sg-cat-addon-table .pending-save,
html.sg-modern.sg-theme-d .new-add-on .pending-save {
    display: inline-flex;
    align-items: center;
    width: auto;
    height: 28px;
    margin: 0;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--d-mist-wash);
    color: var(--d-ink-2);
    font-size: 12.5px;
    font-weight: 600;
}
/* Unsaved rows read as new (soft blue) until the page is saved. */
html.sg-modern.sg-theme-d .sg-cat-addon-table td.new-add-on { background: var(--d-blue-wash) !important; }
html.sg-modern.sg-theme-d .sg-cat-addon-table td.new-add-on input.excel-style,
html.sg-modern.sg-theme-d .sg-cat-addon-table td.new-add-on select.excel-style { background-color: var(--d-white) !important; color: var(--d-ink); }
html.sg-modern.sg-theme-d .sg-cat-addon-table input.excel-style.new-add-on::placeholder { color: var(--d-ink-2) !important; opacity: 0.7; }

/* ------------------------------------------------------ CSV import steps */

html.sg-modern.sg-theme-d .sg-cat-steps { margin: 0; padding: 0; list-style: none !important; counter-reset: none; }
html.sg-modern.sg-theme-d .sg-cat-steps > li { margin: 0; list-style: none !important; }
html.sg-modern.sg-theme-d .sg-cat-steps > li::marker { content: none; }
html.sg-modern.sg-theme-d .sg-cat-steps > li::before { content: none !important; display: none !important; }
html.sg-modern.sg-theme-d .sg-cat-step-item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 16px; padding: 22px 0; border-top: 1px solid var(--d-line); }
html.sg-modern.sg-theme-d .sg-cat-step-item:first-child { padding-top: 4px; border-top: 0; }
html.sg-modern.sg-theme-d .sg-cat-step-n {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--d-blue-wash);
    color: var(--d-blue);
    font: 700 14px/1 var(--sg-font);
    font-variant-numeric: tabular-nums;
}
html.sg-modern.sg-theme-d .sg-cat-step-title { margin: 7px 0 12px; font: 600 13px/1.3 var(--sg-font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--d-ink-2); }
html.sg-modern.sg-theme-d .sg-cat-step-title span { display: block; margin-top: 4px; font: 600 17px/1.3 var(--d-display); letter-spacing: -0.01em; text-transform: none; color: var(--d-ink); }
html.sg-modern.sg-theme-d .sg-cat-step-help { margin: -4px 0 12px; color: var(--d-ink-2); font-size: 14px; }
html.sg-modern.sg-theme-d .sg-cat-file { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
html.sg-modern.sg-theme-d .sg-cat-file-help { margin: 0; color: var(--d-ink-2); font-size: 14px; font-style: italic; }
html.sg-modern.sg-theme-d .sg-cat-file-help a { color: var(--d-blue); font-weight: 600; font-style: normal; text-decoration: underline; text-underline-offset: 3px; }
html.sg-modern.sg-theme-d .sg-cat-color { max-width: 280px; }
html.sg-modern.sg-theme-d .sg-cat-import .alert { margin: 0 0 16px; }
html.sg-modern.sg-theme-d .sg-cat-import #create-product { min-width: 240px; }
/* Parsed file preview (import_products.js writes these tables into #choose-file-contents). */
html.sg-modern.sg-theme-d #choose-file-contents > .row { margin: 0 0 18px; padding: 0; }
html.sg-modern.sg-theme-d #choose-file-contents > .row > .row { margin: 0 0 8px; }
html.sg-modern.sg-theme-d #choose-file-contents .font-size-16 strong { font: 600 15px/1.3 var(--d-display); color: var(--d-ink); }
html.sg-modern.sg-theme-d #choose-file-contents .table { margin: 0; }
html.sg-modern.sg-theme-d #choose-file-contents > .row:first-child .table { max-width: 640px; }
html.sg-modern.sg-theme-d #choose-file-contents .table td { padding: 10px 12px; font-size: 14px; }
html.sg-modern.sg-theme-d #choose-file-contents .table td:first-child { color: var(--d-ink-2); white-space: nowrap; }
/* Admin import: the lab country picker above the steps. */
html.sg-modern.sg-theme-d .sg-cat-import .sg-cat-head + .col-md-12 { margin: 0 0 18px !important; padding: 0; }
html.sg-modern.sg-theme-d .sg-cat-import .sg-cat-head + .col-md-12 h5 { margin: 0 0 8px; font: 600 13.5px var(--sg-font); color: var(--d-ink); }
html.sg-modern.sg-theme-d .sg-cat-import .sg-cat-head + .col-md-12 .col-md-12 { padding: 0; max-width: 360px; }

/* Card mode (ui-modern turns overflowing grids into one card per row on small screens). */
html.sg-modern.sg-theme-d table.sg-cat-edit-table.sg-cards tbody tr {
    margin: 0 0 12px;
    padding: 14px 16px;
    border: 1px solid var(--d-line) !important;
    border-radius: 16px;
    box-shadow: none;
}
html.sg-modern.sg-theme-d table.sg-cat-edit-table.sg-cards tbody td { align-items: center; border: 0 !important; padding: 4px 0 !important; }
html.sg-modern.sg-theme-d table.sg-cat-edit-table.sg-cards .form-control.excel-style,
html.sg-modern.sg-theme-d table.sg-cat-edit-table.sg-cards select.excel-style { min-width: 0; }
html.sg-modern.sg-theme-d table.sg-cat-edit-table.sg-cards td > input,
html.sg-modern.sg-theme-d table.sg-cat-edit-table.sg-cards td > select,
html.sg-modern.sg-theme-d table.sg-cat-edit-table.sg-cards td > .form-control { flex: 0 1 62%; max-width: 62%; }
/* The title field (size name / category) spans the card. */
html.sg-modern.sg-theme-d table.sg-cat-edit-table.sg-cards td.sg-cell-title { padding: 0 0 10px !important; margin-bottom: 6px; border-bottom: 1px solid var(--d-line) !important; }
html.sg-modern.sg-theme-d table.sg-cat-edit-table.sg-cards td.sg-cell-title > input,
html.sg-modern.sg-theme-d table.sg-cat-edit-table.sg-cards td.sg-cell-title > select { width: 100%; max-width: none; font-weight: 600; }
html.sg-modern.sg-theme-d table.sg-cat-edit-table.sg-cards td.sg-cell-actions { align-items: center; margin-top: 6px; padding-top: 10px !important; border-top: 1px solid var(--d-line) !important; }
/* The row's remove button sits in the card's top-right corner, beside the title field. */
html.sg-modern.sg-theme-d table.sg-cat-edit-table.sg-cards > tbody > tr { position: relative; }
html.sg-modern.sg-theme-d table.sg-cat-edit-table.sg-cards > tbody > tr > td.sg-cell-actions:first-child {
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
}
html.sg-modern.sg-theme-d table.sg-cat-edit-table.sg-cards > tbody > tr:has(> td.sg-cell-actions:first-child) > td.sg-cell-title { padding-right: 44px !important; }
/* Add-ons carry longer text (description, notes): two roomy cards per row, labels above the fields. */
html.sg-modern.sg-theme-d table.sg-cat-addon-table.sg-cards > tbody { grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); }
html.sg-modern.sg-theme-d table.sg-cat-addon-table.sg-cards td:not(.sg-cell-title):not(.sg-cell-actions):not(.sg-cell-media) { flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 0 !important; text-align: left; }
html.sg-modern.sg-theme-d table.sg-cat-addon-table.sg-cards td::before { max-width: none; }
html.sg-modern.sg-theme-d table.sg-cat-addon-table.sg-cards td > input,
html.sg-modern.sg-theme-d table.sg-cat-addon-table.sg-cards td > select,
html.sg-modern.sg-theme-d table.sg-cat-addon-table.sg-cards td > .form-control { flex: none; width: 100%; max-width: none; text-align: left !important; }
html.sg-modern.sg-theme-d table.sg-cat-addon-table.sg-cards td.sg-cell-actions .add-on-image { flex: 1 1 auto; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1199.98px) {
    html.sg-modern.sg-theme-d .sg-cat-callout { grid-template-columns: 104px minmax(0, 1fr); gap: 8px 22px; }
    html.sg-modern.sg-theme-d .sg-cat-callout-art { width: 104px; height: 72px; grid-row: span 2; }
    html.sg-modern.sg-theme-d .sg-cat-callout-acts { grid-column: 2; justify-content: flex-start; }
}

@media (max-width: 767.98px) {
    html.sg-modern.sg-theme-d .sg-cat-callout { grid-template-columns: 1fr; gap: 12px; padding: 20px 48px 20px 20px; margin-bottom: 22px; }
    html.sg-modern.sg-theme-d .sg-cat-callout-art { grid-row: auto; }
    html.sg-modern.sg-theme-d .sg-cat-callout-acts { grid-column: auto; }

    /* Lists: one row per item (thumbnail, name with its details, round Open button). */
    html.sg-modern.sg-theme-d .sg-cat-list table.dataTable thead { display: none; }
    html.sg-modern.sg-theme-d .sg-cat-list table.dataTable,
    html.sg-modern.sg-theme-d .sg-cat-list table.dataTable tbody { display: block; width: 100% !important; }
    html.sg-modern.sg-theme-d .sg-cat-list table.dataTable tbody tr {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 0 14px;
        padding: 12px 0;
        border-bottom: 1px solid var(--d-line);
    }
    html.sg-modern.sg-theme-d .sg-cat-list table.dataTable tbody td { display: block; width: auto !important; min-width: 0 !important; padding: 0 !important; border: 0; white-space: normal !important; }
    html.sg-modern.sg-theme-d .sg-cat-list table.dataTable tbody td.dataTables_empty { grid-column: 1 / -1; padding: 24px 0 !important; text-align: center; }
    html.sg-modern.sg-theme-d #user-product-types tbody td:nth-child(n+3):not(:last-child) { display: none; }
    html.sg-modern.sg-theme-d .sg-cat-import-list .sg-cat-list table.dataTable tbody tr { grid-template-columns: auto auto minmax(0, 1fr); }
    html.sg-modern.sg-theme-d .sg-cat-import-list .sg-cat-list table.dataTable tbody td:nth-child(n+4) { display: none; }
    html.sg-modern.sg-theme-d .sg-cat-import-list .sg-cat-list table.dataTable tbody td:first-child { width: auto !important; }
    /* The meta line stands in for the hidden cells, so it carries every one of their values. */
    html.sg-modern.sg-theme-d .sg-cat-meta { display: block; margin-top: 2px; color: var(--d-ink-2); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
    html.sg-modern.sg-theme-d .sg-cat-meta-pair { white-space: nowrap; }
    html.sg-modern.sg-theme-d .sg-cat-list .sg-open { width: 40px; padding: 0; justify-content: center; }
    html.sg-modern.sg-theme-d .sg-cat-list .sg-open span { display: none; }
    html.sg-modern.sg-theme-d .sg-cat-list .dataTables_info { padding-top: 14px; }

    html.sg-modern.sg-theme-d .sg-cat-section > .card-block { padding: 18px 16px; }
    html.sg-modern.sg-theme-d .sg-cat-frame-media { grid-template-columns: 88px minmax(0, 1fr); gap: 14px; }
    html.sg-modern.sg-theme-d .sg-cat-frame-preview { height: 168px; }
    html.sg-modern.sg-theme-d .sg-cat-frame-acts .btn { width: 100%; white-space: normal; }
    html.sg-modern.sg-theme-d .sg-cat-override { grid-template-columns: 1fr; padding-right: 20px; }
    html.sg-modern.sg-theme-d .sg-cat-pricing .sg-cat-rounding { flex-basis: 100%; }
    html.sg-modern.sg-theme-d .sg-cat-pricing #apply-multiplier { margin-left: 0; width: 100%; }
    html.sg-modern.sg-theme-d .sg-cat-actions { justify-content: stretch; }
    html.sg-modern.sg-theme-d .sg-cat-actions-secondary { width: 100%; margin: 0; }
    html.sg-modern.sg-theme-d .sg-cat-actions .btn { flex: 1 1 auto; }
    html.sg-modern.sg-theme-d .sg-cat-actions > .btn,
    html.sg-modern.sg-theme-d .sg-cat-actions > button[type=submit] { width: 100%; }

    html.sg-modern.sg-theme-d .sg-cat-danger .btn { width: 100%; font-size: 13px; }
    html.sg-modern.sg-theme-d .sg-cat-option { grid-template-columns: 1fr; }
    html.sg-modern.sg-theme-d .sg-cat-option .btn { grid-column: auto; width: 100%; }
}

@media (max-width: 575.98px) {
    html.sg-modern.sg-theme-d .sg-cat-tab-long { display: none; }
    html.sg-modern.sg-theme-d .sg-cat-tab-short { display: inline; }
}
