/* Synformax Store — shared styles */

:root {
    --bg: #0a0a0a;
    --surface: #111111;
    --surface-2: #181818;
    --line: #262626;
    --line-2: #333333;
    --text: #f5f5f4;
    --text-2: #a3a3a3;
    --text-3: #737373;
    --accent: #d4b483;
    --accent-2: #c19a5b;
    --success: #6ec77a;
    --error: #e07a6b;
    --max: 1200px;
    --pad: clamp(1rem, 3vw, 2rem);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font: inherit;
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
}

.mono {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-feature-settings: "tnum" 1;
}

.italic {
    font-style: italic;
    color: var(--accent);
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.header-bar {
    max-width: var(--max);
    margin: 0 auto;
    padding: 1rem var(--pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    letter-spacing: 0.08em;
    font-weight: 600;
    font-size: 0.95rem;
}

.brand-mark {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    color: var(--accent);
}

.brand-store {
    color: var(--text-2);
    font-weight: 400;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.nav a {
    font-size: 0.9rem;
    color: var(--text-2);
    transition: color 0.15s ease;
}

.nav a:hover,
.nav a.active {
    color: var(--text);
}

.cart-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.cart-button:hover {
    border-color: var(--accent);
    background: var(--surface);
}

.cart-count {
    background: var(--accent);
    color: #1a1208;
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.menu-toggle {
    display: none;
    padding: 0.5rem;
    color: var(--text);
}

@media (max-width: 760px) {
    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0;
        display: none;
    }

    .nav.open {
        display: flex;
    }

    .nav a {
        padding: 0.875rem var(--pad);
        width: 100%;
        border-bottom: 1px solid var(--line);
    }

    .menu-toggle {
        display: inline-flex;
    }
}

/* ---------- Hero ---------- */
.hero {
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(ellipse at 80% 20%, rgba(212, 180, 131, 0.08), transparent 60%),
        radial-gradient(ellipse at 10% 90%, rgba(212, 180, 131, 0.05), transparent 55%),
        var(--bg);
}

.hero-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: clamp(3rem, 8vw, 6rem) var(--pad) clamp(2.5rem, 6vw, 4.5rem);
}

.eyebrow {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.hero h1 {
    font-size: clamp(2rem, 5.5vw, 3.5rem);
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -0.02em;
    max-width: 22ch;
    margin-bottom: 1.25rem;
}

.hero p.lede {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    color: var(--text-2);
    max-width: 56ch;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
    border: 1px solid transparent;
    text-align: center;
    line-height: 1;
}

.btn-primary {
    background: var(--accent);
    color: #1a1208;
}

.btn-primary:hover {
    background: var(--accent-2);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-ghost {
    border-color: var(--line-2);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.625rem 1rem;
    font-size: 0.825rem;
}

/* ---------- Section ---------- */
main {
    flex: 1;
}

.section {
    max-width: var(--max);
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 4.5rem) var(--pad);
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.section-head h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.section-head .meta {
    color: var(--text-3);
    font-size: 0.85rem;
}

/* ---------- Filters ---------- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter {
    padding: 0.5rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.825rem;
    color: var(--text-2);
    transition: all 0.15s ease;
}

.filter:hover {
    border-color: var(--line-2);
    color: var(--text);
}

.filter.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(212, 180, 131, 0.08);
}

/* ---------- Product Grid ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: var(--line-2);
}

.product-thumb {
    aspect-ratio: 4 / 3;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}

.product-thumb svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.product-tag {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid var(--line-2);
    color: var(--accent);
    font-size: 0.7rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.product-body {
    padding: 1.125rem 1.125rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.product-cat {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-3);
}

.product-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
}

.product-desc {
    font-size: 0.85rem;
    color: var(--text-2);
    line-height: 1.5;
    flex: 1;
}

.product-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    gap: 0.75rem;
}

.product-price {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1.05rem;
    font-weight: 600;
}

/* ---------- Product Detail ---------- */
.pdp {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

@media (max-width: 820px) {
    .pdp {
        grid-template-columns: 1fr;
    }
}

.pdp-media {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
}

.pdp-media svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.pdp-info h1 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0.5rem 0 0.75rem;
    line-height: 1.15;
}

.pdp-price {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.pdp-section {
    border-top: 1px solid var(--line);
    padding: 1.25rem 0;
}

.pdp-section h3 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-3);
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.pdp-section p,
.pdp-section li {
    color: var(--text-2);
    font-size: 0.95rem;
}

.pdp-section ul {
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.pdp-section li::before {
    content: "—";
    color: var(--accent);
    margin-right: 0.5rem;
}

.qty-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 1rem;
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line-2);
    border-radius: 4px;
    overflow: hidden;
}

.qty-stepper button {
    padding: 0.6rem 0.85rem;
    color: var(--text-2);
}

.qty-stepper button:hover {
    color: var(--accent);
}

.qty-stepper span {
    padding: 0 0.5rem;
    min-width: 2.5rem;
    text-align: center;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9rem;
}

.stock {
    font-size: 0.825rem;
    color: var(--success);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.stock::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
}

.crumbs {
    font-size: 0.8rem;
    color: var(--text-3);
    margin-bottom: 1rem;
}

.crumbs a:hover {
    color: var(--accent);
}

/* ---------- Cart Drawer ---------- */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100%);
    background: var(--surface);
    border-left: 1px solid var(--line);
    z-index: 101;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.drawer.open {
    transform: translateX(0);
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.drawer-head h3 {
    font-size: 1rem;
    font-weight: 600;
}

.drawer-close {
    color: var(--text-2);
    padding: 0.25rem 0.5rem;
    font-size: 1.25rem;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1.25rem;
}

.drawer-foot {
    border-top: 1px solid var(--line);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.line-row {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 0.875rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
    align-items: start;
}

.line-row:last-child {
    border-bottom: none;
}

.line-thumb {
    aspect-ratio: 1;
    background: var(--surface-2);
    border-radius: 4px;
    border: 1px solid var(--line);
    overflow: hidden;
    position: relative;
}

.line-thumb svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.line-name {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.line-meta {
    font-size: 0.8rem;
    color: var(--text-3);
}

.line-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.line-actions button {
    color: var(--text-3);
    font-size: 0.8rem;
    padding: 0.25rem;
}

.line-actions button:hover {
    color: var(--accent);
}

.line-price {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
}

.totals {
    font-size: 0.9rem;
    display: grid;
    gap: 0.4rem;
}

.totals .row {
    display: flex;
    justify-content: space-between;
    color: var(--text-2);
}

.totals .row.grand {
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
    margin-top: 0.4rem;
}

.empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-3);
}

/* ---------- Forms ---------- */
.form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr 1fr;
}

.form-grid .full {
    grid-column: 1 / -1;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.field label {
    font-size: 0.78rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.field input,
.field select,
.field textarea {
    background: var(--surface);
    border: 1px solid var(--line-2);
    color: var(--text);
    padding: 0.75rem 0.875rem;
    border-radius: 4px;
    font: inherit;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-2);
}

.field textarea {
    min-height: 120px;
    resize: vertical;
}

/* ---------- Cards / panels ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1.5rem;
}

.panel + .panel {
    margin-top: 1rem;
}

.panel h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 880px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--line);
}

.summary-line:last-of-type {
    border-bottom: none;
}

.summary-line .name {
    color: var(--text-2);
}

.summary-line .amt {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- Article / policy pages ---------- */
.prose {
    max-width: 70ch;
    margin: 0 auto;
}

.prose h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.prose .lastupdate {
    color: var(--text-3);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.prose h2 {
    font-size: 1.25rem;
    margin: 2rem 0 0.75rem;
    font-weight: 600;
}

.prose p,
.prose li {
    color: var(--text-2);
    margin-bottom: 0.85rem;
    line-height: 1.7;
}

.prose ul {
    padding-left: 1.25rem;
    margin-bottom: 0.85rem;
}

.prose strong {
    color: var(--text);
    font-weight: 600;
}

.prose a {
    color: var(--accent);
    border-bottom: 1px solid var(--line-2);
}

.prose a:hover {
    border-color: var(--accent);
}

/* ---------- Two-column info pages ---------- */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
}

@media (max-width: 760px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

.info-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1.5rem;
}

.info-card h3 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-3);
    margin-bottom: 0.75rem;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.info-card p,
.info-card a {
    color: var(--text);
    line-height: 1.6;
}

.info-card p + p {
    margin-top: 0.5rem;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    margin-top: 4rem;
    background: var(--surface);
}

.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: clamp(2.5rem, 5vw, 3.5rem) var(--pad) 2rem;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 760px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

.footer-col h4 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-3);
    margin-bottom: 1rem;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-weight: 600;
}

.footer-col ul {
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.footer-col a {
    color: var(--text-2);
    font-size: 0.875rem;
    transition: color 0.15s ease;
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-brand p {
    color: var(--text-2);
    font-size: 0.875rem;
    margin-top: 0.75rem;
    max-width: 36ch;
}

.footer-bottom {
    max-width: var(--max);
    margin: 0 auto;
    padding: 1.25rem var(--pad);
    border-top: 1px solid var(--line);
    color: var(--text-3);
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--surface);
    border: 1px solid var(--line-2);
    color: var(--text);
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    font-size: 0.875rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
