/* ============================================================
   GTA Apparel — Stock Catalog
   Design concept: a "character-creator terminal" — the loadout
   screen aesthetic from GTA Online's clothing shops. Dark slate
   background, magenta/cyan signal accents (like an in-game HUD
   readout), condensed industrial-stencil headings for category
   labels, monospace for small data labels.
   ============================================================ */

:root {
    --ink:        #0b0d12;
    --panel:      #12151d;
    --panel-2:    #191d28;
    --line:       #262b3a;
    --text:       #e7e9f0;
    --text-dim:   #8890a4;
    --magenta:    #ff2d92;
    --cyan:       #35e0d0;
    --amber:      #ffb444;
    --ok:         #38d97a;
    --danger:     #ff5c5c;
    --radius:     10px;
    --font-display: 'Oswald', 'Arial Narrow', sans-serif;
    --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono:    'JetBrains Mono', 'Consolas', monospace;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
    margin: 0;
    background: var(--ink);
    background-image:
        radial-gradient(circle at 15% 0%, rgba(255,45,146,0.10), transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(53,224,208,0.08), transparent 40%);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
}

a { color: var(--cyan); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px 80px; }

/* ---- Top bar ---- */
.topbar {
    border-bottom: 1px solid var(--line);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    position: sticky;
    top: 0;
    background: rgba(11,13,18,0.92);
    backdrop-filter: blur(6px);
    z-index: 40;
}
.topbar .brand {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 20px;
    font-weight: 600;
}
.topbar .brand span { color: var(--magenta); }

/* ---- Clothes / Peds header switcher ---- */
.view-switch {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
}
.view-switch .view-tab {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 13px;
    padding: 9px 22px;
    background: var(--panel-2);
    color: var(--text-dim);
    border: none;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.view-switch .view-tab.active { background: var(--magenta); color: #fff; font-weight: 700; }
.view-switch .view-tab:hover:not(.active) { color: var(--text); }

/* ---- Hero ---- */
.hero { padding: 44px 0 26px; }
.eyebrow {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cyan);
    margin: 0 0 10px;
}
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    margin: 0 0 12px;
}
.hero p { color: var(--text-dim); max-width: 640px; margin: 0; }

/* ---- View panels ---- */
.view-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 22px;
}

/* ---- Gender toggle ---- */
.gender-toggle {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 20px;
}
.gender-toggle button {
    font-family: var(--font-mono);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 18px;
    background: var(--panel-2);
    color: var(--text-dim);
    border: none;
    cursor: pointer;
}
.gender-toggle button.active { background: var(--magenta); color: #fff; font-weight: 700; }

/* ---- Category tabs ---- */
.cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.cat-tab {
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: 0.05em;
    padding: 9px 14px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text-dim);
    cursor: pointer;
    text-transform: uppercase;
    transition: border-color .15s, color .15s, background .15s;
}
.cat-tab:hover { color: var(--text); border-color: var(--text-dim); }
.cat-tab.active {
    color: var(--ink);
    background: var(--cyan);
    border-color: var(--cyan);
    font-weight: 700;
}

/* ---- Search box (shared by clothes + peds) ---- */
.search-box {
    max-width: 480px;
    margin-bottom: 20px;
    display: flex;
    gap: 8px;
}
.search-box input[type=text] {
    flex: 1;
    min-width: 0;
    padding: 13px 14px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    font-family: var(--font-body);
}
.search-box input[type=text]:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(53,224,208,0.15);
}
.search-btn {
    flex-shrink: 0;
    width: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text-dim);
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.search-btn svg { width: 18px; height: 18px; }
.search-btn:hover,
.search-btn:focus-visible {
    outline: none;
    border-color: var(--cyan);
    color: var(--cyan);
}

/* ---- Catalog grid (shared by clothes + peds) ---- */
.clothes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    min-height: 120px;
}
.clothes-empty {
    grid-column: 1 / -1;
    color: var(--text-dim);
    text-align: center;
    padding: 40px 10px;
    font-size: 14px;
}
.item-card {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color .15s, transform .1s;
}
.item-card:hover { border-color: var(--text-dim); }
.item-thumb-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
}
.item-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #0e1017;
    display: block;
}
.item-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 12px;
    text-align: center;
    padding: 10px;
}
.item-name {
    padding: 9px 10px 11px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    /* Full names must always be visible — never truncate/ellipsis, even
       for long, space-less strings like "mp_f_freemode_01_female". Force
       a break wherever needed so the text wraps inside the card instead
       of overflowing past it and getting clipped by .item-card's
       overflow:hidden. */
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}
.item-meta {
    padding: 0 10px 10px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Lightbox ---- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(6,7,10,0.92);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    z-index: 100;
}
.lightbox.open { display: flex; }
.lightbox-fig {
    margin: 0;
    max-width: min(900px, 92vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.lightbox-fig img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #0e1017;
}
.lightbox-fig figcaption {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 16px;
    color: var(--text);
    text-align: center;
}
.lightbox-close {
    position: absolute;
    top: 18px; right: 22px;
    background: none;
    border: 1px solid var(--line);
    color: var(--text);
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.lightbox-close:hover { border-color: var(--magenta); color: var(--magenta); }

.cat-tab-divider {
    width: 1px;
    align-self: stretch;
    background: var(--line);
    margin: 0 2px;
}
.cat-tab-prop.active { background: var(--magenta); border-color: var(--magenta); color: #fff; }

/* ============================================================
   Item Detail Modal — properties, path, FiveM replace name,
   texture variants ("grzy.tools-style" full data popup)
   ============================================================ */
.detail-modal {
    position: fixed;
    inset: 0;
    background: rgba(6,7,10,0.92);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    z-index: 110;
}
.detail-modal.open { display: flex; }
.detail-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    width: min(960px, 96vw);
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: var(--panel);
    z-index: 1;
}
.detail-head h2 {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 19px;
    margin: 0;
    color: var(--text);
    word-break: break-word;
}
.detail-icon-btn {
    background: none;
    border: 1px solid var(--line);
    color: var(--text);
    width: 34px; height: 34px;
    border-radius: 50%;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.detail-icon-btn:hover { border-color: var(--magenta); color: var(--magenta); }
.detail-share-btn {
    width: auto;
    border-radius: 17px;
    padding: 0 14px;
    font-size: 12px;
    font-family: var(--font-body, inherit);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.detail-body {
    padding: 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}
.detail-loading { color: var(--text-dim); padding: 40px 0; text-align: center; grid-column: 1 / -1; }
.detail-main-img {
    background: #0e1017;
    border: 1px solid var(--line);
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    position: relative;
}
.detail-main-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
    cursor: crosshair;
    transition: object-position 0.05s linear;
}
.detail-info { display: flex; flex-direction: column; gap: 4px; }
.detail-section-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 16px 0 8px;
}
.detail-info .detail-section-label:first-child { margin-top: 0; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-tag {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: 5px;
    font-weight: 600;
}
.tag-gender { background: rgba(255,45,146,0.16); color: var(--magenta); }
.tag-cat    { background: rgba(53,224,208,0.16); color: var(--cyan); }
.tag-base   { background: rgba(56,217,122,0.16); color: var(--ok); }
.detail-copy-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
}
.detail-copy-box code {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text);
    flex: 1;
    word-break: break-all;
}
.detail-copy-btn {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--cyan);
    border-radius: 5px;
    padding: 5px 9px;
    cursor: pointer;
    flex-shrink: 0;
}
.detail-copy-btn:hover { border-color: var(--cyan); }
.detail-kv { display: flex; flex-direction: column; gap: 2px; }
.kv-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
    font-size: 12.5px;
}
.kv-k { color: var(--text-dim); }
.kv-v { color: var(--text); font-family: var(--font-mono); font-size: 12px; text-align: right; word-break: break-word; }
.detail-no-meta { color: var(--text-dim); font-size: 12.5px; margin-top: 14px; }
.texture-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
}
.texture-swatch {
    position: relative;
    border: 1px solid var(--line);
    background: var(--panel-2);
    border-radius: 6px;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}
.texture-swatch img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.85; }
.texture-swatch.active { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(53,224,208,0.3); }
.texture-swatch.active img { opacity: 1; }
.texture-letter {
    position: absolute;
    bottom: 3px; right: 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,0.6);
    border-radius: 3px;
    padding: 1px 4px;
}

footer.site-footer {
    text-align: center;
    color: var(--text-dim);
    font-size: 12.5px;
    padding: 30px 20px;
    border-top: 1px solid var(--line);
    margin-top: 40px;
}

@media (max-width: 640px) {
    .topbar { justify-content: center; text-align: center; }
    .clothes-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
    .detail-body { grid-template-columns: 1fr; }
    .detail-panel { max-height: 96vh; }
}
