:root {
    --red: #ef233c;
    --orange: #ff7a00;
    --dark: #111827;
    --muted: #64748b;
    --line: #e5e7eb;
    --soft: #f8fafc;
    --white: #ffffff;
    --radius: 22px;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 28%, #f8fafc 100%);
    color: var(--dark);
    padding-bottom: 82px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(229,231,235,.8);
}
.brand-mark {
    font-weight: 900;
    font-size: 24px;
    letter-spacing: -0.06em;
    background: linear-gradient(90deg, var(--red), var(--orange));
    -webkit-background-clip: text;
    color: transparent;
}
.top-nav { display: flex; gap: 10px; font-size: 13px; color: var(--muted); }
.top-nav a { padding: 8px 9px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }

.page-shell {
    width: min(1080px, 100%);
    margin: 0 auto;
    padding: 18px 14px 30px;
}

.hero-card, .section-block, .form-card, .summary-card, .chat-box {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.hero-card {
    background: radial-gradient(circle at top left, rgba(255,122,0,.14), transparent 35%), #fff;
}
.eyebrow { color: var(--red); text-transform: uppercase; font-size: 12px; font-weight: 800; letter-spacing: .08em; margin-bottom: 8px; }
h1 { font-size: clamp(28px, 8vw, 54px); line-height: 1.02; margin: 0 0 12px; letter-spacing: -0.05em; }
h2 { margin: 0 0 10px; font-size: 22px; letter-spacing: -0.03em; }
h3 { margin: 0 0 8px; font-size: 17px; }
p { color: var(--muted); line-height: 1.6; margin: 0 0 12px; }
.muted { color: var(--muted); }
.hero-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 18px; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 16px;
    min-height: 48px;
    padding: 12px 16px;
    font-weight: 800;
    cursor: pointer;
    background: var(--dark);
    color: #fff;
}
.btn.primary { background: linear-gradient(90deg, var(--red), var(--orange)); }
.btn.ghost { background: #fff; color: var(--dark); border: 1px solid var(--line); }
.btn.small { min-height: 40px; padding: 10px 12px; font-size: 14px; }
.btn.full { width: 100%; margin-top: 8px; }

.section-title { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.product-grid, .info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
.product-card, .info-card, .image-preview-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(15,23,42,.05);
}
.product-placeholder {
    height: 160px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fee2e2, #ffedd5);
    display: grid;
    place-items: center;
    color: rgba(239,35,60,.6);
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 14px;
}
.price { font-weight: 900; font-size: 18px; margin: 10px 0; }
.meta-row { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.meta-row span { background: var(--soft); border: 1px solid var(--line); padding: 6px 9px; border-radius: 999px; }

.product-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.mock-product-box, .product-info-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.shirt-shape {
    height: 360px;
    max-width: 280px;
    margin: 0 auto;
    background: #fff;
    border: 3px solid #e5e7eb;
    border-radius: 70px 70px 35px 35px;
    display: grid;
    place-items: center;
    position: relative;
}
.shirt-print-zone {
    width: 48%;
    height: 38%;
    border: 2px dashed var(--red);
    background: rgba(239,35,60,.07);
    color: var(--red);
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-weight: 800;
}

.stack-form { display: grid; gap: 14px; }
label span { display: block; font-weight: 800; margin-bottom: 7px; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px 14px;
    min-height: 48px;
    font: inherit;
    background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
.notice {
    border-radius: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    color: var(--dark);
    line-height: 1.5;
}
.notice.warning { background: #fff7ed; border-color: #fed7aa; }
.notice.success { background: #ecfdf5; border-color: #bbf7d0; }
.flash {
    width: min(1080px, calc(100% - 28px));
    margin: 14px auto 0;
    border-radius: 16px;
    padding: 14px;
    border: 1px solid var(--line);
}
.flash.success { background: #ecfdf5; }
.flash.error { background: #fef2f2; }

.builder-shell {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
#mockupCanvas {
    width: 100%;
    height: auto;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #f8fafc;
}
.builder-controls {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}
.builder-controls input[type=range] { padding: 0; }
.summary-layout { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; }
dl { display: grid; grid-template-columns: 42% 1fr; gap: 8px 12px; }
dt { color: var(--muted); font-weight: 700; }
dd { margin: 0; font-weight: 800; }
.line-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.chat-message { padding: 12px; border-radius: 16px; background: var(--soft); margin-bottom: 10px; }
.chat-message.customer { border-left: 4px solid var(--orange); }

.bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 40;
    background: rgba(17,24,39,.96);
    color: #fff;
    border-radius: 22px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 8px;
    box-shadow: 0 18px 50px rgba(15,23,42,.3);
}
.bottom-nav a { text-align: center; padding: 11px 6px; border-radius: 16px; font-size: 13px; font-weight: 800; }
.bottom-nav a:hover { background: rgba(255,255,255,.12); }
.pagination-wrap { margin-top: 16px; }

@media (min-width: 760px) {
    .page-shell { padding: 28px 22px 40px; }
    .hero-card, .section-block, .form-card, .summary-card, .chat-box { padding: 28px; }
    .hero-actions { grid-template-columns: max-content max-content; }
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .info-grid { grid-template-columns: repeat(3, 1fr); }
    .product-detail { grid-template-columns: 0.9fr 1.1fr; }
    .summary-layout { grid-template-columns: 0.8fr 1.2fr; }
    .builder-controls { grid-template-columns: repeat(4, 1fr); }
    .bottom-nav { display: none; }
    body { padding-bottom: 0; }
}
