/* OpenX UI System Contract (CRM + Webshop)
   Shared design tokens and component baseline.
*/

:root {
    --ui-font-body: "Inter", "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --ui-font-head: "Sora", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --ui-space-1: 4px;
    --ui-space-2: 8px;
    --ui-space-3: 12px;
    --ui-space-4: 16px;
    --ui-space-5: 20px;
    --ui-space-6: 24px;
    --ui-space-7: 32px;
    --ui-space-8: 40px;

    --ui-radius-sm: 10px;
    --ui-radius-md: 14px;
    --ui-radius-lg: 18px;
    --ui-radius-pill: 999px;

    --ui-container-md: 1080px;
    --ui-container-lg: 1240px;
    --ui-container-xl: 1380px;

    --ui-text: #111827;
    --ui-text-soft: #475569;
    --ui-line: rgba(15, 23, 42, .12);
    --ui-line-soft: rgba(148, 163, 184, .26);
    --ui-surface: #ffffff;
    --ui-surface-alt: #f8fafc;

    --ui-primary: #ea6a2a;
    --ui-primary-hover: #cf5418;
    --ui-primary-soft: #ffe6d7;

    --ui-success: #0f8c58;
    --ui-danger: #c92f2f;
    --ui-warning: #b45309;

    --ui-shadow-sm: 0 1px 2px rgba(15, 23, 42, .08);
    --ui-shadow-md: 0 10px 24px rgba(15, 23, 42, .08);
    --ui-shadow-lg: 0 20px 42px rgba(15, 23, 42, .11);
}

body {
    color: var(--ui-text);
    font-family: var(--ui-font-body);
}

h1,
h2,
h3,
h4 {
    font-family: var(--ui-font-head);
    letter-spacing: -0.015em;
    color: var(--ui-text);
}

:where(.wx-section, .page, .co-page, .category-page, .product-page, .account-page, .cart-page) {
    max-width: var(--ui-container-xl);
    margin-inline: auto;
    padding-inline: clamp(14px, 2.3vw, 28px);
}

:where(.card, .card-lite, .account-card, .cart-panel, .co-section, .product-media-card, .product-purchase-card, .product-description-card, .product-params-card, .wx-card, .wx-kpi-card, .wx-suite-section) {
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-md);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
}

:where(.btn, .co-btn, .co-nextBtn, .nk-icon-button, button[type="submit"], input[type="submit"]) {
    min-height: 42px;
    border-radius: var(--ui-radius-pill);
    padding: 0 16px;
    border: 1px solid rgba(15, 23, 42, .15);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .14s ease;
}

:where(.btn):not(.btn-primary):not(.btn-danger):not(.btn-secondary) {
    background: #ffffff;
    color: var(--ui-text);
}

:where(.btn-primary, .co-nextBtn, .cart-cta__btn, .cart-mobilebar__btn) {
    border-color: rgba(207, 84, 24, .56);
    background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-hover));
    color: #fff8f4;
    box-shadow: 0 10px 24px rgba(234, 106, 42, .24);
}

:where(.btn-secondary, .co-btn, .cat-pageBtn, .nk-main-link) {
    border-color: rgba(15, 23, 42, .12);
    background: var(--ui-surface-alt);
    color: #0f172a;
}

:where(.btn-danger, .account-wishlist-remove-btn) {
    border-color: rgba(201, 47, 47, .46);
    background: #fff5f5;
    color: var(--ui-danger);
}

:where(.btn, .co-btn, .co-nextBtn):hover {
    transform: translateY(-1px);
}

:where(.btn, .co-btn, .co-nextBtn):active {
    transform: translateY(0);
}

:where(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="search"], input[type="password"], select, textarea, .input, .cart-input, .nk-search-input) {
    min-height: 42px;
    border-radius: var(--ui-radius-sm);
    border: 1px solid var(--ui-line-soft);
    background: #ffffff;
    color: var(--ui-text);
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
}

:where(input, select, textarea, .input):focus,
:where(input, select, textarea, .input):focus-visible {
    outline: none;
    border-color: rgba(234, 106, 42, .58);
    box-shadow: 0 0 0 3px rgba(234, 106, 42, .15);
}

:where(.table-wrap, .wx-table-wrap, .product-params-tableWrap, .table-auth-wrapper) {
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-md);
    background: #ffffff;
    overflow: auto;
}

:where(.table, .table-auth, .product-params-table) {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

:where(.table thead th, .table-auth thead th, .product-params-table th) {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .01em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--ui-line);
    padding: 11px 12px;
}

:where(.table tbody td, .table-auth tbody td, .product-params-table td) {
    padding: 11px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .22);
    vertical-align: top;
}

:where(.table tbody tr:hover td, .table-auth tbody tr:hover td, .product-params-table tr:hover td) {
    background: #fbfdff;
}

:where(.account-card-head, .co-head, .cart-head, .page-head, .wx-suite-section__head) {
    margin-bottom: var(--ui-space-4);
}

:where(.account-card + .account-card, .co-section + .co-section, .wx-suite-section + .wx-suite-section) {
    margin-top: var(--ui-space-4);
}

:where(.muted, .account-hint, .co-note, .cart-hint, .wx-suite-section__desc) {
    color: var(--ui-text-soft);
}

@media (max-width: 1100px) {
    :where(.wx-section, .page, .co-page, .category-page, .product-page, .account-page, .cart-page) {
        padding-inline: 14px;
    }
}

@media (max-width: 980px) {
    :where(.btn, .co-btn, .co-nextBtn, .nk-icon-button, button[type="submit"], input[type="submit"]) {
        min-height: 44px;
    }

    :where(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="search"], input[type="password"], select, textarea, .input) {
        min-height: 44px;
        font-size: 16px;
    }

    :where(.table-wrap, .wx-table-wrap, .table-auth-wrapper) {
        border-radius: 12px;
    }
}

@media (max-width: 640px) {
    :where(.table thead th, .table-auth thead th, .product-params-table th, .table tbody td, .table-auth tbody td, .product-params-table td) {
        padding: 9px 10px;
    }
}
