/* ═══════════════════════════════════════════════════════
   LabSyder Store — Premium Design System
   ═══════════════════════════════════════════════════════ */

:root {
    --bg: #fafafa;
    --bg-2: #f3f3f3;
    --surface: #ffffff;
    --surface-2: #f7f7f8;
    --text: #171717;
    --text-2: #525252;
    --text-3: #a3a3a3;
    --border: #e5e5e5;
    --border-2: #f0f0f0;
    --accent: #171717;
    --accent-soft: #f5f5f5;
    --accent-text: #ffffff;
    --green: #16a34a;
    --star: #eab308;
    --shadow-1: 0 1px 3px rgba(0,0,0,.04);
    --shadow-2: 0 4px 24px rgba(0,0,0,.06);
    --shadow-3: 0 12px 48px rgba(0,0,0,.08);
    --shadow-4: 0 24px 80px rgba(0,0,0,.10);
    --r-xs: 8px;
    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 20px;
    --r-xl: 24px;
    --r-full: 9999px;
    --max: 1120px;
    --ease: cubic-bezier(.4,0,.2,1);
    --spring: cubic-bezier(.16,1,.3,1);
}

[data-theme="dark"] {
    --bg: #0a0a0a;
    --bg-2: #111111;
    --surface: #171717;
    --surface-2: #1f1f1f;
    --text: #fafafa;
    --text-2: #a3a3a3;
    --text-3: #525252;
    --border: #262626;
    --border-2: #1f1f1f;
    --accent: #fafafa;
    --accent-soft: #1a1a1a;
    --accent-text: #0a0a0a;
    --shadow-1: 0 1px 3px rgba(0,0,0,.2);
    --shadow-2: 0 4px 24px rgba(0,0,0,.3);
    --shadow-3: 0 12px 48px rgba(0,0,0,.4);
    --shadow-4: 0 24px 80px rgba(0,0,0,.5);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background .4s var(--ease), color .4s var(--ease);
}

::selection { background: var(--text); color: var(--bg); }

/* ─── Header ─── */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    border-bottom: 1px solid var(--border-2);
}

.header-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font: inherit;
    text-decoration: none;
}

.logo-mark {
    width: 32px;
    height: 32px;
    background: var(--text);
    color: var(--bg);
    border-radius: var(--r-xs);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .85rem;
    letter-spacing: -.02em;
}

.logo-text {
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: -.02em;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--r-xs);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all .2s var(--ease);
}

.icon-btn:hover { color: var(--text); border-color: var(--text-3); }

.ico-moon { display: none; }
[data-theme="dark"] .ico-sun { display: none; }
[data-theme="dark"] .ico-moon { display: block; }

/* ─── Hero ─── */
.hero {
    max-width: var(--max);
    margin: 0 auto;
    padding: 72px 24px 0;
    text-align: center;
}

.hero-label {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 16px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 12px;
}

.hero-title em {
    font-style: italic;
    opacity: .4;
}

.hero-sub {
    font-size: 1rem;
    color: var(--text-3);
    font-weight: 400;
    max-width: 380px;
    margin: 0 auto 20px;
}

.hero-portfolio-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s var(--ease);
    box-shadow: var(--shadow-1);
}
.hero-portfolio-btn:hover {
    background: var(--text);
    color: var(--bg);
    transform: translateY(-1px);
    box-shadow: var(--shadow-2);
}

/* ─── Search ─── */
.search-bar {
    max-width: var(--max);
    margin: 40px auto 0;
    padding: 0 24px;
}

.search-box {
    position: relative;
    max-width: 440px;
    margin: 0 auto;
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 40px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: .875rem;
    outline: none;
    transition: all .2s var(--ease);
}

.search-box input::placeholder { color: var(--text-3); }
.search-box input:focus { border-color: var(--text-3); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ─── Filters ─── */
.filters {
    max-width: var(--max);
    margin: 24px auto 0;
    padding: 0 24px;
    overflow-x: auto;
    scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.filter-row {
    display: flex;
    gap: 6px;
    width: max-content;
    margin: 0 auto;
}

.chip {
    padding: 6px 16px;
    border-radius: var(--r-full);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-family: inherit;
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s var(--ease);
}

.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ─── Grid Info ─── */
.grid-info {
    max-width: var(--max);
    margin: 28px auto 0;
    padding: 0 24px;
    font-size: .78rem;
    color: var(--text-3);
    text-align: center;
    font-weight: 500;
}

/* ─── App Grid ─── */
.app-grid {
    max-width: var(--max);
    margin: 24px auto 0;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* ─── App Card ─── */
.app-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px;
    cursor: pointer;
    transition: all .3s var(--ease);
    animation: fadeUp .5s var(--spring) both;
}

.app-card:hover {
    border-color: var(--text-3);
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
}

.app-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.app-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.app-card-name {
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.app-card-cat {
    font-size: .7rem;
    font-weight: 500;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: 2px;
}

.app-card-desc {
    font-size: .85rem;
    color: var(--text-2);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.app-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-card-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.tag {
    padding: 3px 8px;
    border-radius: var(--r-full);
    background: var(--surface-2);
    font-size: .68rem;
    font-weight: 500;
    color: var(--text-3);
    white-space: nowrap;
}

.app-card-price {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    flex-shrink: 0;
}

.app-card-arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    color: var(--text-3);
    transition: all .3s var(--ease);
}

.app-card:hover .app-card-arrow {
    background: var(--text);
    color: var(--bg);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-card:nth-child(1) { animation-delay: .03s; }
.app-card:nth-child(2) { animation-delay: .06s; }
.app-card:nth-child(3) { animation-delay: .09s; }
.app-card:nth-child(4) { animation-delay: .12s; }
.app-card:nth-child(5) { animation-delay: .15s; }
.app-card:nth-child(6) { animation-delay: .18s; }
.app-card:nth-child(7) { animation-delay: .21s; }
.app-card:nth-child(8) { animation-delay: .24s; }
.app-card:nth-child(9) { animation-delay: .27s; }
.app-card:nth-child(10) { animation-delay: .30s; }
.app-card:nth-child(11) { animation-delay: .33s; }
.app-card:nth-child(12) { animation-delay: .36s; }

/* ─── Empty ─── */
.empty {
    max-width: var(--max);
    margin: 60px auto;
    padding: 0 24px;
    text-align: center;
    color: var(--text-3);
    font-size: .9rem;
}

/* ─── Footer ─── */
.footer {
    max-width: var(--max);
    margin: 80px auto 0;
    padding: 24px;
    text-align: center;
    font-size: .75rem;
    color: var(--text-3);
    border-top: 1px solid var(--border-2);
}

.footer-link {
    color: var(--text-3);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .2s var(--ease);
}

.footer-link:hover { color: var(--text); }

/* ═══════════════════════════════════════════
   DETAIL PAGE
   ═══════════════════════════════════════════ */

#detailPage { animation: pageIn .35s var(--spring); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }

.detail-top {
    position: relative;
    padding: 56px 24px 36px;
    text-align: center;
    overflow: hidden;
}

.detail-back {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--surface);
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-1);
    transition: all .2s var(--ease);
    opacity: .85;
}
.detail-back:hover { opacity: 1; transform: scale(1.08); box-shadow: var(--shadow-2); }

.detail-top-bg {
    position: absolute;
    inset: 0;
    opacity: .08;
    z-index: 0;
}

.detail-top-inner { position: relative; z-index: 1; }

.detail-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--r-lg);
    display: grid;
    place-items: center;
    font-size: 2.2rem;
    font-weight: 900;
    color: #fff;
    margin: 0 auto 16px;
    box-shadow: var(--shadow-3);
}

.detail-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    letter-spacing: -.03em;
    margin-bottom: 4px;
}

.detail-dev {
    font-size: .85rem;
    color: var(--text-3);
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 24px;
    font-size: .82rem;
}

.stars-inline { display: flex; gap: 1px; }
.stars-inline .s { color: var(--star); font-size: .85rem; }
.stars-inline .s.e { color: var(--border); }
.meta-val { font-weight: 700; color: var(--text); }
.meta-sep { color: var(--text-3); }
.meta-dim { color: var(--text-3); }

.btn-get {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    border-radius: var(--r-sm);
    background: var(--text);
    color: var(--bg);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all .25s var(--ease);
}

.btn-get:hover { opacity: .85; transform: translateY(-1px); }
.btn-get:active { transform: translateY(0); }

/* ─── Detail Body ─── */
.detail-body {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 20px 80px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px;
}

.card-title {
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: -.01em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.card-title svg { color: var(--text-3); flex-shrink: 0; }

.card-text {
    font-size: .88rem;
    color: var(--text-2);
    line-height: 1.65;
    margin-bottom: 14px;
}

/* ─── Pricing ─── */
.price-toggle {
    display: flex;
    background: var(--surface-2);
    border-radius: var(--r-full);
    padding: 3px;
    margin-bottom: 20px;
}

.pt-btn {
    flex: 1;
    padding: 8px 14px;
    border-radius: var(--r-full);
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-3);
    cursor: pointer;
    transition: all .2s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.pt-btn.active {
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    box-shadow: var(--shadow-1);
}

.save-badge {
    background: var(--green);
    color: #fff;
    font-size: .6rem;
    padding: 1px 6px;
    border-radius: var(--r-full);
    font-weight: 700;
}

.price-display { text-align: center; margin-bottom: 8px; }
.price-val { font-size: 3rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.price-unit { font-size: .9rem; color: var(--text-3); font-weight: 400; }
.price-note { text-align: center; font-size: .78rem; color: var(--text-3); }

/* ─── Screenshots ─── */
.shots-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.shots-scroll::-webkit-scrollbar { display: none; }

.shot {
    flex-shrink: 0;
    width: 180px;
    height: 340px;
    border-radius: var(--r-sm);
    overflow: hidden;
    scroll-snap-align: start;
    background: var(--surface-2);
    border: 1px solid var(--border);
    position: relative;
}

.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

.shot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-2);
    border-radius: var(--r-sm) var(--r-sm) 0 0;
}

.shot::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    z-index: 1;
}

/* ─── Tags ─── */
.tags-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ─── Features ─── */
.feat-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feat-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .85rem;
    color: var(--text-2);
}

.feat-list li::before {
    content: '✓';
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    font-size: .65rem;
    font-weight: 700;
    color: var(--green);
}

/* ─── Info Grid ─── */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.info-item { display: flex; flex-direction: column; gap: 2px; }
.info-label { font-size: .7rem; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.info-value { font-size: .85rem; font-weight: 600; color: var(--text); }

/* ─── Reviews ─── */
.count-pill {
    background: var(--surface-2);
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-3);
    margin-left: auto;
}

.review-write {
    background: var(--surface-2);
    border-radius: var(--r-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.rw-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.rw-label { font-size: .8rem; font-weight: 500; color: var(--text-2); }

.star-pick { display: flex; gap: 2px; }
.star-pick button {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--border);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color .15s;
}
.star-pick button.on { color: var(--star); }
.star-pick button:hover { color: var(--star); }

.rw-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--r-xs);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: .82rem;
    outline: none;
    transition: border-color .2s var(--ease);
    margin-bottom: 8px;
}

.rw-input:focus { border-color: var(--text-3); }
.rw-textarea { min-height: 72px; resize: vertical; }

.rw-submit {
    width: 100%;
    padding: 10px;
    border-radius: var(--r-xs);
    border: none;
    background: var(--text);
    color: var(--bg);
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}
.rw-submit:hover { opacity: .85; }

.reviews-list { display: flex; flex-direction: column; gap: 12px; }

.review-item {
    padding: 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
}

.review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.review-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .72rem;
    font-weight: 700;
    color: #fff;
}

.review-name { font-size: .82rem; font-weight: 600; }
.review-date { font-size: .7rem; color: var(--text-3); }
.review-stars { display: flex; gap: 1px; margin-bottom: 4px; }
.review-stars .s { color: var(--star); font-size: .78rem; }
.review-stars .s.e { color: var(--border); }
.review-text { font-size: .82rem; color: var(--text-2); line-height: 1.55; }

.no-reviews {
    text-align: center;
    padding: 20px;
    color: var(--text-3);
    font-size: .82rem;
}

/* ─── Screenshot clickable ─── */
.shot { cursor: pointer; }

/* ─── Lightbox ─── */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, .92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lbIn .25s ease;
}
@keyframes lbIn { from { opacity: 0; } }

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.12);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .2s;
    z-index: 2;
}
.lightbox-close:hover { background: rgba(255,255,255,.25); }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.1);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .2s;
    z-index: 2;
}
.lightbox-nav:hover { background: rgba(255,255,255,.25); }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-img-wrap {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--r-sm);
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
    animation: lbImgIn .3s var(--spring);
}
@keyframes lbImgIn { from { opacity: 0; transform: scale(.92); } }

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.6);
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: .04em;
}

/* ─── Desktop ─── */
@media (min-width: 640px) {
    .app-grid { grid-template-columns: repeat(2, 1fr); }
    .shot { width: 200px; height: 380px; }
}

@media (min-width: 960px) {
    .app-grid { grid-template-columns: repeat(3, 1fr); }
    .detail-top { padding: 72px 24px 44px; }
    .detail-body { padding: 0 40px 80px; }
}

@media (min-width: 1100px) {
    .app-grid { grid-template-columns: repeat(4, 1fr); }
    .detail-body { max-width: 720px; }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
