﻿

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --ink: #12151C;
    --paper: #F4F6F8;
    --paper-raised: #FFFFFF;
    --circuit: #0E7C7B;
    --circuit-dark: #0A5F5E;
    --signal: #F2A93B;
    --wire: #8B93A7;
    --wire-light: #DDE1E8;
    --success: #2FAE66;
    --danger: #D64545;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 4px;
    --radius-md: 8px;
    --shadow-card: 0 1px 2px rgba(18,21,28,0.06), 0 4px 12px rgba(18,21,28,0.04);
    --shadow-card-hover: 0 2px 4px rgba(18,21,28,0.08), 0 12px 24px rgba(18,21,28,0.08);
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
}

.ts-spec-row {
    display: flex !important;
    flex-wrap: wrap !important; /* lets the value drop to its own
                                         line entirely if there's no room
                                         beside the key, not just wrap
                                         internally */
    align-items: baseline !important;
    min-width: 0 !important;
    gap: 0.25rem 0.5rem !important;
}

.ts-spec-key {
    flex: 0 0 auto !important;
    white-space: nowrap !important; /* the KEY should stay on one line —
                                          it's normally short ("Processor",
                                          "RAM") — only the VALUE is the
                                          problem */
}

.ts-spec-leader {
    flex: 1 1 40px !important; /* shrinks toward (but not below) 40px
                                          instead of forcing the row to stay
                                          artificially wide */
    min-width: 20px !important;
    border-bottom: 1px dotted #ccc !important;
    align-self: center !important;
}

.ts-spec-value {
    flex: 1 1 100% !important; /* THE key change: on a narrow
                                          container this takes the FULL
                                          next line rather than being
                                          squeezed beside the key */
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important; /* extra safety net for a single
                                           genuinely unbreakable long token */
    text-align: left !important;
}

/* Once there's clearly enough room (tablet/desktop), let key+leader+value
   sit on one line again, the way it originally looked — only collapse to
   a new line when space is actually tight. */
@media (min-width: 480px) {
    .ts-spec-value {
        flex: 1 1 auto !important;
    }
}

.ts-h1, .ts-h2, .ts-h3, h1.ts, h2.ts, h3.ts {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
}

a {
    color: var(--circuit);
}

    a:hover {
        color: var(--circuit-dark);
    }

/* ---------- Skip link / focus ring (accessibility floor) ---------- */
.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--ink);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 1000;
}

    .skip-link:focus {
        left: 0;
    }

:focus-visible {
    outline: 2px solid var(--circuit);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* ---------- Catalog layout ---------- */
.ts-catalog-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

    .ts-catalog-header h1 {
        font-family: var(--font-display);
        font-size: 1.75rem;
        margin: 0;
    }

.ts-result-count {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--wire);
}

.ts-search {
    position: relative;
    max-width: 420px;
}

    .ts-search input {
        border-radius: var(--radius-md);
        border: 1px solid var(--wire-light);
        padding: 0.55rem 0.9rem 0.55rem 2.25rem;
        width: 100%;
        background: var(--paper-raised);
    }

        .ts-search input:focus {
            border-color: var(--circuit);
            box-shadow: 0 0 0 3px rgba(14,124,123,0.15);
        }

    .ts-search svg {
        position: absolute;
        left: 0.7rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--wire);
    }

/* ---------- Filter sidebar ---------- */
.ts-filters {
    background: var(--paper-raised);
    border: 1px solid var(--wire-light);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

    .ts-filters h2 {
        font-family: var(--font-display);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--wire);
        margin-bottom: 0.75rem;
    }

.ts-filter-group {
    margin-bottom: 1.25rem;
}

    .ts-filter-group:last-child {
        margin-bottom: 0;
    }

    .ts-filter-group label {
        display: flex;
        justify-content: space-between;
        font-size: 0.9rem;
        padding: 0.3rem 0;
        cursor: pointer;
        color: var(--ink);
    }

        .ts-filter-group label:hover {
            color: var(--circuit);
        }

.ts-filter-count {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--wire);
}

.ts-filter-active {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(14,124,123,0.1);
    color: var(--circuit-dark);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
    margin: 0.15rem;
    text-decoration: none;
}

    .ts-filter-active:hover {
        background: rgba(14,124,123,0.18);
    }

/* ---------- Product grid & card ---------- */
.ts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.ts-card {
    background: var(--paper-raised);
    border: 1px solid var(--wire-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .ts-card:hover {
        box-shadow: var(--shadow-card-hover);
        transform: translateY(-2px);
    }

.ts-card-media {
    aspect-ratio: 4 / 3;
    background: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .ts-card-media img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 1rem;
    }

.ts-card-body {
    padding: 0.9rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ts-card-brand {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--wire);
    margin-bottom: 0.15rem;
}

.ts-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ink);
    text-decoration: none;
    line-height: 1.3;
}

    .ts-card-name:hover {
        color: var(--circuit);
    }

.ts-card-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ts-price {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--ink);
}

.ts-price-was {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--wire);
    text-decoration: line-through;
    margin-right: 0.35rem;
}

.ts-badge-stock {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.ts-badge-in {
    background: rgba(47,174,102,0.12);
    color: var(--success);
}

.ts-badge-out {
    background: rgba(214,69,69,0.1);
    color: var(--danger);
}

.ts-rating {
    font-size: 0.75rem;
    color: var(--signal);
}

.ts-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--wire);
}

    .ts-empty h3 {
        font-family: var(--font-display);
        color: var(--ink);
    }

/* ---------- Pagination ---------- */
.ts-pagination {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 2rem;
    font-family: var(--font-mono);
}

    .ts-pagination a, .ts-pagination span {
        min-width: 2.25rem;
        text-align: center;
        padding: 0.4rem 0.5rem;
        border-radius: var(--radius-sm);
        text-decoration: none;
        color: var(--ink);
        border: 1px solid transparent;
    }

        .ts-pagination a:hover {
            border-color: var(--wire-light);
        }

    .ts-pagination .active {
        background: var(--ink);
        color: #fff;
    }

    .ts-pagination .disabled {
        color: var(--wire-light);
        pointer-events: none;
    }

/* ---------- Product details page ---------- */
.ts-gallery-main {
    border: 1px solid var(--wire-light);
    border-radius: var(--radius-md);
    background: var(--paper-raised);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .ts-gallery-main img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

.ts-thumb-strip {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.ts-thumb {
    width: 64px;
    height: 64px;
    border: 1px solid var(--wire-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    background: var(--paper-raised);
}

    .ts-thumb img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 0.3rem;
    }

    .ts-thumb.active {
        border-color: var(--circuit);
        box-shadow: 0 0 0 2px rgba(14,124,123,0.15);
    }

.ts-detail-brand {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    color: var(--circuit);
}

.ts-detail-name {
    font-family: var(--font-display);
    font-size: 1.85rem;
    margin: 0.25rem 0 0.5rem;
}

.ts-detail-price {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 600;
}

.ts-variant-option {
    border: 1px solid var(--wire-light);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    font-size: 0.85rem;
}

    .ts-variant-option.active {
        border-color: var(--circuit);
        background: rgba(14,124,123,0.06);
    }

    .ts-variant-option[aria-disabled="true"] {
        opacity: 0.45;
        cursor: not-allowed;
        text-decoration: line-through;
    }

.ts-btn-primary {
    background: var(--circuit);
    border-color: var(--circuit);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

    .ts-btn-primary:hover {
        background: var(--circuit-dark);
        border-color: var(--circuit-dark);
        color: #fff;
    }

    .ts-btn-primary:disabled {
        background: var(--wire-light);
        border-color: var(--wire-light);
        color: var(--wire);
    }

/* Signature element: spec sheet with dotted leaders, like a datasheet printout */
.ts-spec-sheet {
    font-family: var(--font-mono);
    font-size: 0.88rem;
}

.ts-spec-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--wire-light);
}

    .ts-spec-row:last-child {
        border-bottom: none;
    }

.ts-spec-key {
    color: var(--wire);
    white-space: nowrap;
}

.ts-spec-leader {
    flex-grow: 1;
    border-bottom: 1px dotted var(--wire-light);
    transform: translateY(-4px);
}

.ts-spec-value {
    color: var(--ink);
    font-weight: 500;
    white-space: nowrap;
}

.ts-review-card {
    border-bottom: 1px solid var(--wire-light);
    padding: 1rem 0;
}

.ts-review-verified {
    font-size: 0.7rem;
    color: var(--success);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
