/* ==========================================================================
   Our Services — assets/client/css/our-services.css
   Public reseller catalog for the landing shell (dark theme / --color-* tokens).
   Grouped view: Platform → Category → Services.
   No favorite column, no min/max quantity column — reseller price only.
   ========================================================================== */

/* ── Page shell ─────────────────────────────────────────────────────────── */
.os-page {
    padding: 120px 0 80px;
    min-height: 100vh;
}

/* ── Page header ────────────────────────────────────────────────────────── */
.os-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.os-header h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, var(--color-text-primary), var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.os-header p {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* ── Filter card ────────────────────────────────────────────────────────── */
.os-filter-card {
    /* backdrop-filter creates a stacking context; lift the card so the open
       search-select dropdown stays above the services list below it. */
    position: relative;
    z-index: 50;
    background: var(--color-surface-glass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    margin-bottom: var(--spacing-lg);
}

.os-filter-row {
    display: grid;
    grid-template-columns: 1fr 200px 200px auto;
    gap: 12px;
    align-items: start;
}

.os-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.os-filter-grow {
    min-width: 0;
}

.os-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.os-input,
.os-select {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius-md);
    font-size: 14px;
    color: var(--color-text-primary);
    background: var(--color-surface);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    font-family: var(--font-primary);
    box-sizing: border-box;
    width: 100%;
}

.os-input::placeholder {
    color: var(--color-text-muted);
}

.os-input:focus,
.os-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}

/* ── Searchable select ──────────────────────────────────────────────────── */
.os-searchsel {
    position: relative;
    display: block;
}

.os-searchsel-input {
    width: 100%;
    padding: 10px 38px 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius-md);
    background: var(--color-surface);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
}
.os-searchsel-input::placeholder {
    color: var(--color-text-muted);
}
.os-searchsel-input:focus,
.os-searchsel.is-open .os-searchsel-input {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
    cursor: text;
}
.os-searchsel-chevron {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: transform .15s;
}
.os-searchsel.is-open .os-searchsel-chevron {
    transform: translateY(-50%) rotate(180deg);
}
.os-searchsel-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--color-bg-light);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 220px;
    overflow-y: auto;
    z-index: 200;
}
.os-searchsel-opt {
    padding: 9px 14px;
    font-size: 13.5px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background .08s;
}
.os-searchsel-opt:hover {
    background: rgba(45, 212, 191, 0.12);
    color: var(--color-primary-light);
}
.os-searchsel-opt.is-active {
    background: rgba(45, 212, 191, 0.12);
    color: var(--color-primary-light);
    font-weight: 500;
}
.os-searchsel-empty {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.os-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 20px;
    flex-wrap: wrap;
}

.os-filter-actions .os-btn {
    padding: 10px 14px;
    font-size: 13px;
    white-space: nowrap;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.os-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--border-radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .15s;
    border: 1px solid transparent;
    font-family: var(--font-primary);
    white-space: nowrap;
}

.os-btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(45, 212, 191, 0.25);
}
.os-btn-primary:hover {
    box-shadow: 0 6px 25px rgba(45, 212, 191, 0.4);
    transform: translateY(-1px);
}

.os-btn-outline {
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border-color: rgba(255, 255, 255, 0.15);
}
.os-btn-outline:hover {
    background: var(--color-surface-glass);
    color: var(--color-text-primary);
}

.os-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ── Rate filter panel ──────────────────────────────────────────────────── */
.os-rate-slider-wrap {
    background: var(--color-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-sm);
}

.os-rate-slider-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.os-rate-slider-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.os-rate-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.os-rate-input {
    max-width: 160px;
}

/* ── Results bar ────────────────────────────────────────────────────────── */
.os-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.os-results-count {
    font-size: 13px;
    color: var(--color-text-muted);
}
.os-results-count strong {
    color: var(--color-text-primary);
}

/* ── Grouped list ───────────────────────────────────────────────────────── */
.os-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

/* ── Platform group ─────────────────────────────────────────────────────── */
.os-group {
    background: var(--color-surface-glass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 10px;
}

.os-group:last-child {
    margin-bottom: 0;
}

.os-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
}

.os-group-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: .85;
}

.os-group-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.os-group-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    opacity: .9;
    white-space: nowrap;
}

/* ── Category section ───────────────────────────────────────────────────── */
.os-category + .os-category {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.os-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px 8px;
    background: rgba(255, 255, 255, 0.04);
}

.os-category-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.os-category-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0;
}

.os-category-count {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-secondary);
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    line-height: 1;
}

/* ── Service item rows ──────────────────────────────────────────────────── */
.os-items {
    padding: 4px 20px 12px;
    min-width: 0;
}

.os-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--border-radius-md);
    transition: background .15s;
}
.os-item:hover {
    background: rgba(255, 255, 255, 0.05);
}
.os-item + .os-item {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ── Service ID (line above name) ─────────────────────────────────────── */
.os-item-id-line {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.os-item-id {
    font-size: 15px;
    font-weight: 800;
    color: var(--color-primary);
    font-family: monospace;
    letter-spacing: -.02em;
}

/* Info (center) */
.os-item-info {
    flex: 1;
    min-width: 0;
}

.os-item-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    word-break: break-word;
    line-height: 1.4;
}

.os-overloaded-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1.4;
    white-space: nowrap;
}

.os-item-overloaded {
    border-left: 3px solid #f59e0b;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.08) 0%, transparent 40%);
}

/* Details (right-aligned, reseller price only) */
.os-item-details {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-shrink: 0;
    min-width: 90px;
    text-align: right;
}

.os-item-rate {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-primary);
}

/* Action (right) */
.os-item-action {
    flex-shrink: 0;
}

.os-order-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: var(--border-radius-md);
    text-decoration: none;
    transition: box-shadow .15s, transform .15s;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: .03em;
    box-shadow: 0 4px 15px rgba(45, 212, 191, 0.25);
}
.os-order-btn:hover {
    box-shadow: 0 6px 25px rgba(45, 212, 191, 0.4);
    transform: translateY(-1px);
}

/* Description info button */
.os-desc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 999px;
    transition: background .15s, color .15s;
    flex-shrink: 0;
    margin-left: 2px;
}
.os-desc-btn:hover {
    background: var(--color-primary);
    color: #fff;
}
.os-desc-btn svg {
    width: 14px;
    height: 14px;
}

/* ── Loading state ──────────────────────────────────────────────────────── */
.os-loading {
    text-align: center;
    padding: 80px 16px;
    color: var(--color-text-muted);
    font-size: 14px;
    background: var(--color-surface-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
}

.os-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: os-spin .7s linear infinite;
    margin: 0 auto 12px;
}

@keyframes os-spin {
    to { transform: rotate(360deg); }
}

/* ── Empty state ────────────────────────────────────────────────────────── */
.os-empty {
    padding: 80px 24px;
    text-align: center;
    background: var(--color-surface-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
}

.os-empty-icon {
    width: 56px;
    height: 56px;
    color: var(--color-text-muted);
    margin: 0 auto 16px;
    display: block;
}

.os-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 6px;
}

.os-empty-desc {
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 0;
}

/* ── Description Modal ──────────────────────────────────────────────────── */
.os-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.os-modal {
    background: var(--color-bg-light);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.os-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.os-modal-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
}

.os-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: background .15s;
}
.os-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-primary);
}

.os-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.os-modal-desc-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .os-filter-row {
        grid-template-columns: 1fr 2fr;
    }
    .os-filter-group:nth-child(1) {
        grid-column: 1;
    }
    .os-filter-group:nth-child(2) {
        grid-column: 1 / -1;
    }
    .os-filter-group:nth-child(3) {
        grid-column: 2;
        grid-row: 1;
    }
    .os-filter-actions {
        grid-column: 1 / -1;
        width: 100%;
    }
    .os-filter-actions .os-btn {
        flex: 1;
    }

    .os-rate-slider-row {
        flex-direction: column;
        align-items: stretch;
    }
    .os-rate-input {
        max-width: 100%;
    }

    .os-item {
        flex-wrap: wrap;
    }
    .os-item-info {
        flex: 1 1 100%;
        order: 0;
    }
    .os-item-details {
        order: 1;
        min-width: 0;
    }
    .os-item-action {
        order: 2;
    }

    .os-group-header {
        padding: 14px 16px;
    }
    .os-category-header {
        padding: 10px 16px 6px;
    }
    .os-items {
        padding: 4px 16px 10px;
    }
}