/* ================================================================
   Westcan Trade Package  v1.0
   Palette: #B11F28 · #111 · #fff
   ================================================================ */
:root {
    --wtp-red:     #B11F28;
    --wtp-red-dk:  #8A161D;
    --wtp-red-lt:  #FFF5F5;
    --wtp-black:   #111;
    --wtp-sub:     #555;
    --wtp-muted:   #888;
    --wtp-border:  #E5E5E5;
    --wtp-bg-alt:  #FAFAFA;
    --wtp-white:   #fff;
}

.wtp-wrapper {
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin: 24px 0;
    background: var(--wtp-white);
    border: 1px solid var(--wtp-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

/* ── Header ──────────────────────────────────────────────────── */
.wtp-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--wtp-red) 0%, var(--wtp-red-dk) 100%);
    color: var(--wtp-white);
    position: relative;
    overflow: hidden;
}
.wtp-header::after {
    content: '';
    position: absolute;
    top: -50%; right: -10%;
    width: 240px; height: 240px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    pointer-events: none;
}

.wtp-header-icon {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    flex-shrink: 0;
    z-index: 1;
}
.wtp-header-icon svg { width: 22px; height: 22px; stroke: var(--wtp-white); }

.wtp-header-text {
    display: flex; flex-direction: column; gap: 2px;
    flex: 1;
    z-index: 1;
}
.wtp-header-eyebrow {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    opacity: 0.75;
}
.wtp-header-title {
    font-size: 17px; font-weight: 700;
    letter-spacing: -0.01em;
}

.wtp-header-stat {
    display: inline-flex; align-items: baseline;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    font-size: 12px;
    z-index: 1;
    white-space: nowrap;
}
.wtp-stat-num   { font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.wtp-stat-label { opacity: 0.85; }
.wtp-stat-sep   { opacity: 0.5; padding: 0 2px; }

/* ── Table ───────────────────────────────────────────────────── */
.wtp-table-wrap {
    overflow-x: auto;
}

.wtp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.wtp-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--wtp-sub);
    background: var(--wtp-bg-alt);
    border-bottom: 2px solid var(--wtp-red);
    white-space: nowrap;
}
.wtp-th-img   { width: 76px; }
.wtp-th-sku   { width: 130px; }
.wtp-th-price { width: 110px; }
.wtp-th-qty   { width: 60px; text-align: center !important; }

.wtp-table tbody tr {
    transition: background 0.12s;
    border-bottom: 1px solid var(--wtp-border);
}
.wtp-table tbody tr:last-child {
    border-bottom: none;
}
.wtp-table tbody tr:hover {
    background: var(--wtp-red-lt);
}

.wtp-table td {
    padding: 12px 16px;
    vertical-align: middle;
    color: var(--wtp-black);
}

/* ── Image cell ──────────────────────────────────────────────── */
.wtp-cell-img { width: 76px; }

.wtp-thumb-link {
    display: block;
    width: 56px;
    height: 56px;
    border: 1px solid var(--wtp-border);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s, transform 0.15s;
    background: var(--wtp-white);
}
.wtp-thumb-link:hover {
    border-color: var(--wtp-red);
    transform: scale(1.04);
}
.wtp-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.wtp-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px; height: 56px;
    background: var(--wtp-bg-alt);
    border: 1px dashed var(--wtp-border);
    border-radius: 6px;
    color: #CCC;
}
.wtp-thumb-placeholder svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

/* ── SKU chip ────────────────────────────────────────────────── */
.wtp-sku-chip {
    display: inline-block;
    padding: 3px 10px;
    background: var(--wtp-red-lt);
    color: var(--wtp-red);
    border: 1px solid rgba(177,31,40,0.2);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Consolas', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Linkable SKU chip — used on rows where the SKU resolves to a real
   product. Reset anchor defaults (theme underlines bleed through),
   add a clear hover state that flips to the brand red. */
a.wtp-sku-chip--link {
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s,
                box-shadow 0.15s, transform 0.12s;
}
a.wtp-sku-chip--link:hover,
a.wtp-sku-chip--link:focus-visible {
    background: var(--wtp-red);
    color: var(--wtp-white);
    border-color: var(--wtp-red);
    box-shadow: 0 2px 8px rgba(177,31,40,0.25);
    transform: translateY(-1px);
    text-decoration: none;
    outline: none;
}
a.wtp-sku-chip--link:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ── Description ─────────────────────────────────────────────── */
.wtp-cell-desc { min-width: 220px; }

.wtp-desc-link {
    color: var(--wtp-black);
    text-decoration: none;
    font-weight: 500;
    line-height: 1.35;
    transition: color 0.15s;
}
.wtp-desc-link:hover {
    color: var(--wtp-red);
    text-decoration: underline;
}

.wtp-missing-label {
    color: var(--wtp-muted);
    font-style: italic;
    font-size: 13px;
}

/* ── Price ───────────────────────────────────────────────────── */
.wtp-cell-price {
    font-weight: 700;
    color: var(--wtp-black);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.wtp-cell-price del {
    color: var(--wtp-muted);
    font-weight: 400;
    margin-right: 4px;
}
.wtp-cell-price ins {
    text-decoration: none;
    color: var(--wtp-red);
}

/* ── Qty ─────────────────────────────────────────────────────── */
.wtp-cell-qty {
    text-align: center;
}
.wtp-qty-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 28px;
    padding: 0 8px;
    background: var(--wtp-red);
    color: var(--wtp-white);
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

/* ── Missing row softening ──────────────────────────────────── */
.wtp-row-missing .wtp-sku-chip {
    background: #F5F5F5;
    color: var(--wtp-muted);
    border-color: var(--wtp-border);
}
.wtp-row-missing .wtp-qty-pill {
    background: var(--wtp-muted);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .wtp-header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px 16px;
    }
    .wtp-header-text { flex-basis: 100%; order: 1; }
    .wtp-header-icon { order: 0; }
    .wtp-header-stat { order: 2; font-size: 11px; padding: 4px 10px; }
    .wtp-stat-num { font-size: 13px; }

    .wtp-table thead th,
    .wtp-table td { padding: 10px 12px; }

    .wtp-th-img, .wtp-cell-img { width: 64px; }
    .wtp-thumb-link,
    .wtp-thumb-placeholder { width: 48px; height: 48px; }
}
