h6 {
    padding-top : 10px;
}

.modal-body {
    text-align: left;
}

/* Product modal: money fields on their own row with space above */
.product-modal-money-block {
    padding-top: 14px;
    margin-top: 4px;
}

/* Max-length hints under product description and gift name */
.product-field-max-hint {
    display: block;
    text-align: right;
    color: #dc3545;
    margin-top: 2px;
}

/* .product-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
} */

.product-table {
    padding-top: 20px;
    max-height: calc(100vh - 240px); /* Adjust based on header, title, padding, and add button */
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    scrollbar-color: #4169E1 #e0e0e0; /* Firefox: thumb and track */
    scrollbar-width: thin;
}

.product-table-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
    width: 100%;
}

.product-table-inner {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 12px;
}

.product-table-content {
    min-width: 880px;
}

.table-record-count {
    background-color: #f1f5ff;
    color: #0d6efd;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.3px;
}

/* Webkit browsers (Chrome, Safari, Edge) - Horizontal scrollbar */
.product-table-inner::-webkit-scrollbar {
    height: 8px;
}

.product-table-inner::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 4px;
}

.product-table-inner::-webkit-scrollbar-thumb {
    background: #4169E1;
    border-radius: 4px;
}

.product-table-inner::-webkit-scrollbar-thumb:hover {
    background: #3151B8;
}

#productsTable {
    margin-bottom: 0;
    width: 100%;
    min-width: 880px; /* Eight columns; horizontal scroll on narrow viewports */
    border-collapse: collapse;
    table-layout: fixed;
}

#productsTable thead {
    display: table;
    width: 100%;
    min-width: 880px; /* Match table min-width */
    table-layout: fixed;
}

#productsTable thead tr {
    display: table-row;
}

#productsTable thead th {
    background-color: #f8f9fa !important;
    border-bottom: 2px solid #dee2e6;
    display: table-cell;
}

/* Eight columns: Code, Description, Points limit, Product value, Reward name, Reward value, Modified, Actions */
#productsTable thead th:nth-child(1) { width: 9%; }   /* Product Code */
#productsTable thead th:nth-child(2) { width: 18%; } /* Product Description */
#productsTable thead th:nth-child(3) { width: 14%; } /* Points Limit */
#productsTable thead th:nth-child(4) { width: 10%; } /* Product Value */
#productsTable thead th:nth-child(5) { width: 18%; } /* Reward Name */
#productsTable thead th:nth-child(6) { width: 10%; } /* Reward Value */
#productsTable thead th:nth-child(7) { width: 11%; } /* Last Modified */
#productsTable thead th:nth-child(8) { width: 10%; } /* Actions */

#productsTable tbody {
    display: block;
    overflow-y: auto;
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 300px); /* Adjust based on header, title, padding, add button, and table header */
    width: 100%;
    scrollbar-color: #4169E1 #e0e0e0; /* Firefox: thumb and track */
    scrollbar-width: thin;
}

/* Webkit browsers (Chrome, Safari, Edge) - Vertical scrollbar */
#productsTable tbody::-webkit-scrollbar {
    width: 8px;
}

#productsTable tbody::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 4px;
}

#productsTable tbody::-webkit-scrollbar-thumb {
    background: #4169E1;
    border-radius: 4px;
}

#productsTable tbody::-webkit-scrollbar-thumb:hover {
    background: #3151B8;
}

#productsTable tbody tr {
    display: table;
    width: 100%;
    min-width: 880px; /* Match table min-width */
    table-layout: fixed;
}

#productsTable tbody td {
    display: table-cell;
}

#productsTable tbody td:nth-child(1) { width: 9%; }
#productsTable tbody td:nth-child(2) { width: 18%; }
#productsTable tbody td:nth-child(3) { width: 14%; }
#productsTable tbody td:nth-child(4) { width: 10%; }
#productsTable tbody td:nth-child(5) { width: 18%; }
#productsTable tbody td:nth-child(6) { width: 10%; }
#productsTable tbody td:nth-child(7) { width: 11%; }
#productsTable tbody td:nth-child(8) { width: 10%; }

/* Points Limit column */
#productsTable tbody td:nth-child(3) {
    text-align: left;
    white-space: nowrap;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

#productsTable tbody td:nth-child(5) {
    padding-left: 0.35rem;
}

/* Points Limit header: one line, even horizontal padding */
#productsTable thead th:nth-child(3) {
    text-align: left;
    white-space: nowrap;
    padding-left: 1rem;
    padding-right: 1rem;
}

#productsTable thead th:nth-child(5) {
    padding-left: 0;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.action-buttons .btn {
    padding: 2px 8px;
    font-size: 12px;
}

.product-comments {
    padding-top: 20px;
}

.product-search-container {
    padding: 15px 0;
}

.product-search-input {
    max-width: 400px;
}
