/* ============================================================
   HayDay Sipariş Stüdyosu — Tema
   ============================================================ */
:root {
    --bg: #0f1419;
    --bg-soft: #161d26;
    --card: #1b2430;
    --card-2: #212c3a;
    --line: #2a3646;
    --text: #eaf0f6;
    --muted: #9fb0c3;
    --primary: #46c46a;
    --primary-2: #2ea357;
    --accent: #f6b93b;
    --danger: #ef6f6f;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 18px 40px -18px rgba(0, 0, 0, .65);
    --ring: 0 0 0 3px rgba(70, 196, 106, .25);
    --maxw: 1180px;
    --topbar-h: 64px;
    --toolbar-h: 130px;
}

[data-theme="light"] {
    --bg: #f4f7f5;
    --bg-soft: #ffffff;
    --card: #ffffff;
    --card-2: #f1f5f2;
    --line: #e2e9e4;
    --text: #16241b;
    --muted: #5c7065;
    --shadow: 0 18px 40px -22px rgba(20, 40, 25, .35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    background:
        radial-gradient(1100px 600px at 85% -10%, rgba(70, 196, 106, .14), transparent 60%),
        radial-gradient(900px 500px at -10% 10%, rgba(246, 185, 59, .12), transparent 55%),
        var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 90px;
}

h1, h2, h3, .brand-text strong { font-family: "Fredoka", system-ui, sans-serif; }

a { color: inherit; text-decoration: none; }

.grad-text {
    background: linear-gradient(120deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ============ TOP BAR ============ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(12px);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    height: var(--topbar-h);
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand { display: flex; align-items: center; gap: 11px; }

.brand-badge {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    font-size: 21px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 8px 18px -8px var(--primary);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 19px; }
.brand-text small { color: var(--muted); font-size: 12px; letter-spacing: .3px; }

.topbar-stats { display: flex; align-items: center; gap: 10px; }

.stat-chip {
    display: flex; flex-direction: column; align-items: center;
    min-width: 56px;
    padding: 6px 12px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--line);
}

.stat-num { font-weight: 700; font-size: 17px; font-family: "Fredoka", sans-serif; }
.stat-label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }

.theme-toggle {
    width: 40px; height: 40px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    font-size: 17px;
    cursor: pointer;
    transition: transform .15s, background .2s;
}
.theme-toggle:hover { transform: rotate(-15deg); background: var(--card-2); }

/* ============ HERO ============ */
.hero {
    position: relative;
    max-width: var(--maxw);
    margin: 30px auto 8px;
    padding: 40px 22px 14px;
    overflow: hidden;
}

.hero-glow {
    position: absolute; inset: auto -10% -60% 30%;
    height: 320px;
    background: radial-gradient(closest-side, rgba(70, 196, 106, .25), transparent);
    filter: blur(20px);
    pointer-events: none;
}

.hero-content { position: relative; max-width: 720px; }

.hero-kicker {
    display: inline-block;
    font-size: 13px; font-weight: 600;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
    padding: 5px 13px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.hero h1 { font-size: clamp(28px, 5vw, 46px); line-height: 1.08; margin: 0 0 14px; letter-spacing: -.5px; }
.hero p { color: var(--muted); font-size: 16px; max-width: 560px; margin: 0 0 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: "Inter", sans-serif;
    font-weight: 600; font-size: 14.5px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .12s, box-shadow .2s, background .2s, opacity .2s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-block { width: 100%; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #06210f;
    box-shadow: 0 12px 26px -12px var(--primary);
}
.btn-primary:hover { box-shadow: 0 16px 30px -10px var(--primary); transform: translateY(-1px); }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--card); }

.btn-soft { background: var(--card-2); color: var(--text); border-color: var(--line); }
.btn-soft:hover { background: var(--card); }

.btn-order {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 12px 26px -12px #3b82f6;
}
.btn-order:hover { box-shadow: 0 16px 30px -10px #3b82f6; transform: translateY(-1px); }
.btn-order:disabled { opacity: .65; cursor: not-allowed; transform: none; }

/* ============ TOOLBAR ============ */
.toolbar {
    position: sticky;
    top: var(--topbar-h);
    z-index: 30;
    max-width: var(--maxw);
    margin: 18px auto 0;
    padding: 14px 18px;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 14px; font-size: 15px; opacity: .8; }

#search {
    width: 100%;
    padding: 12px 40px 12px 40px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: box-shadow .2s, border-color .2s;
}
#search:focus { border-color: var(--primary); box-shadow: var(--ring); }
#search::placeholder { color: var(--muted); }

.search-clear {
    position: absolute; right: 10px;
    width: 26px; height: 26px;
    border: none; border-radius: 8px;
    background: var(--card-2); color: var(--muted);
    cursor: pointer; font-size: 13px;
}

.chips {
    display: flex; gap: 8px;
    overflow-x: auto;
    padding: 12px 2px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
}
.chips.dragging { cursor: grabbing; }
.chips::-webkit-scrollbar { display: none; }

.chip {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--muted);
    font-size: 13.5px; font-weight: 600;
    cursor: pointer;
    transition: all .18s;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.active {
    color: #06210f;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border-color: transparent;
}
.chip .chip-count {
    font-size: 11px;
    background: color-mix(in srgb, #000 18%, transparent);
    padding: 1px 7px; border-radius: 999px;
}

/* ============ LAYOUT ============ */
.layout {
    max-width: var(--maxw);
    margin: 22px auto 0;
    padding: 0 18px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 26px;
    align-items: start;
}

/* ============ CATALOG ============ */
.group { margin-bottom: 34px; scroll-margin-top: 150px; }

.group-head {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 14px;
}
.group-emoji-img {
    width: 40px; height: 40px;
    object-fit: contain;
    border-radius: 11px;
    padding: 4px;
    background: var(--card);
    border: 1px solid var(--line);
}
.group-title { font-size: 18px; margin: 0; }
.group-line { flex: 1; height: 1px; background: var(--line); }
.group-tag { font-size: 12px; color: var(--muted); }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
}

.product {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color .2s, transform .15s, box-shadow .2s;
}
.product:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.product.selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }

.product-top { display: flex; align-items: flex-start; gap: 10px; }
.product-thumb {
    width: 48px; height: 48px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--card-2);
    flex: 0 0 auto;
    padding: 5px;
}
.product-img { width: 100%; height: 100%; object-fit: contain; }
.product-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.product-name { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.product-lvl {
    align-self: flex-start;
    font-size: 11px; font-weight: 600;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
    padding: 1px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.product-lvl strong { font-family: "Fredoka", sans-serif; }

.stepper {
    display: flex; align-items: center; justify-content: space-between;
    gap: 6px;
    background: var(--card-2);
    border-radius: 10px;
    padding: 4px;
}
.step-btn {
    width: 32px; height: 32px;
    border: none; border-radius: 8px;
    background: var(--card);
    color: var(--text);
    font-size: 18px; font-weight: 700;
    cursor: pointer;
    display: grid; place-items: center;
    transition: background .15s, transform .1s;
}
.step-btn:hover { background: var(--primary); color: #06210f; }
.step-btn:active { transform: scale(.92); }
.step-btn.minus:disabled { opacity: .35; cursor: not-allowed; }
.step-btn.minus:disabled:hover { background: var(--card); color: var(--text); }

.step-val {
    flex: 1; text-align: center;
    font-weight: 700; font-size: 15px;
    font-family: "Fredoka", sans-serif;
    min-width: 28px;
    background: transparent;
    border: none;
    color: var(--text);
    width: 100%;
    -moz-appearance: textfield;
}
.step-val::-webkit-outer-spin-button,
.step-val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-val:focus { outline: none; color: var(--primary); }

.no-result {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted);
    padding: 50px 0;
}

/* ============ SUMMARY ============ */
.summary { position: sticky; top: calc(var(--topbar-h) + var(--toolbar-h) + 16px); }

.summary-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex; flex-direction: column;
    max-height: calc(100vh - var(--topbar-h) - var(--toolbar-h) - 36px);
}

.summary-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}
.summary-head h2 { font-size: 17px; margin: 0; }
.summary-count { font-size: 12.5px; color: var(--muted); }

.summary-items { padding: 8px 12px; overflow-y: auto; flex: 1; min-height: 80px; }
.summary-empty { color: var(--muted); font-size: 13.5px; text-align: center; padding: 24px 12px; margin: 0; }

.summary-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 8px;
    border-radius: 10px;
    transition: background .15s;
}
.summary-row:hover { background: var(--card-2); }
.summary-row .s-img { width: 26px; height: 26px; object-fit: contain; flex: 0 0 auto; }
.summary-row .s-name { flex: 1; font-size: 13.5px; font-weight: 500; }
.summary-row .s-qty {
    font-weight: 700; font-size: 13.5px;
    color: var(--primary);
    font-family: "Fredoka", sans-serif;
}
.summary-row .s-del {
    border: none; background: transparent; color: var(--muted);
    cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 6px;
}
.summary-row .s-del:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }

.summary-foot { border-top: 1px solid var(--line); padding: 14px 16px; }
.summary-total {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.summary-total span { color: var(--muted); font-size: 13.5px; }
.summary-total strong { font-size: 22px; font-family: "Fredoka", sans-serif; }

.order-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.order-field { display: flex; flex-direction: column; gap: 5px; }
.order-field span { font-size: 12px; color: var(--muted); font-weight: 600; }
.order-field input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--card-2);
    color: var(--text);
    font-size: 14px;
    outline: none;
}
.order-field input:focus { border-color: var(--primary); box-shadow: var(--ring); }

.summary-buttons { display: flex; flex-direction: column; gap: 8px; }

/* ============ MODAL ============ */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 8, 12, .6); backdrop-filter: blur(3px); }

.modal-card {
    position: relative;
    width: min(560px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    animation: pop .22s ease;
}
@keyframes pop { from { transform: translateY(14px) scale(.97); opacity: 0; } }

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-close {
    border: none; background: var(--card-2); color: var(--text);
    width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 14px;
}
.modal-close:hover { background: var(--danger); color: #fff; }

#output {
    width: 100%; height: 240px; resize: vertical;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--text);
    font-family: "Inter", monospace; font-size: 13.5px; line-height: 1.6;
    outline: none;
}
#output:focus { border-color: var(--primary); box-shadow: var(--ring); }

.modal-actions { display: flex; gap: 10px; margin-top: 12px; }
.modal-actions .btn { flex: 1; }
.modal-order { margin-top: 10px; }

.success-card { text-align: center; max-width: 480px; }
.success-badge {
    width: 56px; height: 56px;
    margin: 0 auto 14px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #06210f;
    font-size: 28px; font-weight: 700;
    box-shadow: 0 12px 28px -10px var(--primary);
}
.success-card h3 { margin: 0 0 6px; font-size: 20px; }
.success-lead { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

.success-summary {
    text-align: left;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
    max-height: 280px;
    overflow-y: auto;
}
.success-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 0 14px;
}
.success-meta div { display: flex; flex-direction: column; gap: 2px; }
.success-meta dt { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.success-meta dd { margin: 0; font-weight: 700; font-family: "Fredoka", sans-serif; font-size: 15px; }

.success-items-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.success-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.success-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 10px;
    padding: 8px 10px;
    background: var(--card);
    border-radius: 10px;
    border: 1px solid var(--line);
}
.success-item-name { font-size: 13.5px; font-weight: 600; grid-column: 1; }
.success-item-qty { font-size: 13.5px; font-weight: 700; color: var(--primary); font-family: "Fredoka", sans-serif; }
.success-item-machine { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }

.order-fields--modal { margin-bottom: 14px; }
.order-modal-lead { margin: 0 0 14px; color: var(--muted); font-size: 14px; }

.copy-note {
    text-align: center; color: var(--primary); font-weight: 600; font-size: 13.5px;
    margin: 10px 0 0; height: 18px;
    opacity: 0; transition: opacity .25s;
}
.copy-note.show { opacity: 1; }

/* ============ MOBILE BAR ============ */
.mobile-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    display: none;
    align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
}
.mobile-bar-info { font-size: 14px; color: var(--muted); }
.mobile-bar-info strong { color: var(--text); font-size: 17px; font-family: "Fredoka", sans-serif; }
.mobile-bar .btn-order { padding: 11px 18px; white-space: nowrap; }

/* ============ TOAST ============ */
.toast {
    position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
    z-index: 80;
    background: var(--text); color: var(--bg);
    padding: 11px 20px; border-radius: 999px;
    font-size: 14px; font-weight: 600;
    box-shadow: var(--shadow);
    opacity: 0; pointer-events: none;
    transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ FOOTER ============ */
.footer { max-width: var(--maxw); margin: 40px auto 0; padding: 24px 18px; text-align: center; }
.footer p { color: var(--muted); font-size: 12.5px; margin: 0; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .summary { position: static; order: -1; }
    .summary-card { max-height: none; }
    .summary-items { max-height: 240px; }
    .summary-foot .order-fields,
    .summary-foot #btn-order { display: none; }
    .mobile-bar { display: flex; }
    body { padding-bottom: 80px; }
}

@media (max-width: 560px) {
    .stat-chip { min-width: 48px; padding: 5px 9px; }
    .hero { padding-top: 26px; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .brand-text small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
