/* STANISLA — site styles (base, catalog, landing) */

/* ---- Brand fonts (self-hosted) ---- */
@font-face {
    font-family: 'Jura';
    src: url('/fonts/jura-semibold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Jura';
    src: url('/fonts/jura-bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ---- Brand tokens ---- */
:root {
    --bg:        #fcfcfc;   /* warm near-white canvas */
    --surface:   #ffffff;   /* cards */
    --surface-2: #f6f5f4;   /* image wells, insets */
    --line:      #e1e1e1;   /* hairline colour */
    --line-w:    1.57812px; /* hairline width */
    --ink:       #323130;   /* headings / strong text */
    --ink-2:     #5a5655;   /* body text */
    --mut:       #73706f;   /* secondary text */
    --faint:     #ababab;   /* meta / disabled */
    --accent:    #fc4f00;   /* brand orange */
    --accent-d:  #e03f00;   /* hover orange */
    --accent-2:  #f68c5d;   /* soft orange */
    --radius:    0;         /* corner radius */
    --head-font: 'Jura', 'Trebuchet MS', system-ui, sans-serif;
    --body-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    --maxw:      1120px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink-2);
    font-family: var(--body-font);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--head-font);
    color: var(--ink);
    font-weight: 700;
    letter-spacing: 0.01em;
}

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

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}
/* Sticky footer: main grows to fill, footer pins to bottom on short pages */
main.container {
    flex: 1 0 auto;
}

/* ---- Header ---- */
.site-header {
    background: rgba(252,252,252,0.88);
    backdrop-filter: blur(10px);
    border-bottom: var(--line-w) solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}
.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}
.logo-img { height: 34px; width: auto; }
.site-header nav {
    display: flex;
    gap: 22px;
    align-items: center;
}
.site-header nav a {
    font-family: var(--head-font);
    font-size: 14px;
    font-weight: 600;
    color: var(--mut);
    text-decoration: none;
    transition: color 0.15s;
}
.site-header nav a:hover { color: var(--accent); }

/* ---- Filters ---- */
.filter-group {
    margin-bottom: 10px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-label {
    font-family: var(--head-font);
    font-size: 12px;
    font-weight: 700;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    min-width: 70px;
    flex-shrink: 0;
}
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.filter-btn {
    font-family: var(--body-font);
    font-size: 12px;
    padding: 5px 13px;
    border: var(--line-w) solid var(--line);
    border-radius: 0;
    background: var(--surface);
    color: var(--ink-2);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.filter-btn:hover {
    border-color: var(--accent-2);
    color: var(--ink);
}
.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.filter-btn.unavailable {
    opacity: 0.3;
    cursor: default;
}
.color-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

.no-results {
    text-align: center;
    padding: 40px 24px;
    font-size: 16px;
    color: var(--faint);
    display: none;
}

/* ---- Footer ---- */
.site-footer {
    border-top: var(--line-w) solid var(--line);
    text-align: center;
    padding: 28px 0;
    font-family: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.02em;
    color: var(--mut);
    background: var(--surface);
    flex-shrink: 0;
}

/* ---- Shared mobile ---- */
@media (max-width: 768px) {
    .filter-btn { font-size: 11px; padding: 4px 10px; }
    .filter-label { min-width: 58px; font-size: 11px; }
}

/* ============================================================
   Catalog pages  (body.page-catalog)
   ============================================================ */
.page-catalog .hero {
    text-align: center;
    padding: 56px 0 36px;
}
.page-catalog .hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--ink);
    letter-spacing: 0.01em;
}
.page-catalog .hero h1 .accent { color: var(--accent); }
.page-catalog .hero .sub {
    font-size: 18px;
    color: var(--mut);
    margin: 0;
}
.page-catalog .hero .meta {
    font-size: 13px;
    color: var(--faint);
    margin-top: 10px;
}

/* Card grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}
.card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: var(--line-w) solid var(--accent);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-3px);
}
.card-img {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}
.placeholder span {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    text-align: center;
    padding: 12px;
}
.card-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.card-body h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 3px;
    color: var(--ink);
}
.card-sub {
    font-size: 12px;
    color: var(--mut);
    margin: 0 0 2px;
}
.card-opt {
    font-size: 11px;
    color: var(--faint);
    margin: 0 0 8px;
}
.card-price {
    font-family: var(--head-font);
    font-size: 19px;
    font-weight: 700;
    color: var(--ink);
    margin: auto 0 10px;
}
/* Full-width button, flush to the card edges */
.buy-btn {
    display: block;
    width: 100%;
    margin: 0;
    padding: 13px 0;
    font-family: var(--head-font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: none;
    border-radius: 0;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.buy-btn:hover {
    background: var(--accent-d);
}
.buy-btn:active {
    transform: scale(0.98);
}

.page-catalog .no-results {
    padding: 60px 24px;
    font-size: 18px;
    grid-column: 1 / -1;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open {
    display: flex;
}
.modal {
    background: var(--surface);
    border-radius: 0;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(0,0,0,0.06);
    border: none;
    width: 32px;
    height: 32px;
    min-width: 32px;
    line-height: 32px;
    padding: 0;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    z-index: 10;
    transition: background 0.15s;
}
.modal-close:hover {
    background: rgba(0,0,0,0.12);
}
.modal-images {
    display: flex;
    gap: 8px;
    background: var(--surface-2);
    border-radius: 0;
    padding: 20px;
}
.modal-images img {
    flex: 1;
    min-width: 0;
    max-width: 50%;
    object-fit: cover;
    aspect-ratio: var(--modal-ar, 3/4);
    border-radius: 0;
}
.modal-images img:only-child {
    max-width: 100%;
    margin: 0 auto;
}
.modal-images .modal-placeholder {
    flex: 1;
    aspect-ratio: var(--modal-ar, 3/4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 14px;
    border-radius: 0;
    background: #eee;
}
.modal-body {
    padding: 24px;
}
.modal-body h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--ink);
}
.modal-body .modal-sub {
    font-size: 14px;
    color: var(--mut);
    margin: 0 0 6px;
}
.modal-price {
    font-family: var(--head-font);
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    margin: 0 0 20px;
}
.modal-body h4 {
    font-family: var(--head-font);
    font-size: 13px;
    font-weight: 700;
    color: var(--mut);
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.social-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.15s;
}
.social-btn:hover {
    opacity: 0.85;
    color: #fff;
}
.social-btn.max { background: #8B5CF6; }
.social-btn.tg { background: #2AABEE; }
.social-btn.wa { background: #25D366; }
.social-btn.vk { background: #0077FF; }

@media (max-width: 768px) {
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .social-links { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .page-catalog .hero { padding: 32px 0 20px; }
    .page-catalog .hero h1 { font-size: 28px; }
    .card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card-body { padding: 10px 12px 12px; }
    .card-body h3 { font-size: 13px; }
    .card-price { font-size: 16px; }
    .buy-btn { font-size: 13px; padding: 7px 0; }
}

/* ============================================================
   Landing page  (body.page-landing)
   ============================================================ */
.page-landing main.container {
    padding: 0 32px;     /* match header side padding so cards align with logo/nav */
}
.page-landing .hero {
    text-align: center;
    padding: 28px 0 22px;
}
.page-landing .hero h1 {
    font-size: 40px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--ink);
}
.page-landing .hero .sub {
    font-size: 17px;
    color: var(--mut);
    margin: 0;
}

.landing-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;                /* flush cards, collapsed borders */
    margin-bottom: 24px;
    max-width: 880px;
    margin-left: auto;
    margin-right: auto;
    /* collapsed borders: grid draws top + left, cards draw right + bottom */
    border-top: var(--line-w) solid var(--line);
    border-left: var(--line-w) solid var(--line);
}
/* Top row: 2 cards span 3/6 each. Bottom row: 3 cards span 2/6 each.
   Optional used-goods feature card spans the full width below them. */
.landing-card.lc-wide { grid-column: span 3; }
.landing-card.lc-narrow { grid-column: span 2; }
.landing-card.lc-full { grid-column: span 6; }
.landing-card.lc-full .landing-card-img { aspect-ratio: auto; max-height: 150px; }
.landing-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border-right: var(--line-w) solid var(--line);
    border-bottom: var(--line-w) solid var(--line);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.landing-card-img {
    aspect-ratio: 16/9;
    max-height: 190px;
    overflow: hidden;
    background: var(--surface-2);
}
.landing-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.landing-card-body {
    padding: 13px 18px 15px;
    text-align: center;
}
.landing-card-body h2 {
    font-family: var(--head-font);
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--ink);
    transition: color 0.15s;
}
.landing-card:hover .landing-card-body h2 {
    color: var(--accent);
}

@media (max-width: 768px) {
    .landing-grid { grid-template-columns: 1fr; gap: 0; }
    .landing-card.lc-wide, .landing-card.lc-narrow, .landing-card.lc-full { grid-column: auto; }
    .page-landing .hero { padding: 32px 0 20px; }
    .page-landing .hero h1 { font-size: 28px; }
}
