/* ==================== PRODUCTS MODULE STYLES (GENERAL) ==================== */
.products-page.active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Main grid */
.products-page .products-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: 1fr;
    gap: 15px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Left column */
.left-column-stack {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* Search card */
.search-section-card {
    background: var(--theme-card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 6px 6px 12px var(--theme-shadow-dark), -6px -6px 12px var(--shadow-light);
    padding: 12px;
    transition: all var(--transition-normal);
    border: 1px solid var(--theme-card-border);
    flex-shrink: 0;
}
.search-section-card .products-search-container {
    margin-top: 0;
}

/* Categories card */
.product-categories-card {
    background: var(--theme-card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 6px 6px 12px var(--theme-shadow-dark), -6px -6px 12px var(--shadow-light);
    padding: 16px;
    border: 1px solid var(--theme-card-border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow-y: auto;
}
.categories-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 5px;
    padding-bottom: 0;
    border-bottom: 2px solid color-mix(in srgb, var(--theme-accent) 30%, transparent);
}
.product-categories-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    font-size: 1rem;
    color: var(--text-dark);
}
.product-categories-card h3 i {
    color: var(--theme-accent);
    font-size: 1.1rem;
}
.switch-toggle-container {
    display: flex;
    justify-content: center;
    margin-top: 5px;
    margin-bottom: 12px;
    width: 100%;
}
.switch-toggle {
    display: flex;
    gap: 4px;
    background: color-mix(in srgb, var(--theme-accent) 10%, transparent);
    border-radius: 10px;
    padding: 3px;
    width: fit-content;
}
.switch-btn {
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.63rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.switch-btn i {
    font-size: 0.86rem;
}
.switch-btn.active {
    background: var(--theme-accent);
    color: white;
}
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}
.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: white;
    border-radius: 5px;
    border: 1px solid color-mix(in srgb, var(--theme-accent) 20%, transparent);
    transition: all 0.3s ease;
    cursor: pointer;
}
.category-item:hover {
    background: white;
    box-shadow: none;
    transform: translateX(3px);
}
.category-item.active {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: white;
}
.category-item.active .category-icon,
.category-item.active .category-name,
.category-item.active .category-count {
    color: white;
}
.category-name {
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}
.category-icon {
    font-size: 0.95rem;
    color: var(--theme-accent);
    width: 20px;
    text-align: center;
}
.category-count {
    font-size: 0.7rem;
    color: var(--text-light);
    background: color-mix(in srgb, var(--theme-accent) 10%, transparent);
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
}

/* Right bottom row – default ratio (right-stack reduced by 24%) */
.right-bottom-row {
    display: grid;
    grid-template-columns: 3fr 1.52fr;
    gap: 15px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}
/* When add-price is active, expand the right column */
.right-bottom-row.add-price-mode {
    grid-template-columns: 0.8fr 1.44fr;
}

/* Filter search card */
.filter-search-card {
    background: var(--theme-card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 6px 6px 12px var(--theme-shadow-dark), -6px -6px 12px var(--shadow-light);
    padding: 16px;
    border: 1px solid var(--theme-card-border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}
.filter-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 8px;
    border-bottom: 2px solid color-mix(in srgb, var(--theme-accent) 30%, transparent);
    flex-shrink: 0;
}
.filter-search-header h3 {
    font-size: 1rem;
    color: var(--text-dark);
    margin: 0;
}
.filter-search-header h3 i,
.price-updates-header h3 i,
.stock-card h3 i {
    color: var(--theme-accent);
}
.filter-search-sections {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.filter-search-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.filter-search-section.top {
    flex: 3;
    border-bottom: 1px solid color-mix(in srgb, var(--theme-accent) 20%, transparent);
    padding-bottom: 8px;
    overflow-y: auto;
    min-height: 0;
}
.filter-search-section.bottom {
    flex: 7;
    overflow-y: auto;
    min-height: 0;
}
.filter-search-section.middle {
    flex: 0 0 auto;
    max-height: 220px;
    overflow-y: auto;
    border-bottom: 1px solid color-mix(in srgb, var(--theme-accent) 20%, transparent);
    padding-bottom: 8px;
}
.filter-search-sections.top-expanded .filter-search-section.top {
    flex: 7;
}
.filter-search-sections.top-expanded .filter-search-section.bottom {
    flex: 3;
}
.filter-search-section h4 {
    font-size: 0.85rem;
    color: var(--text-dark);
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.filter-search-section h4 i {
    color: var(--theme-accent);
    font-size: 0.9rem;
}
.section-container {
    flex: 1;
    min-height: 0;
    padding-right: 12px;
}

/* Product grid */
.category-products-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}
.products-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
}
.product-box {
    background: white;
    border-radius: 5px;
    border: 1px solid color-mix(in srgb, var(--theme-accent) 20%, transparent);
    padding: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.product-box:hover {
    background: white;
    box-shadow: var(--theme-glow-box-hover);
    border-color: var(--theme-accent);
}
.product-box-name {
    font-size: 0.8rem;
    color: var(--text-dark);
    font-weight: 500;
}
.product-box-cas {
    font-size: 0.6rem;
    color: var(--text-light);
    background: color-mix(in srgb, var(--theme-accent) 5%, transparent);
    padding: 2px 4px;
    border-radius: 3px;
    display: inline-block;
}
.product-box-price {
    font-size: 0.75rem;
    color: var(--theme-accent);
    font-weight: 600;
}
.product-box-sku {
    font-size: 0.6rem;
    color: var(--text-light);
    background: color-mix(in srgb, var(--theme-accent) 10%, transparent);
    padding: 2px 4px;
    border-radius: 2px;
    display: inline-block;
}
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
    color: var(--text-light);
}
.no-results i {
    font-size: 2rem;
    margin-bottom: 8px;
    color: color-mix(in srgb, var(--theme-accent) 50%, transparent);
}
.no-results h4 {
    color: var(--text-dark);
    margin-bottom: 4px;
    font-size: 0.9rem;
}

/* Right stack (Price Updates + Stock) */
.right-stack {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}
.price-updates-card {
    background: var(--theme-card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 6px 6px 12px var(--theme-shadow-dark), -6px -6px 12px var(--shadow-light);
    padding: 16px;
    border: 1px solid var(--theme-card-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-height: 100px;
    transition: all 0.3s ease;
}
/* When add-price is active, the price card expands (width already increased by grid, but ensure content fits) */
.right-stack.add-price-active .stock-card {
    display: none;
}
.right-stack.add-price-active .price-updates-card {
    flex: 1;
    min-height: 0;
}

.price-updates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
    padding-bottom: 5px;
    border-bottom: 2px solid color-mix(in srgb, var(--theme-accent) 30%, transparent);
}
.price-updates-header h3 {
    font-size: 1rem;
    color: var(--text-dark);
    margin: 0;
}
.add-price-btn {
    background: color-mix(in srgb, var(--theme-accent) 10%, transparent);
    color: var(--theme-accent);
    border: 1px solid color-mix(in srgb, var(--theme-accent) 30%, transparent);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}
.add-price-btn i {
    font-size: 0.7rem;
}
.add-price-btn:hover {
    background: var(--theme-accent);
    color: white;
}
.price-updates-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    flex: 1;
    padding-right: 8px;
}
.price-update-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 5px;
    background: white;
    border-radius: 2px;
    border: 1px solid #eee;
}
.price-update-info {
    flex: 1;
    min-width: 0;
}
.price-update-product {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dark);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.price-update-cas {
    display: block;
    font-size: 0.6rem;
    color: var(--text-light);
    margin-top: 2px;
}
.price-update-value {
    font-size: 0.7rem;
    color: var(--theme-accent);
    font-weight: 600;
    white-space: nowrap;
    margin-left: 8px;
}

/* Stock card */
.stock-card {
    background: var(--theme-card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 6px 6px 12px var(--theme-shadow-dark), -6px -6px 12px var(--shadow-light);
    padding: 16px;
    border: 1px solid var(--theme-card-border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}
.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid color-mix(in srgb, var(--theme-accent) 30%, transparent);
    flex-shrink: 0;
}
.stock-header h3 {
    font-size: 1rem;
    color: var(--text-dark);
    margin: 0;
}
.warehouse-toggle {
    display: flex;
    gap: 4px;
    background: color-mix(in srgb, var(--theme-accent) 10%, transparent);
    border-radius: 10px;
    padding: 2px;
}
.warehouse-toggle-btn {
    padding: 3px 6px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.65rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.warehouse-toggle-btn.active {
    background: var(--theme-accent);
    color: white;
}
.stock-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    flex: 1;
    padding-right: 8px;
}
.stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9f9f9;
    border-radius: 3px;
    padding: 5px 6px;
    border: 1px solid #eee;
    min-height: 34px;
}
.stock-item-name {
    font-size: 0.7rem;
    color: var(--text-dark);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
    flex-shrink: 1;
    margin-right: 6px;
}
.stock-tubes {
    display: flex;
    gap: 3px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    max-width: 180px;
}
.stock-tube {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    background: #ccc;
    flex-shrink: 0;
}
.stock-tube.red { background: #f44336; }
.stock-tube.yellow { background: #ffeb3b; }
.stock-tube.green { background: #4caf50; }
.stock-out-message {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    max-width: 180px;
}
.stock-out-text {
    font-size: 0.65rem;
    color: #666;
    white-space: normal;
    overflow: visible;
    text-align: right;
    line-height: 1.3;
}

/* Search inside products page */
.products-search-container {
    position: relative;
    margin: 5px 0 0;
}
.products-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.95rem;
    z-index: 2;
}
.products-search-input {
    padding-left: 44px;
    font-size: 0.95rem;
    height: 42px;
    width: 100%;
}

/* ==================== ADD PRICE PANEL – TWO COLUMNS ==================== */
.add-price-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0;
}
.add-price-search {
    position: relative;
    width: 100%;
}
.add-price-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.9rem;
    z-index: 1;
}
.add-price-search-input {
    padding-left: 34px;
    width: 100%;
    height: 38px;
    font-size: 0.9rem;
}
.add-price-product-display {
    background: #f5f5f5;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 0.9rem;
    color: var(--text-dark);
    border: 1px solid color-mix(in srgb, var(--theme-accent) 20%, transparent);
}
.add-price-product-display .selected-product-label {
    font-weight: 500;
}
#selected-product-name {
    font-weight: 600;
    color: var(--theme-accent);
}

/* Two‑column layout: matrix left, grade tiles right */
.add-price-two-columns {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin: 10px 0;
}

/* Matrix container – flex column, fill height */
.price-matrix-container {
    background: #fafafa;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    padding: 12px;
    margin-bottom: 0;
    overflow-x: auto;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.price-matrix-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}
.price-matrix-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--theme-accent);
}
.no-update-grade-btn {
    background: color-mix(in srgb, var(--theme-accent) 10%, transparent);
    border: 1px solid var(--theme-accent);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--theme-accent);
    white-space: nowrap;
}
.no-update-grade-btn.active {
    background: var(--theme-accent);
    color: white;
}
.price-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    border-radius: 10px;
    overflow: hidden;
    flex: 1;
}
.price-matrix-table th,
.price-matrix-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}
.price-matrix-table th {
    background: #f0e6f5; /* light lilac */
    font-weight: 600;
}
/* Remove outer border of thead row */
.price-matrix-table thead {
    border-bottom: none;
}
.price-matrix-table thead th {
    border-top: none;
}
.price-matrix-variation-cell {
    background: #f8f9fa;
    font-weight: 500;
    text-align: left;
    position: sticky;
    left: 0;
    background-color: #f8f9fa;
    z-index: 1;
}
.price-matrix-input {
    width: 100%;
    min-width: 80px;
    padding: 6px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.price-matrix-input:disabled {
    background: #f0f0f0;
    color: #999;
}
.price-matrix-input.input-error {
    border-color: #f44336;
    background-color: #ffebee;
}

/* Lock icon styling */
.price-matrix-cell {
    position: relative;
}
.lock-icon {
    display: block;
    margin-top: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    color: #c8a2c8; /* light purple */
    transition: color 0.2s;
}
.lock-icon.active {
    color: #f44336; /* red when enabled */
}
.lock-icon:hover {
    opacity: 0.8;
}

/* Grade tiles */
.grade-tiles-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}
.grade-tile {
    background: white;
    border: 1px solid color-mix(in srgb, var(--theme-accent) 30%, transparent);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 88%;
    margin: 0 auto;
}
.grade-tile .grade-tile-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.grade-tile .grade-tile-icon {
    font-size: 1.4rem;
    color: var(--theme-accent);
}
.grade-tile .grade-tile-code {
    font-weight: 600;
    font-size: 0.9rem;
    flex: none;
    text-align: center;
    color: var(--theme-accent);
}
.grade-tile .grade-tile-name {
    font-size: 0.65rem;
    color: #aaa;
    text-align: center;
    margin-top: 0;
    line-height: 1.2;
}
.active-grade-tile {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: white;
    box-shadow: var(--theme-glow-box-hover);
}
.active-grade-tile .grade-tile-icon,
.active-grade-tile .grade-tile-code,
.active-grade-tile .grade-tile-name {
    color: white;
}
.disabled-grade-tile {
    background: #f9f9f9;
    border: 1px dashed #c8a2c8;
}
.disabled-grade-tile .grade-tile-icon,
.disabled-grade-tile .grade-tile-code {
    color: #c8a2c8;
}
.disabled-grade-tile .grade-tile-name {
    color: #aaa;
}
.grade-tile:not(.active-grade-tile):hover {
    background: color-mix(in srgb, var(--theme-accent) 10%, white);
    transform: translateY(-1px);
}
/* Optional: add a green dot for grades with price updates */
.grade-tile.has-updates {
    position: relative;
}
.grade-tile.has-updates::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background-color: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 2px rgba(0,0,0,0.2);
}

/* Reduce space between modifications and grades description */
.add-price-modifications {
    margin-bottom: 5px;
}
#grades-description {
    margin-top: 0;
    margin-bottom: 6px;
}

/* Checkbox and action buttons */
.add-price-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 8px 0;
    justify-content: center;
}
.add-price-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}
.add-price-checkbox label {
    margin: 0;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-dark);
    line-height: 1.4;
}
.add-price-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}
.add-price-apply-all-btn,
.add-price-cancel-btn {
    background: var(--theme-accent);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 0 1 auto;
    min-width: 120px;
}
.add-price-apply-all-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.add-price-cancel-btn {
    background: transparent;
    color: var(--theme-accent);
    border: 1px solid var(--theme-accent);
}
.add-price-cancel-btn:hover {
    background: var(--theme-accent);
    color: white;
}
.add-price-apply-all-btn:hover:not(:disabled) {
    background: var(--theme-accent-light);
    box-shadow: var(--theme-glow-box-hover);
}

/* Modifications chips */
.add-price-modifications {
    /* margin already reduced */
}
.modifications-label {
    font-size: 0.85rem;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: 500;
}
.modifications-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.modification-chip {
    background: color-mix(in srgb, var(--theme-accent) 10%, transparent);
    border: 1px solid var(--theme-accent);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--theme-accent);
}
.modification-chip:hover,
.modification-chip.active {
    background: var(--theme-accent);
    color: white;
}

/* Pagination */
.pagination-container {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pagination-btn {
    background: color-mix(in srgb, var(--theme-accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--theme-accent) 30%, transparent);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-dark);
}
.pagination-btn:hover:not(:disabled) {
    background: var(--theme-accent);
    color: white;
}
.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination-info {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Compact mode overrides */
.compact .left-column-stack .soft-card,
.compact .right-bottom-row .soft-card,
.compact .right-stack .soft-card {
    padding: 12px;
}
.compact .filter-search-header,
.compact .price-updates-header,
.compact .stock-header {
    margin-bottom: 5px;
    padding-bottom: 6px;
}
.compact .filter-search-header h3,
.compact .price-updates-header h3,
.compact .stock-header h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
}
.compact .add-price-btn {
    padding: 2px 6px;
    font-size: 0.65rem;
}
.compact .warehouse-toggle-btn {
    font-size: 0.6rem;
    padding: 2px 5px;
}
.compact .stock-item {
    padding: 4px 5px;
}
.compact .stock-item-name {
    font-size: 0.65rem;
    max-width: 100px;
}
.compact .stock-tube {
    width: 12px;
    height: 12px;
}
.compact .price-update-item {
    padding: 3px 5px;
}
.compact .price-update-product {
    font-size: 0.65rem;
}
.compact .price-update-value {
    font-size: 0.65rem;
}
.compact .category-item {
    padding: 8px 10px;
}
.compact .category-name {
    font-size: 0.75rem;
}
.compact .product-box {
    padding: 6px;
}
.compact .product-box-name {
    font-size: 0.75rem;
}
.compact .product-box-price {
    font-size: 0.7rem;
}

/* Loading screen */
.loading-bird-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    text-align: center;
    color: var(--theme-accent);
}
.loading-bird {
    position: relative;
    font-size: 2rem;
    margin-bottom: 1rem;
}
.loading-bird i {
    font-size: 3rem;
    color: var(--theme-accent);
}
.loading-text {
    font-size: 1rem;  /* base 1rem = 16px, we need +8pt = roughly +10.7px => ~26.7px, but let's use relative: 2rem? */
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--theme-accent);
    margin-top: 0.5rem;
}
/* Responsive */
@media (max-width: 1200px) {
    .add-price-two-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .grade-tiles-column {
        flex-direction: row;
        flex-wrap: wrap;
        max-height: none;
    }
    .grade-tile {
        flex: 1 1 150px;
        width: auto;
        margin: 0;
    }
}
@media (max-width: 991px) {
    .products-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
        height: auto;
        overflow-y: auto;
    }
    .left-column-stack {
        grid-row: 1;
    }
    .right-bottom-row {
        grid-row: 2;
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .right-stack {
        gap: 12px;
    }
    .filter-search-card,
    .price-updates-card,
    .stock-card {
        width: 100%;
        min-height: 280px;
    }
    .price-updates-card {
        min-height: 100px;
    }
    .stock-item-name {
        max-width: 100px;
    }
}
@media screen and (min-width: 1700px) {
    .products-grid { gap: 20px; }
    .search-section-card { padding: 14px 16px; }
    .product-categories-card .category-item { padding: 10px 12px; }
    .filter-search-card,
    .price-updates-card,
    .stock-card {
        min-height: 180px;
    }
}
@media screen and (min-width: 1920px) {
    .search-section-card { padding: 12px 16px; }
}
/* Stock card improvements for two-row layout */
.stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9f9f9;
    border-radius: 3px;
    padding: 5px 6px;
    border: 1px solid #eee;
    min-height: 34px;
    cursor: pointer;
    transition: background 0.2s;
}
.stock-item:hover {
    background: #f0f0f0;
}
.stock-item-info {
    flex: 1;
    min-width: 0;
}
.stock-item-name {
    font-size: 0.7rem;
    color: var(--text-dark);
    font-weight: 500;
    word-break: break-word;
    white-space: normal;
    line-height: 1.3;
}
.stock-quantity {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--theme-accent);
    margin-top: 2px;
}
.stock-tubes {
    display: flex;
    gap: 3px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    max-width: 180px;
    margin-left: 8px;
}
/* Price blur effect */
.blurred-price {
    filter: blur(5px);
    transition: filter 0.2s ease;
}

/* Product icons row */
.product-icons-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 8px;
    font-size: 1rem;
}
.product-icons-row i {
    cursor: default;
    opacity: 0.9;
    transition: opacity 0.2s;
    pointer-events: none;
}
.product-icons-row i:hover {
    opacity: 1;
}
.product-icons-row .fav-star-icon {
    pointer-events: auto;
    cursor: pointer;
}
.fav-star-icon.fa-solid {
    color: var(--theme-accent);
}
.fav-star-icon.fa-regular {
    color: #aaa;
}

.price-updates-header .unblur-button,
.price-updates-header .add-price-btn {
    padding: 4px 12px;
    font-size: 0.7rem;
    height: 30px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
/* Filter buttons styling */
.filter-btn {
    background: #e6d4f7;  /* light lilac */
    color: #6a4e9b;
    border: 1px dashed #c8a2c8;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.filter-btn i {
    color: #6a4e9b;
}
.filter-btn:hover {
    background: #c8a2c8;
    color: white;
    border: 1px solid #c8a2c8;
}
.filter-btn:hover i {
    color: white;
}
.filter-btn.active {
    background: #c8a2c8;
    color: white;
    border: 1px solid #c8a2c8;
    animation: pulse-lilac 1.5s infinite;
}
.filter-btn.active i {
    color: white;
}
.filter-buttons-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
/* Responsive filter buttons – keep in one row on tablets */
@media (max-width: 1400px) {
    .filter-buttons-group {
        gap: 4px;
        margin-left: auto;
    }
    .filter-btn {
        padding: 2px 8px;
        font-size: 0.65rem;
        gap: 4px;
    }
    .filter-btn i {
        font-size: 0.7rem;
    }
}
@media (max-width: 1100px) {
    .filter-buttons-group {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}