﻿/* ---------- Foundation ---------- */
* {
    box-sizing: border-box
}

:root {
    --bg: #f7f9fc;
    --panel: #fff;
    --ink: #0c1529;
    --muted: #65708a;
    --line: #e6ebf3;
    --soft: #f1f4fa;
    --shadow: 0 10px 28px rgba(16,24,40,.10);
    --r: 18px;
    /* Brand → lime */
    --brand: #CEEB46;
    --brand-600: #B6D62F;
    /* HSL for brand (#CEEB46) */
    --brand-h: 75;
    --brand-s: 80%;
    --brand-l: 60%;
}

html, body {
    background: var(--bg);
    color: var(--ink)
}

a {
    color: inherit;
    text-decoration: none
}

/* ---------- Shell ---------- */
.t-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px
}

.t-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin: 6px 0 14px
}

    .t-head h1 {
        margin: 0;
        font-size: 30px;
        font-weight: 900;
        letter-spacing: .2px
    }

    .t-head .sub {
        margin: 4px 0 0;
        color: var(--muted)
    }

.t-kpis {
    display: flex;
    align-items: center;
    gap: 14px
}

    .t-kpis .k {
        display: flex;
        flex-direction: column;
        align-items: flex-end
    }

        .t-kpis .k b {
            font-size: 18px
        }

        .t-kpis .k span {
            font-size: 12px;
            color: var(--muted)
        }

    .t-kpis .vat {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        border: 1px solid var(--line);
        padding: 6px 10px;
        border-radius: 12px;
        background: #fff
    }

/* ---------- Filters ---------- */
.t-filters {
    display: grid;
    grid-template-columns: repeat(6,minmax(0,1fr));
    gap: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 14px;
    box-shadow: var(--shadow);
}

    .t-filters label {
        display: flex;
        flex-direction: column;
        gap: 6px;
        font-size: 12px;
        color: #475467
    }

    .t-filters select, .t-filters input[type="text"] {
        height: 44px;
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 0 12px;
        background: #fff;
    }

    .t-filters .s-wide {
        grid-column: span 2
    }

        .t-filters .s-wide small {
            color: #9aa5b6
        }

    .t-filters .s-checks {
        grid-column: span 2;
        display: flex;
        align-items: end;
        gap: 14px
    }

.cb {
    display: inline-flex;
    align-items: center;
    gap: 8px
}

.t-filters .s-submit {
    display: flex;
    align-items: end
}

/* ---------- Buttons ---------- */
/* Base */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, border-color .12s ease, color .12s ease;
}

    .btn:hover {
        transform: translateY(-1px)
    }

    .btn:active {
        transform: translateY(0)
    }

    .btn:focus-visible {
        outline: none;
        box-shadow: 0 0 0 2px hsla(var(--brand-h),var(--brand-s),var(--brand-l),.35), 0 8px 20px rgba(0,0,0,.25)
    }

    .btn[disabled], .btn.is-disabled {
        opacity: .55;
        pointer-events: none
    }

/* Primary */
.btn--primary {
    color: #0e1200;
    background: linear-gradient(to bottom, hsl(var(--brand-h),var(--brand-s),calc(var(--brand-l) + 4%)), hsl(var(--brand-h),var(--brand-s),calc(var(--brand-l) - 6%)));
    border-color: hsl(var(--brand-h),var(--brand-s),calc(var(--brand-l) - 12%));
    box-shadow: 0 4px 16px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.08);
}

    .btn--primary:hover {
        background: linear-gradient(to bottom, hsl(var(--brand-h),var(--brand-s),calc(var(--brand-l) + 6%)), hsl(var(--brand-h),var(--brand-s),calc(var(--brand-l) - 4%)));
        border-color: hsl(var(--brand-h),var(--brand-s),calc(var(--brand-l) - 10%));
    }

    .btn--primary:active {
        box-shadow: 0 2px 10px rgba(0,0,0,.22), inset 0 2px 6px rgba(0,0,0,.18)
    }

/* Soft / Tonal */
.btn--soft {
    color: hsl(var(--brand-h),var(--brand-s),calc(var(--brand-l) - 22%));
    background: hsla(var(--brand-h),var(--brand-s),var(--brand-l),.18);
    border-color: hsla(var(--brand-h),var(--brand-s),var(--brand-l),.40);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

    .btn--soft:hover {
        background: hsla(var(--brand-h),var(--brand-s),var(--brand-l),.26);
        border-color: hsla(var(--brand-h),var(--brand-s),var(--brand-l),.52);
    }

/* Ghost */
.btn--ghost {
    color: hsl(var(--brand-h),var(--brand-s),calc(var(--brand-l) - 10%));
    background: transparent;
    border-color: #3a3a3a;
}

    .btn--ghost:hover {
        background: hsla(var(--brand-h),var(--brand-s),var(--brand-l),.12);
        border-color: #4a4a4a;
    }

/* Outline */
.btn--outline {
    color: hsl(var(--brand-h),var(--brand-s),calc(var(--brand-l) - 5%));
    background: transparent;
    border-color: #3a3a3a;
}

    .btn--outline:hover {
        background: hsla(var(--brand-h),var(--brand-s),var(--brand-l),.12);
        border-color: #4a4a4a;
    }

/* Sizes */
.btn--sm {
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 600
}

.btn--lg {
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 800
}

/* High-specificity overrides to kill old black styles */
.actions .btn,
.card .btn,
.pp-card .btn,
a.btn,
button.btn {
    background-image: none !important
}

.actions .btn--primary,
.card .btn--primary,
.pp-card .btn--primary,
a.btn--primary,
button.btn--primary {
    background-color: #CEEB46 !important;
    color: #0b0d05 !important;
    border: 1px solid #A4CF2D !important;
}

    .actions .btn--primary:hover,
    .card .btn--primary:hover,
    .pp-card .btn--primary:hover,
    a.btn--primary:hover,
    button.btn--primary:hover {
        background-color: #B6D62F !important;
        border-color: #96BD22 !important;
    }

/* ---------- Chips / badges ---------- */
.chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 2px 0
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(206,235,70,.18);
    border: 1px solid rgba(206,235,70,.45);
    color: #2b3342;
}

    .chip:hover {
        border-color: var(--brand)
    }

    .chip svg {
        width: 14px;
        height: 14px;
        stroke: currentColor;
        fill: none
    }

/* ---------- Grid ---------- */
.t-grid {
    display: grid;
    gap: 18px;
    margin-top: 16px;
    grid-template-columns: repeat(1,minmax(0,1fr))
}

@media(min-width:720px) {
    .t-grid {
        grid-template-columns: repeat(2,minmax(0,1fr))
    }
}

@media(min-width:1100px) {
    .t-grid {
        grid-template-columns: repeat(4,minmax(0,1fr))
    }
}

/* ---------- Card ---------- */
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform .08s ease, box-shadow .2s ease, border-color .2s ease;
    overflow: hidden;
}

    .card:hover {
        transform: translateY(-1px);
        border-color: #d5ddee;
        box-shadow: 0 14px 32px rgba(16,24,40,.12)
    }

.block {
    display: block
}

.media {
    height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg,#ffffff,#f5f7fb);
    border: 1px solid var(--line);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

    .media img {
        max-width: 88%;
        max-height: 88%;
        object-fit: contain;
        image-rendering: -webkit-optimize-contrast
    }

.pill {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f2f6ff;
    border: 1px solid #dde7ff;
    color: #1f2d4d;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 800;
}

.info {
    padding: 2px
}

.brand {
    font-size: 12px;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: .4px
}

.title {
    margin: 2px 0 0;
    font-weight: 900;
    color: #0b152d;
    line-height: 1.25;
    min-height: 2.6em
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px
}

    .badges span {
        font-size: 12px;
        padding: 4px 8px;
        border-radius: 999px;
        border: 1px solid var(--line);
        background: rgba(206,235,70,.14);
        color: #2b3342;
    }

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px
}

.price {
    font-weight: 900;
    color: #08132b;
    letter-spacing: .2px
}

.stock {
    font-size: 12px;
    color: #6b7280
}

/* Actions: 3 equal buttons */
.actions {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 8px;
    width: 100%
}

    .actions .btn {
        width: 100%
    }

/* Pager */
.pager {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 18px 0
}

.pg {
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff
}

    .pg:hover {
        border-color: var(--brand)
    }

    .pg.is-active {
        background: var(--brand);
        border-color: var(--brand);
        color: #000
    }

/* Focus ring baseline */
:where(a,button,select,input,textarea):focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(24,97,255,.35);
}

/* ---------- RFQ (modal / sheet) ---------- */
.rfq-pop {
    position: absolute;
    z-index: 1200;
    inset: 0 auto auto 0;
    display: none
}

.rfq-card {
    width: 520px;
    max-width: min(92vw,640px);
    max-height: min(86vh,820px);
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 24px 60px rgba(16,24,40,.22);
    position: relative;
}

.rfq-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px
}

    .rfq-head .x {
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 6px 10px;
        cursor: pointer
    }

.rfq-product {
    font-size: 14px;
    color: #374151;
    margin-bottom: 10px
}

.rfq-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px
}

    .rfq-grid label {
        display: flex;
        flex-direction: column;
        gap: 6px;
        font-size: 12px;
        color: #4b5563
    }

    .rfq-grid input, .rfq-grid textarea {
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 9px 12px;
        background: #fff
    }

    .rfq-grid .wide {
        grid-column: span 2
    }

.rfq-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px
}

.arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
    transform: rotate(45deg)
}

    .arrow.right {
        left: -8px
    }

    .arrow.left {
        right: -8px
    }

/* Backdrop */
.rfq-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12,21,41,.45);
    z-index: 1190;
    backdrop-filter: saturate(110%) blur(1px)
}

/* Centered modal */
.rfq-pop.rfq-centered {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    z-index: 1200;
    display: none
}

/* Bottom sheet on mobile */
.rfq-pop.is-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    transform: none
}

    .rfq-pop.is-sheet .rfq-card {
        width: 100%;
        max-width: none;
        border-radius: 16px 16px 0 0;
        max-height: 80vh
    }

/* Responsive filter grid */
@media (max-width:640px) {
    .t-filters {
        grid-template-columns: repeat(2,minmax(0,1fr))
    }

        .t-filters .s-checks {
            grid-column: span 2
        }

        .t-filters .s-wide {
            grid-column: span 2
        }
}
