/* FancyStudio_QuickOrderGrid - Quick Order Grid Styles
 *
 * Cross-platform CSS (Magento + PrestaShop).
 * All sizes in px — Magento Blank/Luma sets html { font-size: 62.5% } (1rem = 10px),
 * PrestaShop uses Bootstrap (1rem = 16px). Using px avoids both issues.
 *
 * Button visuals replicate Bootstrap 4 btn-outline-secondary / btn-light
 * so the rendered result is identical on both platforms.
 */

/* Visually hide page title but keep for screen readers */
.quickorder-index-index .page-title-wrapper {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Navigation button */
.btn-quick-order {
    display: flex;
    align-items: center;
}

/* Add to cart button in grid */
#myGrid .btn-add-to-cart {
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    border-radius: 50%;
    color: white;
    border: none;
    min-width: auto;
    background-color: var(--qog-primary, #1979c3);
    cursor: pointer;
}

#myGrid .btn-add-to-cart:hover {
    background-color: #006bb4;
}

#myGrid .btn-add-to-cart.btn-cart-disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: auto;
}

#myGrid .btn-add-to-cart svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Grid header - search + category filter */
.qog-grid-header {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.qog-search-wrap {
    flex: 1;
    position: relative;
}

#qog-quickorder-wrap .qog-search-input {
    width: 100% !important;
    height: 50px !important;
    padding: 0 40px 0 16px !important;
    border: 1px solid #c2c2c2 !important;
    border-radius: 3px !important;
    font-size: 14px !important;
    background-color: white !important;
    line-height: normal !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    box-shadow: none !important;
}

#qog-quickorder-wrap .qog-search-input:focus {
    outline: none !important;
    border-color: #333 !important;
    box-shadow: none !important;
}

#qog-quickorder-wrap .qog-search-input::-webkit-input-placeholder {
    color: #bbb !important;
    opacity: 1 !important;
    font-weight: normal !important;
}

#qog-quickorder-wrap .qog-search-input::-moz-placeholder {
    color: #bbb !important;
    opacity: 1 !important;
    font-weight: normal !important;
}

#qog-quickorder-wrap .qog-search-input:-ms-input-placeholder {
    color: #bbb !important;
    opacity: 1 !important;
    font-weight: normal !important;
}

#qog-quickorder-wrap .qog-search-input:-moz-placeholder {
    color: #bbb !important;
    opacity: 1 !important;
    font-weight: normal !important;
}

#qog-quickorder-wrap .qog-search-input::placeholder {
    color: #bbb !important;
    opacity: 1 !important;
    font-weight: normal !important;
}

.qog-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    pointer-events: none;
}

.qog-category-wrap {
    flex: 1;
}

/* Tag filter pills - above toolbar */
.qog-predefined-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.qog-filter-pill {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    padding: 5px 14px;
    border-radius: 50px;
    border: 1px solid var(--qog-border-color, #6c757d);
    background: transparent;
    color: var(--qog-text-color, #6c757d);
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
}

.qog-filter-pill:hover {
    background: #6c757d;
    color: #fff;
}

.qog-filter-pill.active {
    background: #1979c3;
    border-color: #1979c3;
    color: #fff;
}

.qog-filter-pill.active:hover {
    background: #006bb4;
    border-color: #006bb4;
}

.qog-clear-filters {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 2px 6px;
}

.qog-clear-filters:hover {
    color: #333;
}

/* Toolbar (PS parity — flex-wrap for responsive) */
.qog-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
    padding: 6px 0;
    margin-bottom: 4px;
}

.qog-toolbar-left,
.qog-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Base button = Bootstrap btn-outline-secondary btn-sm */
.qog-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 4px;
    white-space: nowrap;
    line-height: 1.4;
    border: 1px solid #6c757d;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    text-decoration: none;
}

.qog-toolbar-btn:hover {
    background: var(--qog-button-hover-bg, #6c757d);
    border-color: var(--qog-button-hover-bg, #6c757d);
    text-decoration: none;
    color: #fff;
}

.qog-toolbar-btn:focus {
    outline: none;
    box-shadow: none;
}

.qog-toolbar-btn svg {
    flex-shrink: 0;
}

.qog-toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Icon button variant = Bootstrap btn-light btn-sm */
.qog-toolbar-icon {
    padding: 6px 8px;
    border-color: #f8f9fa;
    background: #f8f9fa;
    color: #212529;
}

.qog-toolbar-icon:hover {
    background: #e2e6ea;
    border-color: #dae0e5;
    color: #212529;
}

/* Dropdown */
.qog-dropdown {
    position: relative;
}

.qog-dropdown-toggle .qog-chevron {
    margin-left: 2px;
}

.qog-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 160px;
    margin-top: 4px;
    padding: 4px 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.qog-dropdown.open .qog-dropdown-menu {
    display: block;
}

.qog-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 12px;
    border: none !important;
    background: none;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    box-shadow: none !important;
    text-align: left;
}

.qog-dropdown-item svg {
    flex-shrink: 0;
}

.qog-dropdown-item:hover {
    background-color: #f5f5f5;
    border: none;
    outline: none;
    box-shadow: none;
}

.qog-dropdown-header {
    display: block;
    padding: 4px 12px 2px;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qog-dropdown-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qog-dropdown-menu--right {
    left: auto;
    right: 0;
    max-height: 70vh;
    max-height: 70dvh;
    overflow-y: auto;
}

.qog-dropdown-divider {
    height: 1px;
    margin: 4px 0;
    background-color: #e5e5e5;
}

/* Cart badge - visible only in fullscreen */
#qog-quickorder-wrap .qog-cart-badge {
    display: none !important;
    text-decoration: none;
}

#qog-quickorder-wrap.qog-fullscreen .qog-cart-badge {
    display: inline-flex !important;
}

.qog-cart-count {
    font-weight: 600;
    font-size: 13px;
    min-width: 20px;
    text-align: center;
}

/* Fullscreen mode */
#qog-quickorder-wrap.qog-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: white;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#qog-quickorder-wrap.qog-fullscreen .qog-grid-container {
    flex: 1;
    height: auto !important;
    min-height: 0;
}

#qog-quickorder-wrap.qog-fullscreen #myGrid {
    min-height: 0;
}

#qog-quickorder-wrap.qog-fullscreen .qog-grid-header {
    margin-bottom: 8px;
}

#qog-quickorder-wrap.qog-fullscreen .qog-toolbar {
    margin-bottom: 2px;
}

/* Grid container */
.qog-grid-container {
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

#myGrid {
    flex: 1;
    width: 100%;
    height: 600px;
    min-height: 400px;
}

/* AG Grid legacy theme generates an extra wrapper div — ensure it inherits height */
#myGrid > div {
    height: 100% !important;
}

/* Footer */
.qog-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 24px;
    padding: 16px 0;
    background: white;
    position: sticky;
    bottom: 0;
    z-index: 10;
    border-top: 1px solid #e0e0e0;
}

.qog-totals {
    display: flex;
    align-items: center;
    gap: 20px;
}

.qog-total-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qog-total-label {
    font-size: 14px;
    color: #666;
}

.qog-total-value {
    font-size: 16px;
    font-weight: 600;
    color: #222;
}

button#bulk_fancy_add_to_cart {
    margin: 0;
}

button#bulk_fancy_add_to_cart:disabled {
    opacity: .55;
    cursor: progress;
}

/* While an add-to-cart request is in flight the per-row buttons are inert too:
   Quote::addProduct() is cumulative, so a second click would duplicate lines.
   The buttons live in AG Grid cells that re-render, so this is a container
   class rather than a disabled attribute on each button. */
.qog-cart-busy #myGrid .btn-add-to-cart {
    pointer-events: none;
    opacity: .55;
}

/* Money columns: amounts right-aligned (header too), so a price with the volume-pricing icon
   and one without line up. Same rule as the other platforms (hub shared/columns/README.md). */
#myGrid .ag-cell.qog-cell-num {
    justify-content: flex-end;
    font-variant-numeric: tabular-nums;
}
#myGrid .ag-cell.qog-cell-num .qog-price-wrap {
    align-items: flex-end;
}
#myGrid .ag-cell.qog-cell-num .qog-price-line {
    justify-content: flex-end;
}

/* Grid cell styles (PS parity — ellipsis for overflow text) */
.ag-cell-centered {
    display: flex !important;
    align-items: center;
    height: 100% !important;
    overflow: hidden;
}
.ag-cell-centered .ag-cell-wrapper {
    overflow: hidden;
    min-width: 0;
}
.ag-cell-centered .ag-cell-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Image cell — prevent ellipsis clipping on images */
#myGrid .ag-cell img {
    object-fit: contain;
    max-height: 100%;
}
#myGrid .ag-cell[col-id="image"] .ag-cell-wrapper {
    overflow: visible;
}
/* The thumbnail stays inside its 56px row. "max-height: 100%" above resolves against a wrapper with no
   height, so it limits nothing and outranks .qog-product-image's 50px: the image took the cell's width
   and the height of its proportions — 86px in a 55px row on a phone (59px on a desktop) — and spilled
   over the rows around it and out from under the pinned Qty column (Android emulator, 1.11.2026). */
#myGrid .ag-cell img.qog-product-image {
    max-height: 50px;
    max-width: 100%;
}
#myGrid .ag-cell[col-id="image"] {
    overflow: hidden;
}

#myGrid .ag-cell.qog-cell-qty {
    background-color: rgba(13, 110, 253, 0.06);
}

#myGrid .ag-header-cell.qog-header-qty {
    background-color: rgba(13, 110, 253, 0.08);
}

#myGrid .ag-cell.qog-cell-sum {
    background-color: rgba(25, 135, 84, 0.06);
}

#myGrid .ag-header-cell.qog-header-sum {
    background-color: rgba(25, 135, 84, 0.08);
}

#myGrid input[type="number"] {
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
}

/* TreeselectJS Integration */
#qog-treeselect-container {
    width: 100%;
}

#qog-treeselect-container .treeselect-input {
    border: 1px solid #c2c2c2 !important;
    border-radius: 3px !important;
    font-size: 14px !important;
    min-height: 50px !important;
    height: auto !important;
    padding: 0 40px 0 16px !important;
    background-color: white !important;
    line-height: normal !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    /* allow tags to wrap */
}

#qog-treeselect-container .treeselect-input:hover,
#qog-treeselect-container .treeselect-input--focused {
    border-color: #333 !important;
    box-shadow: none !important;
}

#qog-treeselect-container .treeselect-input__edit {
    font-size: 14px;
    line-height: 1.5;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    height: auto !important;
    box-shadow: none !important;
    margin: 0 !important;
    min-height: unset !important;
    outline: none !important;
}

#qog-treeselect-container .treeselect-input__edit:focus {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

#qog-treeselect-container .treeselect-input__edit::-webkit-input-placeholder {
    color: #bbb !important;
    opacity: 1 !important;
    font-weight: normal !important;
}

#qog-treeselect-container .treeselect-input__edit::-moz-placeholder {
    color: #bbb !important;
    opacity: 1 !important;
    font-weight: normal !important;
}

#qog-treeselect-container .treeselect-input__edit:-ms-input-placeholder {
    color: #bbb !important;
    opacity: 1 !important;
    font-weight: normal !important;
}

#qog-treeselect-container .treeselect-input__edit:-moz-placeholder {
    color: #bbb !important;
    opacity: 1 !important;
    font-weight: normal !important;
}

#qog-treeselect-container .treeselect-input__edit::placeholder {
    color: #bbb !important;
    opacity: 1 !important;
    font-weight: normal !important;
}

#qog-treeselect-container .treeselect__tag {
    background-color: #1979c3;
    color: white;
    border-radius: 3px;
    padding: 4px 8px;
    margin: 2px;
    font-size: 14px;
}

#qog-treeselect-container .treeselect__tag-remove {
    color: white;
    opacity: 0.7;
}

#qog-treeselect-container .treeselect__tag-remove:hover {
    opacity: 1;
}

#qog-treeselect-container .treeselect-list {
    max-height: 350px;
    border-color: #c2c2c2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

#qog-treeselect-container .treeselect-list__item:hover {
    background-color: #f8f9fa;
}

#qog-treeselect-container .treeselect-list__item--selected {
    background-color: #e7f3ff;
}

/* Image modal */
.qog-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qog-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    max-height: 90dvh;
    overflow: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.qog-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.qog-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.qog-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    color: #666;
}

.qog-modal-close:hover {
    color: #000;
}

.qog-modal-body {
    padding: 16px;
    text-align: center;
}

.qog-modal-body img {
    max-width: 100%;
    max-height: 80vh;
    max-height: 80dvh;
    height: auto;
}

/* Modal size variants */
.qog-modal-content--sm {
    width: 400px;
}

.qog-modal-content--md {
    width: 560px;
}

.qog-modal-body--left {
    text-align: left;
}

.qog-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    gap: 8px;
}

/* Quick Paste modal */
.qog-paste-textarea {
    width: 100%;
    min-height: 200px;
    padding: 10px;
    font-family: monospace;
    font-size: 13px;
    border: 1px solid #c2c2c2;
    border-radius: 3px;
    resize: vertical;
    box-sizing: border-box;
    margin-top: 8px;
}

.qog-paste-textarea:focus {
    outline: none;
    border-color: #333;
}

/* Save Order modal */
.qog-save-input {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #c2c2c2;
    border-radius: 3px;
    box-sizing: border-box;
    margin-top: 8px;
}

.qog-save-input:focus {
    outline: none;
    border-color: #333;
}

/* Load Order modal - saved orders list */
.qog-saved-orders-list {
    min-height: 100px;
}

.qog-saved-order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.qog-saved-order-item:last-child {
    border-bottom: none;
}

.qog-saved-order-info {
    flex: 1;
}

.qog-saved-order-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.qog-saved-order-date {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.qog-saved-order-actions {
    display: flex;
    gap: 6px;
}

.qog-saved-order-actions button {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
    border: 1px solid #c2c2c2;
    background: #fff;
    color: #333;
}

.qog-saved-order-actions button:hover {
    background: #f5f5f5;
}

.qog-saved-order-actions .qog-btn-overwrite {
    color: #e68a00;
    border-color: #e68a00;
}

.qog-saved-order-actions .qog-btn-overwrite:hover {
    background: #e68a00;
    color: #fff;
}

.qog-saved-order-actions .qog-btn-delete {
    color: #e02b27;
    border-color: #e02b27;
}

.qog-saved-order-actions .qog-btn-delete:hover {
    background: var(--qog-sale-badge-bg, #e02b27);
    color: #fff;
}

.qog-saved-order-badge-local {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    background: #ffc107;
    color: #333;
    vertical-align: middle;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Scanner modal */
#qog-scanner-viewport {
    width: 100%;
    min-height: 300px;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

.qog-scanner-result {
    margin-top: 12px;
    text-align: center;
    font-size: 14px;
    color: #333;
    min-height: 24px;
}

.qog-scanner-manual {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.qog-scanner-manual input {
    flex: 1;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #c2c2c2;
    border-radius: 3px;
}

/* Image hover preview */
.qog-image-preview {
    position: fixed;
    z-index: 10000;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    padding: 6px;
    pointer-events: none;
    max-width: 300px;
}

.qog-image-preview img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Product badges in grid */
.qog-badges {
    display: flex;
    gap: 4px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.qog-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.qog-badge--new {
    background-color: #1979c3;
    color: #fff;
}

.qog-badge--sale {
    background-color: #e02b27;
    color: #fff;
}

/* A product Not Visible Individually, listed for a rep ordering for a customer. Two words in a phone's
   ~100px name column: not upper case, never wider than the cell (a longer translation ends in "…",
   the whole text is in its title) — "HIDDEN PRODUC" was cut on Android, 1.11.2026. */
.qog-badge--private {
    background-color: #514943;
    color: #fff;
    text-transform: none;
    letter-spacing: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: top;
}
.qog-badges {
    max-width: 100%;
}
/* A phone's name column (~100px, the compact layout of shared/mobile): the two words fit at 10px, also in
   Safari's wider font ("Hidden prod…" on iOS at 11px) */
.qog-compact .qog-badge--private {
    font-size: 10px;
    padding: 1px 4px;
}

/* Toastr overrides */
#toast-container>.toast {
    background-color: #030303;
    opacity: 1 !important;
}

#toast-container>.toast-success {
    background-color: #51A351;
}

#toast-container>.toast-error {
    background-color: #BD362F;
}

#toast-container>.toast-info {
    background-color: #2F96B4;
}

#toast-container>.toast-warning {
    background-color: #F89406;
}

/* ── Import CSV modal ─────────────────────────────────────────────── */
.qog-import-modal-content .qog-modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 120px);
    max-height: calc(90dvh - 120px);
}

.qog-import-modal-content {
    background: #fff;
    border-radius: 8px;
    width: calc(100vw - 2rem);
    max-width: 1200px;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.qog-import-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.qog-import-header .qog-modal-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.qog-import-settings {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    font-size: 13px;
}

.qog-import-settings label {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.qog-import-settings select {
    padding: 2px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.qog-import-table-wrap {
    overflow: auto;
    flex: 1;
    min-height: 120px;
}

#qog-import-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#qog-import-table thead th {
    background: #f5f5f5;
    padding: 4px 8px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid #ddd;
}

.qog-import-label-row th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #e8e8e8 !important;
    font-weight: 600;
    font-size: 12px;
    color: #555;
}

.qog-import-select-row th {
    position: sticky;
    top: 25px;
    z-index: 2;
    background: #f5f5f5 !important;
    padding: 4px 6px !important;
}

.qog-import-map-select {
    width: 100%;
    padding: 3px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
}

#qog-import-table tbody td {
    padding: 4px 8px;
    border-bottom: 1px solid #eee;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

#qog-import-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.qog-import-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
    gap: 12px;
}

.qog-import-footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.qog-import-row-count {
    color: #666;
}

.qog-import-validation {
    color: #dc3545;
    font-size: 12px;
}

.qog-import-actions {
    display: flex;
    gap: 8px;
}

#qog-import-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Quick Paste preview ─────────────────────────────────────────── */
.qog-paste-controls {
    margin-bottom: 10px;
}

.qog-paste-controls label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.qog-paste-controls select {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.qog-paste-summary {
    padding: 8px 12px;
    background: #f0f4f8;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 13px;
}

.qog-paste-not-found {
    color: #dc3545;
}

.qog-paste-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.qog-paste-actions .action.secondary {
    font-size: 12px;
    padding: 4px 10px;
}

.qog-paste-results {
    max-height: 300px;
    overflow-y: auto;
}

.qog-paste-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin-bottom: 6px;
    background: #fff;
}

.qog-paste-card:hover {
    background: #f8f9fa;
}

.qog-paste-card label {
    flex-shrink: 0;
}

.qog-paste-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.qog-paste-card-name {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qog-paste-card-ref {
    font-size: 11px;
    color: #888;
}

.qog-paste-qty {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
    flex-shrink: 0;
}

.qog-paste-not-found-list {
    padding: 8px 12px;
    background: #fff5f5;
    border: 1px solid #fee;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 12px;
    color: #c00;
}

/* ── Scanner — dark theme modal ───────────────────────────────────── */
.qog-scanner-modal-content {
    background: #111;
    color: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 540px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.qog-scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #333;
}

.qog-scanner-header .qog-modal-title {
    color: #fff;
    font-size: 16px;
    margin: 0;
}

.qog-scanner-header .qog-modal-close {
    color: #999;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.qog-scanner-header .qog-modal-close:hover {
    color: #fff;
}

.qog-scanner-viewport-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000;
    overflow: hidden;
}

#qog-scanner-viewport {
    width: 100%;
    height: 100%;
}

#qog-scanner-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qog-scanner-target {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 30%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.qog-scanner-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid #333;
    font-size: 13px;
    min-height: 38px;
}

.qog-scanner-status {
    color: #aaa;
}

.qog-scanner-last {
    color: #22c55e;
    font-family: monospace;
    font-size: 14px;
}

.qog-scanner-manual {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #333;
}

.qog-scanner-manual input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #222;
    color: #fff;
    font-size: 14px;
}

.qog-scanner-manual input::placeholder {
    color: #666;
}

/* ── Hardware scanner badge (green pulsing dot) ──────────────────── */
.qog-hw-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    margin-left: 4px;
    animation: qog-pulse 1.5s infinite;
}

@keyframes qog-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.qog-hw-status {
    font-size: 11px;
    color: #22c55e;
    margin-left: auto;
    padding-left: 8px;
}

/* ── Row flash highlight animation ───────────────────────────────── */
@keyframes qog-row-flash {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(76, 175, 80, 0.3); }
}

.ag-row.qog-row-flash {
    animation: qog-row-flash 0.5s ease 3;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .qog-grid-header {
        flex-direction: column;
    }

    #qog-treeselect-container .treeselect-list {
        max-height: 300px;
    }

    #qog-treeselect-container .treeselect__tag {
        font-size: 12px;
        padding: 3px 6px;
    }
}

@media screen and (max-width: 576px) {
    .qog-footer {
        flex-wrap: wrap;
        gap: 12px;
    }

    .qog-totals {
        width: 100%;
        justify-content: flex-end;
    }
}

/* "My order" toggle button */
.qog-ordered-count {
    background-color: #0d6efd;
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 10px;
    padding: 0 5px;
    text-align: center;
    display: inline-block;
}

#qog-show-ordered.qog-ordered-active {
    background-color: var(--qog-primary, #0d6efd);
    border-color: var(--qog-primary, #0d6efd);
    color: white;
}

#qog-show-ordered.qog-ordered-active .qog-ordered-count {
    background-color: white;
    color: #0d6efd;
}

#qog-show-ordered.qog-ordered-active:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    color: white;
}

/* Quick Paste modal */
.qog-paste-info {
    background: #e8f4fd;
    border: 1px solid #b6d4fe;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #084298;
}

.qog-paste-controls {
    margin-bottom: 15px;
}

.qog-paste-controls label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.qog-paste-controls select {
    max-width: 300px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.qog-paste-textarea {
    width: 100%;
    min-height: 200px;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

.qog-paste-summary {
    padding: 8px 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.qog-paste-summary svg {
    vertical-align: middle;
}

.qog-paste-not-found-list {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff5f5;
    border: 1px solid #fee;
    border-radius: 4px;
    font-size: 12px;
    color: #c00;
    word-break: break-all;
}

#qog-paste-grid {
    border: 1px solid #ddd;
    border-radius: 4px;
}

.qog-stock-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.qog-stock-green { background-color: #22c55e; }
.qog-stock-orange { background-color: #f59e0b; }
.qog-stock-red { background-color: #ef4444; }

/* Reset order button */
.qog-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid #6c757d;
    border-radius: 4px;
    background: transparent;
    color: #6c757d;
    font-size: 13px;
    cursor: pointer;
    margin-right: auto;
}

.qog-reset-btn:hover {
    background: #6c757d;
    color: #fff;
    border-color: #6c757d;
}

/* Price discount display */
.qog-price-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.qog-price-line {
    white-space: nowrap;
}

.qog-price-new {
    font-weight: 600;
    color: #e02b27;
}

.qog-price-old {
    text-decoration: line-through;
    color: #999;
    font-size: 11px;
}

.qog-fpt-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2px;
    color: #6b7280;
    font-size: 10px;
    line-height: 1.25;
    white-space: normal;
}

.qog-fpt-attribute,
.qog-fpt-final {
    display: block;
}

.qog-fpt-final {
    color: #374151;
    margin-top: 1px;
}

.qog-price-policy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #6b7280;
    font-size: 11px;
    line-height: 1.2;
    white-space: normal;
}

.qog-price-policy small {
    font-size: 10px;
}

.qog-map-reveal {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--qog-primary, #1979c3);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.qog-price-policy--blocked {
    color: #9b2c2c;
}

.qog-row-price-policy-blocked {
    opacity: 0.62;
}

/* Qty editor (PS parity) */
.qog-qty-editor {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

.qog-qty-editor-input {
    width: 100%;
    height: 100%;
    border: 1px solid #1979c3;
    padding: 0 6px;
    font-size: 14px;
    text-align: center;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.qog-qty-editor-input.qog-qty-input-warn {
    border-color: #e02b27;
    background-color: #fff5f5;
}

.qog-qty-over {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.qog-qty-max {
    font-size: 10px;
    color: #e02b27;
    white-space: nowrap;
}

/* Column toggle switches */
.qog-column-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qog-toggle-switch {
    position: relative;
    width: 34px;
    height: 18px;
    background: #ccc;
    border-radius: 9px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.qog-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.qog-column-toggle[aria-checked="true"] .qog-toggle-switch {
    background: var(--qog-primary, #1979c3);
}

.qog-column-toggle[aria-checked="true"] .qog-toggle-knob {
    transform: translateX(16px);
}

.qog-column-toggle .qog-toggle-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Flash success animation (save/reset layout) */
.qog-flash-success {
    animation: qog-flash-green 0.8s ease;
}

@keyframes qog-flash-green {
    0% { background-color: #d4edda; }
    100% { background-color: transparent; }
}

/* Row flash animation (barcode scan, import, paste) */
.ag-row.qog-row-flash {
    animation: qog-row-flash 0.8s ease-in-out 3;
}

@keyframes qog-row-flash {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(34, 197, 94, 0.3); }
}

/* ============================================================
   Responsive toolbar — progressive collapse into a mobile kebab
   ============================================================ */

/* Mobile overflow kebab is hidden on desktop; shown only <=768px. */
.qog-mobile-kebab {
    display: none;
}

/* Tablet / small laptop: keep every action on one row by dropping the
   button text labels (they remain available as native title tooltips). */
@media screen and (min-width: 769px) and (max-width: 1100px) {
    .qog-toolbar-btn > span:not(.qog-cart-count):not(.qog-ordered-count):not(.qog-hw-badge) {
        display: none;
    }
    .qog-toolbar-btn {
        padding: 6px 8px;
    }
    .qog-toolbar-left,
    .qog-toolbar-right {
        gap: 6px;
    }
    .qog-toolbar-btn .qog-chevron {
        margin-left: 2px;
    }
}

/* Mobile: single row — only primary actions + the kebab; everything else
   collapses into the kebab menu. */
@media screen and (max-width: 768px) {
    .qog-toolbar {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }
    .qog-toolbar-left,
    .qog-toolbar-right {
        flex-wrap: nowrap;
    }
    .qog-toolbar-left > *:not(.qog-mobile-primary),
    .qog-toolbar-right > *:not(.qog-mobile-primary),
    .qog-mobile-hide {
        display: none !important;
    }
    .qog-mobile-kebab {
        display: inline-block;
    }
}

/* Smallest screens: drop the Scan label too, and cap the kebab width. */
@media screen and (max-width: 480px) {
    #qog-scan-btn > span:not(.qog-hw-badge) {
        display: none;
    }
    .qog-toolbar-left,
    .qog-toolbar-right {
        gap: 5px;
    }
    .qog-kebab-menu {
        max-width: calc(100vw - 24px);
    }
}

/* Touch-friendly targets on coarse pointers. */
@media (pointer: coarse) {
    .qog-toolbar-btn,
    .qog-dropdown-item,
    .qog-filter-pill {
        min-height: 44px;
    }
}

/* Volume-pricing badge next to the unit price. A badge with a title rather than
   extra lines: grid rows have a fixed height, and a long tier ladder would
   either clip or force every row taller. Turns solid once the entered quantity
   has actually reached a break. */
/* Volume pricing: the icon and panel live in the shared core (qog-volume.css);
   these are only the module's theme variables and its place on the price line. */
.qog-vp-icon,
.qog-vp-pop {
    --qog-vp-accent: var(--qog-primary, #1979c3);
    --qog-vp-focus: rgba(25, 121, 195, 0.4);
    --qog-vp-radius: var(--qog-border-radius, 8px);
}

.qog-price-line .qog-vp-icon {
    vertical-align: middle;
    margin-left: 4px;
}

/* Reorder picker */
.qog-reorder-note {
    margin: 0 0 12px;
    font-size: 12px;
    color: #666;
}
.qog-btn-reorder {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: var(--qog-border-radius, 4px);
    border: 1px solid var(--qog-primary, #1979c3);
    background: var(--qog-primary, #1979c3);
    color: #fff;
    cursor: pointer;
}
.qog-btn-reorder:disabled {
    opacity: .55;
    cursor: progress;
}

/* Back-in-stock control. Lives in the stock cell so it has a home in both stock
   display modes — the cart-button column is optional and the colour dot exists
   in only one of them. */
.qog-stock-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.qog-stock-alert {
    padding: 0 5px;
    border: 1px solid var(--qog-border-color, #ddd);
    border-radius: var(--qog-border-radius, 4px);
    background: #fff;
    font-size: 12px;
    line-height: 17px;
    color: var(--qog-primary, #1979c3);
    cursor: pointer;
}
.qog-stock-alert:hover {
    background: var(--qog-button-hover-bg, #f5f5f5);
}
.qog-stock-alert--done {
    border-color: #2e7d32;
    color: #2e7d32;
    cursor: default;
}

/* ── Initial visibility, moved out of the markup ──────────────────────────────
   These used to be style="display:none" attributes. A strict Content Security
   Policy without 'unsafe-inline' in style-src blocks style attributes in HTML,
   so the starting state lives here instead. Note this is only about the markup:
   a CSP does not stop JavaScript from assigning element.style.display, which is
   how the modals still open — an inline display beats this class.

   Anything toggled by *removing* an inline display (rather than setting one) has
   to toggle this class instead, or it will stay hidden. There is one such place
   and it is the hardware-scanner badge. */
.qog-hidden {
    display: none;
}

.qog-modal-body--padded {
    padding: 20px;
}

.qog-paste-grid {
    width: 100%;
    height: 180px;
}

/* ── "Add another line" in My order (shared core: qog-add-line.css) ──
   The core sizes AG Grid's own boxes for the invoice layout (a short order at
   its natural height); these are this module's boxes around the grid, whose
   fixed minimums would otherwise keep a two-line order 600 px tall. */
#qog-quickorder-wrap.qog-order-mode:not(.qog-fullscreen) .qog-grid-container,
#qog-quickorder-wrap.qog-order-mode:not(.qog-fullscreen) #myGrid {
    min-height: 0;
    height: auto;
}

/* In fullscreen the grid flexes; the button must not take its space. */
.qog-fullscreen .qog-add-row-btn {
    flex: 0 0 auto;
}

/* Screen-reader-only live region for the search's announcements. */
.qog-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* The search row's placeholder sits in the Name column, which is narrower than
   the text in most layouts: end it with an ellipsis rather than a hard cut. */
#myGrid .qog-entry-placeholder {
    overflow: hidden;
}
#myGrid .qog-entry-placeholder span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Product renderers and saved-order messages use external CSS for CSP. */
.qog-product-link { cursor: pointer; }
.qog-product-link--plain { cursor: text; color: inherit; }
.qog-product-name { white-space: break-spaces; margin-bottom: 0; line-height: 1.25em; }
.qog-product-image { max-height: 50px; width: auto; height: auto; padding: 2px 0; object-fit: contain; }
.qog-product-image-zoom { cursor: pointer; }
.qog-attribute-label { color: #888; font-size: 11px; }
.qog-empty-message { text-align: center; color: #999; }
.qog-empty-message-padded { padding: 20px; }

/* Keep the phone quantity editor readable at its native viewport scale. */
@media screen and (max-width: 600px) {
    .ag-theme-alpine input.qog-qty-editor-input { font-size: 16px; }
}

/* ── The phone's order screen (hub shared/mobile orderScreen; quickorder.js startPhoneScreen) ──
   The core lays the screen out (.qog-mobile-order, .qog-m-*); here only what is Magento's own markup:
   the toolbar's menu at the end of the bar, its phone-only items, and the short footer. */
.qog-kebab-phone {
    display: none;
}
.qog-mobile-order .qog-kebab-phone {
    display: block;
}
.qog-mobile-order .qog-mobile-kebab {
    display: block !important;
    /* The menu is placed against the bar, not the button */
    position: static;
}
.qog-mobile-order #qog-mobile-more-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    /* The same as the core's funnel beside it */
    border: 1px solid #c8cdd2;
    border-radius: var(--qog-border-radius, 4px);
    background: #fff;
    color: #333;
}
.qog-mobile-order .qog-mobile-kebab.open #qog-mobile-more-btn {
    background: #333;
    border-color: #333;
    color: #fff;
}
.qog-mobile-order .qog-mobile-kebab .qog-kebab-menu {
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    margin: 0;
    border: 0;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0;
    max-height: calc(100svh - 56px - env(safe-area-inset-top, 0px));
    overflow-y: auto;
}
.qog-mobile-order .qog-kebab-menu .qog-dropdown-item {
    min-height: 44px;
    padding-left: 16px;
    padding-right: 16px;
}
.qog-kebab-count {
    margin-left: auto;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #eef1f4;
    color: #333;
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}
.qog-kebab-count[hidden] {
    display: none;
}
.qog-mobile-order .qog-search-wrap .qog-search-input {
    height: 44px;
}
.qog-mobile-order .qog-m-panel .qog-category-wrap,
.qog-mobile-order .qog-m-panel .qog-predefined-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* On a phone (.qog-phone, client or server mode) the footer is two short lines: the totals on the
   left with their amounts right-aligned under each other, reset and quote below them, the button
   on the right level with the totals (spec §2.6) */
#qog-quickorder-wrap.qog-phone .qog-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "totals button" "meta button";
    align-items: center;
    column-gap: 12px;
    row-gap: 2px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
}
#qog-quickorder-wrap.qog-phone .qog-totals {
    grid-area: totals;
    display: grid;
    grid-template-columns: auto auto;
    column-gap: 8px;
    row-gap: 0;
    align-items: baseline;
    justify-content: start;
    width: auto;
}
#qog-quickorder-wrap.qog-phone .qog-total-item {
    display: contents;
}
#qog-quickorder-wrap.qog-phone .qog-total-label {
    font-size: 12px;
}
#qog-quickorder-wrap.qog-phone .qog-total-value {
    font-size: 15px;
    justify-self: end;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
#qog-quickorder-wrap.qog-phone #qog-reset-order {
    grid-area: meta;
    justify-self: start;
    font-size: 12px;
}
#qog-quickorder-wrap.qog-phone #qog_request_quote {
    grid-area: meta;
    justify-self: end;
    font-size: 12px;
}
#qog-quickorder-wrap.qog-phone #bulk_fancy_add_to_cart {
    grid-area: button;
    align-self: start;
    max-width: 7.5rem;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.2;
    white-space: normal;
}

/* A line whose add to cart could not be confirmed (spec M13): marked until the buyer edits it */
#myGrid .ag-row.qog-row-cart-uncertain {
    background: #fff8e1;
    box-shadow: inset 3px 0 0 #f0ad4e;
}

/* A visitor without prices (General > Visitors who cannot see prices = browse; hub shared/no-prices):
   nothing to order, so no "My order", no totals; the row counter stays. */
#qog-quickorder-wrap.qog-np #qog-show-ordered,
#qog-quickorder-wrap.qog-np #qog-kebab-ordered,
#qog-quickorder-wrap.qog-np .qog-totals,
#qog-quickorder-wrap.qog-np #qog-reset-order {
    display: none !important;
}

/* AG Grid 36 renders rows and pinned columns in one scrolling container (.ag-grid-viewport); the shared
   cores add-line 1.2.2 and mobile 1.0.1 still name AG 35's containers. Until the cores move (hub), the
   same rules for AG 36's classes live here. Remove when the cores carry them. */
.qog-order-mode:not(.qog-fullscreen) .ag-root-wrapper-body,
.qog-order-mode:not(.qog-fullscreen) .ag-grid-viewport,
.qog-order-mode:not(.qog-fullscreen) .ag-grid-scrolling-container {
    min-height: 0 !important;
}
.qog-compact .ag-grid-pinned-right-cells {
    box-shadow: -6px 0 6px -6px rgba(0, 0, 0, 0.35);
}
/* AG Grid 36 sizes an auto-height grid (My order, the add-line entry) with --ag-auto-height-max-body-height,
   a Theming API parameter the legacy alpine CSS does not define (warning #9). "none" is its default. */
.ag-theme-alpine {
    --ag-auto-height-max-body-height: none;
}

/* Volume popover: how much of the tier the cart already counts (Magento code, the shared volume core
   1.0.0 has no such line yet) */
.qog-vp-pop .qog-vp-cart {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 12px;
    color: #4b5563;
}

/* Sticky horizontal scrollbar (M09, grid-functions attachStickyScroll): at the bottom of the window over
   the scrolling columns while the grid's own scrollbar is below the window. Styled so that it stays
   visible on macOS too, where scrollbars otherwise only show while scrolling. */
.qog-hscroll {
    position: fixed;
    bottom: 0;
    height: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #fff;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
    z-index: 90;
}
.qog-hscroll[hidden] { display: none !important; }
.qog-hscroll-inner { height: 1px; }
.qog-hscroll::-webkit-scrollbar { height: 14px; }
.qog-hscroll::-webkit-scrollbar-track { background: #f1f2f4; }
.qog-hscroll::-webkit-scrollbar-thumb { background: #b5bac1; border-radius: 7px; border: 3px solid #f1f2f4; }
.qog-hscroll::-webkit-scrollbar-thumb:hover { background: #8f959e; }


/* ── Order for customers (shared core sales-rep): what the mode takes away on this grid ──
   The core puts qog-staff-mode on #qog-quickorder-wrap while a rep orders for a customer. The rep's own cart and
   templates have no place in it (the cart and save paths also refuse in script: fn.salesRepMode); the footer
   sums are hidden while the table does not show this customer's prices yet (qog-staff-hide-totals). */
.qog-staff-mode #qog-cart-badge,
.qog-staff-mode #bulk_fancy_add_to_cart,
.qog-staff-mode #qog_request_quote,
.qog-staff-mode #qog-save-order,
.qog-staff-mode #qog-saved-orders-btn,
.qog-staff-mode #qog-reorder-btn {
    display: none !important;
}
.qog-staff-hide-totals .qog-totals {
    display: none !important;
}

/* ── Order for customers: the core's buttons, as WooCommerce draws them (qog-grid.css .qog-btn*) ──
   The core marks its buttons with the WooCommerce grid's classes; this grid has no such classes, so without these
   rules a theme without default button styles (Hyvä, Tailwind's reset) showed "Order for customers", "Review order"
   and "Confirm" as plain text. Scoped to the core's own slots so no other button of the page changes. */
.qog-sales-rep-slot .qog-btn,
.qog-sales-rep-modals .qog-btn,
#qog-quickorder-wrap .qog-btn.qog-staff-footer-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    padding: 0.35rem 0.75rem;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fff;
    color: #333;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    text-decoration: none;
}
.qog-sales-rep-slot .qog-btn:hover:not(:disabled),
.qog-sales-rep-modals .qog-btn:hover:not(:disabled) {
    background-color: #f8f9fa;
    border-color: #bbc0c7;
}
.qog-sales-rep-slot .qog-btn:disabled,
.qog-sales-rep-modals .qog-btn:disabled,
#qog-quickorder-wrap .qog-btn.qog-staff-footer-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.qog-sales-rep-slot .qog-btn-outline,
.qog-sales-rep-modals .qog-btn-outline {
    background: #fff;
    border-color: #dcdcde;
    color: #333;
}
.qog-sales-rep-slot .qog-btn-light,
.qog-sales-rep-modals .qog-btn-light {
    background: #f1f3f5;
}
.qog-sales-rep-slot .qog-btn-light:hover:not(:disabled),
.qog-sales-rep-modals .qog-btn-light:hover:not(:disabled) {
    background: #e9ecef;
}
.qog-sales-rep-slot .qog-btn-primary-outline {
    border-color: var(--qog-primary, #1979c3);
    color: var(--qog-primary, #1979c3);
}
.qog-sales-rep-slot .qog-btn-primary-outline:hover:not(:disabled) {
    border-color: var(--qog-primary, #1979c3);
    background: color-mix(in srgb, var(--qog-primary, #1979c3) 10%, white);
}
.qog-sales-rep-modals .qog-btn-primary,
#qog-quickorder-wrap .qog-btn-primary.qog-staff-footer-action {
    background: var(--qog-primary, #1979c3);
    border-color: var(--qog-primary, #1979c3);
    color: #fff;
    transition: opacity 0.15s ease;
}
.qog-sales-rep-modals .qog-btn-primary:hover:not(:disabled),
#qog-quickorder-wrap .qog-btn-primary.qog-staff-footer-action:hover:not(:disabled) {
    background: var(--qog-primary, #1979c3);
    opacity: 0.9;
}
/* The customer search and the summary's headings, as on WooCommerce (qog-grid.css #qog-wrapper .qog-search-input;
   the theme's h3 there is bold, Tailwind's reset is not). */
.qog-sales-rep-modals .qog-search-input {
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0 0.75rem;
    border: 1px solid #bbc0c7;
    border-radius: 4px;
    font-size: 1em;
    line-height: normal;
    color: #181d1f;
    background: #fff;
    box-sizing: border-box;
}
.qog-sales-rep-modals .qog-search-input:focus {
    outline: none;
    border-color: var(--qog-primary, #1979c3);
    box-shadow: 0 0 0 1px var(--qog-primary, #1979c3);
}
.qog-sales-rep-modals .qog-staff-section h3 {
    font-weight: 600;
}
