/* ============================================================
   ig_prodspecs — Product Specifications & Combinations
   Modern, clean, professional styling for lab equipment store
   ============================================================ */

:root {
    --igps-primary: #1a365d;
    --igps-primary-light: #e8edf4;
    --igps-accent: #d4a853;
    --igps-success: #16a34a;
    --igps-warning: #f59e0b;
    --igps-text: #1e293b;
    --igps-text-muted: #64748b;
    --igps-border: #e2e8f0;
    --igps-bg: #ffffff;
    --igps-bg-alt: #f8fafc;
    --igps-radius: 6px;
    --igps-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ============================================================
   COMBINATIONS TABLE
   ============================================================ */

.ig-ps-wrapper {
    margin: 1rem 0;
}

.ig-ps-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--igps-primary-light);
    color: var(--igps-primary);
    border-radius: var(--igps-radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.ig-ps-notice .material-icons {
    font-size: 18px;
}

/* Table scroll container */
.ig-ps-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--igps-border);
    border-radius: var(--igps-radius);
    box-shadow: var(--igps-shadow);
}

/* Table */
.ig-ps-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    line-height: 1.4;
    background: var(--igps-bg);
}

.ig-ps-table thead {
    background: var(--igps-primary);
    color: #ffffff;
}

.ig-ps-table thead th {
    padding: 0.625rem 0.75rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    text-align: left;
    border-bottom: 2px solid var(--igps-primary);
}

.ig-ps-table tbody tr {
    border-bottom: 1px solid var(--igps-border);
    transition: background-color 0.15s ease;
}

.ig-ps-table tbody tr:nth-child(even) {
    background: var(--igps-bg-alt);
}

.ig-ps-table tbody tr:hover {
    background: var(--igps-primary-light);
}

.ig-ps-table tbody tr.ig-ps-row--hidden {
    display: none;
}

.ig-ps-table td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
    color: var(--igps-text);
}

/* Image column */
.ig-ps-cell-img {
    width: 80px;
    text-align: center;
}

.ig-ps-thumb {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid var(--igps-border);
    background: #fff;
}

.ig-ps-no-img {
    font-size: 32px;
    color: var(--igps-border);
}

/* Reference */
.ig-ps-cell-ref {
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Attribute cells */
.ig-ps-cell-attr {
    white-space: nowrap;
}

/* Color swatch */
.ig-ps-color-swatch {
    display: inline-block;
    border-radius: 50%;
    border: 2px solid var(--igps-border);
    vertical-align: middle;
    flex-shrink: 0;
}

.ig-ps-color-label {
    margin-left: 6px;
    font-size: 0.8125rem;
}

/* Price cells */
.ig-ps-cell-price {
    white-space: nowrap;
    text-align: right;
}

.ig-ps-price-value {
    font-weight: 700;
    color: var(--igps-primary);
    font-size: 0.875rem;
}

.ig-ps-price-old {
    display: block;
    text-decoration: line-through;
    color: var(--igps-text-muted);
    font-size: 0.75rem;
}

/* Discount blocks */
.ig-ps-discounts {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ig-ps-discount-block {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: var(--igps-primary-light);
    border-radius: 3px;
    font-size: 0.6875rem;
}

.ig-ps-discount-qty {
    font-weight: 600;
    color: var(--igps-primary);
}

.ig-ps-discount-price {
    font-weight: 600;
}

.ig-ps-discount-pct,
.ig-ps-col-price .ig-ps-discount-pct {
    color: var(--igps-success);
    font-weight: 600;
    font-size: 0.6875rem;
}

/* Quantity tier header */
.ig-ps-qty-tier {
    font-size: 0.8125rem;
    font-weight: 700;
}

/* Weight */
.ig-ps-cell-weight {
    white-space: nowrap;
    text-align: right;
}

/* Availability badges */
.ig-ps-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
}

.ig-ps-badge .material-icons {
    font-size: 14px;
}

.ig-ps-badge--ok {
    background: #dcfce7;
    color: #15803d;
}

.ig-ps-badge--oos {
    background: #fef3c7;
    color: #92400e;
}

/* Stock */
.ig-ps-cell-stock {
    text-align: center;
    font-weight: 600;
}

/* Buy column */
.ig-ps-cell-buy {
    white-space: nowrap;
}

.ig-ps-buy-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ig-ps-qty-input {
    width: 56px;
    height: 34px;
    padding: 4px 6px;
    border: 1px solid var(--igps-border);
    border-radius: var(--igps-radius);
    font-size: 0.8125rem;
    text-align: center;
    background: var(--igps-bg);
    color: var(--igps-text);
    transition: border-color 0.15s;
}

.ig-ps-qty-input:focus {
    outline: none;
    border-color: var(--igps-primary);
    box-shadow: 0 0 0 2px rgba(26, 54, 93, 0.15);
}

.ig-ps-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: var(--igps-radius);
    background: var(--igps-primary);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.ig-ps-add-btn:hover {
    background: #142a4d;
    transform: scale(1.05);
}

.ig-ps-add-btn:active {
    transform: scale(0.95);
}

.ig-ps-add-btn .material-icons {
    font-size: 18px;
}

.ig-ps-add-btn.ig-ps-add-btn--success {
    background: var(--igps-success);
}

.ig-ps-oos-label {
    font-size: 0.75rem;
    color: var(--igps-text-muted);
    font-style: italic;
}

/* ============================================================
   BATCH ADD BAR
   ============================================================ */

.ig-ps-batch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.875rem 1rem;
    margin-top: -1px;
    background: var(--igps-primary-light);
    border: 1px solid var(--igps-border);
    border-radius: 0 0 var(--igps-radius) var(--igps-radius);
}

.ig-ps-batch-total {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--igps-text);
}

.ig-ps-batch-total-price {
    font-size: 1.125rem;
    color: var(--igps-primary);
}

.ig-ps-batch-total-items {
    color: var(--igps-text-muted);
    font-size: 0.8125rem;
}

.ig-ps-batch-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--igps-primary);
    color: #fff;
    border: none;
    border-radius: var(--igps-radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.ig-ps-batch-submit:hover:not(:disabled) {
    background: #142a4d;
}

.ig-ps-batch-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ig-ps-batch-submit .material-icons {
    font-size: 18px;
}

/* ============================================================
   LEGEND
   ============================================================ */

.ig-ps-legend {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

/* ============================================================
   FILTER
   ============================================================ */

.ig-ps-filter {
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--igps-bg-alt);
    border: 1px solid var(--igps-border);
    border-radius: var(--igps-radius);
}

.ig-ps-filter__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--igps-primary);
    margin-bottom: 0.75rem;
}

.ig-ps-filter__title .material-icons {
    font-size: 18px;
}

.ig-ps-filter__groups {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.ig-ps-filter__group {
    min-width: 140px;
}

.ig-ps-filter__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--igps-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.375rem;
}

.ig-ps-filter__options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.ig-ps-filter__option {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--igps-border);
    border-radius: 100px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--igps-bg);
}

.ig-ps-filter__option:hover {
    border-color: var(--igps-primary);
}

.ig-ps-filter__option input[type="radio"] {
    display: none;
}

.ig-ps-filter__option:has(input:checked) {
    background: var(--igps-primary);
    color: #fff;
    border-color: var(--igps-primary);
}

.ig-ps-filter__color {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15);
}

.ig-ps-filter__reset {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 0.75rem;
    padding: 4px 10px;
    border: 1px solid var(--igps-border);
    border-radius: var(--igps-radius);
    background: none;
    color: var(--igps-text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.ig-ps-filter__reset:hover {
    border-color: var(--igps-primary);
    color: var(--igps-primary);
}

.ig-ps-filter__reset .material-icons {
    font-size: 14px;
}

/* ============================================================
   CATEGORY FEATURES (product cards)
   ============================================================ */

.ig-ps-cat-features {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0.375rem 0 0;
    padding: 0.375rem 0 0;
    border-top: 1px solid var(--igps-border);
}

.ig-ps-cat-feature {
    display: flex;
    gap: 4px;
    font-size: 0.6875rem;
    line-height: 1.4;
    color: var(--igps-text-muted);
}

.ig-ps-cat-feature__name {
    font-weight: 600;
    color: var(--igps-text);
    white-space: nowrap;
    flex-shrink: 0;
}

.ig-ps-cat-feature__value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */

.ig-ps-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--igps-radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ig-ps-toast.ig-ps-toast--visible {
    transform: translateY(0);
    opacity: 1;
}

.ig-ps-toast--success {
    background: var(--igps-success);
}

.ig-ps-toast--error {
    background: #dc2626;
}

.ig-ps-toast .material-icons {
    font-size: 18px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 767px) {
    .ig-ps-table {
        font-size: 0.75rem;
    }

    .ig-ps-table thead th {
        padding: 0.5rem;
        font-size: 0.6875rem;
    }

    .ig-ps-table td {
        padding: 0.375rem 0.5rem;
    }

    .ig-ps-thumb {
        width: 44px;
        height: 44px;
    }

    .ig-ps-cell-img {
        width: 50px;
    }

    .ig-ps-qty-input {
        width: 44px;
        height: 30px;
    }

    .ig-ps-add-btn {
        width: 30px;
        height: 30px;
    }

    .ig-ps-batch-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .ig-ps-batch-total {
        justify-content: center;
    }

    .ig-ps-filter__groups {
        flex-direction: column;
        gap: 0.75rem;
    }

    .ig-ps-cat-feature {
        font-size: 0.625rem;
    }
}

@media (max-width: 480px) {
    .ig-ps-table-scroll {
        margin: 0 -0.75rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}
