/* ── WC Stock In Store Viewer ─────────────────────────────────────────────── */

.wcsis-wrapper {
    margin: 16px 0;
    font-family: inherit;
}

/* ── Toggle button ────────────────────────────────────────────────────────── */

.wcsis-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 4px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    color: inherit;
    transition: background 0.15s ease, color 0.15s ease;
    line-height: 1.4;
}

.wcsis-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
}

.wcsis-toggle-icon {
    display: inline-block;
    font-style: normal;
    font-size: 0.75em;
    transition: transform 0.2s ease;
    line-height: 1;
}

.wcsis-toggle[aria-expanded="true"] .wcsis-toggle-icon {
    transform: rotate(-180deg);
}

/* ── Dropdown panel ───────────────────────────────────────────────────────── */

.wcsis-panel {
    margin-top: 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    /* Animated open/close via max-height trick in JS */
    max-height: 0;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease;
}

.wcsis-panel:not([hidden]) {
    max-height: 400px;
    opacity: 1;
}

/* ── Placeholder / loading ────────────────────────────────────────────────── */

.wcsis-placeholder {
    margin: 0;
    padding: 12px 16px;
    font-size: 0.88em;
    color: #888;
    font-style: italic;
}

.wcsis-loading::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 8px;
    border: 2px solid #ccc;
    border-top-color: #555;
    border-radius: 50%;
    animation: wcsis-spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes wcsis-spin {
    to { transform: rotate(360deg); }
}

/* ── Store list ───────────────────────────────────────────────────────────── */

.wcsis-store-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wcsis-store-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    font-size: 0.92em;
}

.wcsis-store-row:last-child {
    border-bottom: none;
}

.wcsis-store-name {
    font-weight: 500;
    color: #333;
}

/* ── Status badges ────────────────────────────────────────────────────────── */

.wcsis-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.82em;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.wcsis-in {
    background: #d1fae5;
    color: #065f46;
}

.wcsis-low {
    background: #fef3c7;
    color: #92400e;
}

.wcsis-out {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Group indicator ─────────────────────────────────────────────────────── */

.wcsis-group-icon {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.85em;
    color: #888;
    vertical-align: middle;
    cursor: help;
}

/* ── Legend ───────────────────────────────────────────────────────────────── */

.wcsis-legend {
    margin: 0;
    padding: 8px 16px;
    font-size: 0.78em;
    color: #888;
    background: #f9f9f9;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}
