/* GiftHub — mobile-first stylesheet. No framework; tokens on :root. */
:root {
  --brand: #d6336c;
  --brand-dark: #a61e4d;
  --brand-soft: #fff0f6;
  --ink: #1f2433;
  --ink-2: #4a5065;
  --muted: #8a8fa3;
  --line: #ececf2;
  --bg: #faf8f6;
  --card: #ffffff;
  --gold: #f59f00;
  --ok: #2b8a3e;
  --ok-soft: #ebfbee;
  --warn: #e67700;
  --warn-soft: #fff4e6;
  --bad: #c92a2a;
  --bad-soft: #fff5f5;
  --info-soft: #e7f5ff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 20, 40, .05), 0 4px 16px rgba(20, 20, 40, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; font-size: 15px; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }

/* ---------- header ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .container { display: flex; align-items: center; gap: 12px; height: 62px; }
.logo { font-weight: 800; font-size: 1.25rem; color: var(--ink); letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 1rem; }
.search { flex: 1; display: none; }
.search input { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 10px 16px; font: inherit; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a, .nav button.linklike { color: var(--ink-2); padding: 8px 10px; border-radius: 10px; font-weight: 500; position: relative; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; height: 18px; line-height: 18px; border-radius: 9px; background: var(--brand); color: #fff; font-size: .72rem; text-align: center; font-weight: 700; }
.nav .badge { position: absolute; top: 0; right: -2px; }
.nav .label { display: none; }
.mobile-search { padding: 0 16px 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.mobile-search input { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 10px 16px; font: inherit; }
@media (min-width: 760px) {
  .search { display: block; max-width: 460px; }
  .mobile-search { display: none; }
  .nav .label { display: inline; }
}

/* ---------- messages ---------- */
.flash { padding: 12px 14px; border-radius: var(--radius-sm); margin: 16px 0 0; font-weight: 500; }
.flash.success { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.flash.info, .flash.warning { background: var(--info-soft); color: #1864ab; }

main { padding: 20px 0 60px; min-height: 70vh; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--bg); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--brand-dark); padding-left: 8px; padding-right: 8px; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { background: var(--card); color: var(--bad); border-color: #ffc9c9; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ok { background: var(--ok); }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
button.linklike { background: none; border: 0; font: inherit; cursor: pointer; color: var(--brand-dark); padding: 0; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=search], input[type=file], select, textarea {
  width: 100%; border: 1px solid #dcdce6; border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #fcc2d7; border-color: var(--brand); }
.field { margin-bottom: 14px; }
.field .help, .helptext { color: var(--muted); font-size: .8rem; margin-top: 3px; display: block; }
.errorlist { list-style: none; margin: 4px 0 0; padding: 0; color: var(--bad); font-size: .85rem; }
.checkbox-row { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.checkbox-row input { width: auto; }
.choice-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.choice-list li label, .chips label { font-weight: 500; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: #fff; }
.choice-list input, .chips input { width: auto; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 0 12px; }
.section-title h2 { margin: 0; }

/* ---------- hero ---------- */
.hero { border-radius: 20px; padding: 28px 22px; background: linear-gradient(135deg, #d6336c 0%, #f06595 55%, #ffa94d 100%); color: #fff; position: relative; overflow: hidden; }
.hero h1 { font-size: 1.9rem; margin-bottom: 8px; max-width: 560px; }
.hero p { max-width: 520px; opacity: .95; font-size: 1.02rem; }
.hero .btn { background: #fff; color: var(--brand-dark); }
.hero .btn.secondary { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.5); }
.hero-steps { display: grid; gap: 10px; margin-top: 18px; grid-template-columns: 1fr; }
.hero-steps div { background: rgba(255,255,255,.14); border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
.hero-steps b { display: block; }
@media (min-width: 760px) { .hero { padding: 44px 40px; } .hero h1 { font-size: 2.4rem; } .hero-steps { grid-template-columns: repeat(3, 1fr); max-width: 720px; } }

.pill-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.pill-row::-webkit-scrollbar { display: none; }
.pill { white-space: nowrap; border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 500; }
.pill:hover, .pill.active { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); text-decoration: none; }

/* ---------- product grid ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1024px) { .grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.product-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.product-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.thumb { aspect-ratio: 1 / 1; background: linear-gradient(135deg, #fff0f6, #fff4e6); display: grid; place-items: center; font-size: 3rem; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.product-card .name { font-weight: 600; font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .shop { color: var(--muted); font-size: .8rem; }
.price { font-weight: 700; color: var(--ink); }
.product-card .price { margin-top: auto; padding-top: 6px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); }
.tag.gray { background: #f1f3f5; color: var(--ink-2); }

.shop-card { display: flex; gap: 12px; align-items: center; color: var(--ink); }
.shop-card:hover { text-decoration: none; }
.avatar { width: 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.6rem; border-radius: 18px; }

/* ---------- product detail ---------- */
.pd { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .pd { grid-template-columns: 1.05fr 1fr; gap: 36px; } }
.gallery .main { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 8px; }
.gallery .thumbs button { width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: none; }
.gallery .thumbs button.active { border-color: var(--brand); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pd .price { font-size: 1.6rem; }
.meta-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; color: var(--ink-2); font-size: .92rem; }
.qty { width: 90px !important; }
.pack-options { display: grid; gap: 8px; }
.pack-options div { display: flex; justify-content: space-between; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; font-size: .9rem; }

/* ---------- tables / lists ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }

.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; background: #f1f3f5; color: var(--ink-2); }
.status.placed, .status.open { background: var(--info-soft); color: #1864ab; }
.status.accepted, .status.preparing, .status.quoted { background: var(--warn-soft); color: var(--warn); }
.status.out_for_delivery { background: #f3f0ff; color: #6741d9; }
.status.delivered, .status.paid, .status.success { background: var(--ok-soft); color: var(--ok); }
.status.rejected, .status.cancelled, .status.failed, .status.declined { background: var(--bad-soft); color: var(--bad); }
.status.pending_payment, .status.pending, .status.to_collect { background: #fff9db; color: #e67700; }

/* ---------- cart / checkout ---------- */
.two-col { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 360px; align-items: start; } .sticky { position: sticky; top: 80px; } }
.cart-item { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item .thumb { border-radius: 10px; font-size: 1.8rem; }
.summary-line { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-line.total { font-weight: 800; font-size: 1.1rem; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
.pay-methods { display: grid; gap: 8px; }
.pay-methods label { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-weight: 600; cursor: pointer; }
.pay-methods input { width: auto; }
.address-choice { display: grid; gap: 8px; }
.address-choice label { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-weight: 500; cursor: pointer; }
.address-choice input { width: auto; margin-top: 4px; }

/* ---------- timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; position: relative; padding-bottom: 16px; }
.timeline li::before { content: ""; position: absolute; left: 12px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; font-size: .7rem; color: #fff; z-index: 1; }
.timeline .done .dot { background: var(--ok); border-color: var(--ok); }
.timeline .done::before { background: var(--ok); }
.timeline .current .dot { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.timeline .todo { color: var(--muted); }

/* ---------- chat ---------- */
.chat-layout { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .chat-layout { grid-template-columns: 1fr 320px; } }
.chat { display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 460px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-head .avatar { width: 38px; height: 38px; font-size: .95rem; }
.chat-status { font-size: .75rem; color: var(--muted); }
.chat-status.live { color: var(--ok); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #fcfbfa; }
.msg { max-width: 80%; padding: 9px 13px; border-radius: 16px; background: #fff; border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; align-self: flex-start; }
.msg.mine { align-self: flex-end; background: var(--brand); color: #fff; border-color: var(--brand); border-bottom-right-radius: 4px; }
.msg.theirs { border-bottom-left-radius: 4px; }
.msg.system { align-self: center; background: #f1f3f5; border: 0; color: var(--ink-2); font-size: .85rem; max-width: 92%; border-radius: 12px; }
.msg .time { display: block; font-size: .7rem; opacity: .7; margin-top: 3px; }
.msg img { border-radius: 10px; margin-bottom: 4px; max-height: 260px; }
.chat-form { border-top: 1px solid var(--line); padding: 10px; display: flex; gap: 8px; align-items: flex-end; background: #fff; }
.chat-form textarea { flex: 1; border-radius: 20px; min-height: 42px; max-height: 140px; padding: 10px 14px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; flex: none; font-size: 1.1rem; }
.icon-btn.send { background: var(--brand); color: #fff; border-color: var(--brand); }
.file-name { font-size: .8rem; color: var(--muted); padding: 0 12px 6px; }
.brief dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 10px; font-weight: 600; }
.brief dd { margin: 2px 0 0; white-space: pre-wrap; }

.inbox-item { display: flex; gap: 12px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); color: var(--ink); }
.inbox-item:hover { background: var(--bg); text-decoration: none; }

/* ---------- vendor area ---------- */
.vendor-shell { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .vendor-shell { grid-template-columns: 220px 1fr; } }
.side-nav { display: flex; gap: 6px; overflow-x: auto; }
.side-nav a { white-space: nowrap; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.side-nav a .badge { margin-left: auto; }
.side-nav a:hover { background: var(--card); text-decoration: none; }
.side-nav a.active { background: var(--card); color: var(--brand-dark); box-shadow: var(--shadow); }
@media (min-width: 900px) { .side-nav { flex-direction: column; position: sticky; top: 80px; } }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: .8rem; font-weight: 600; }
.stat .v { font-size: 1.5rem; font-weight: 800; margin-top: 2px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; }
.img-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.img-grid .img { width: 110px; }
.img-grid .img img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); }
.img-grid .img.primary img { border-color: var(--brand); }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .big { font-size: 2.6rem; }

footer.site { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: .85rem; background: var(--card); }

/* ---------- payment waiting ---------- */
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); animation: spin 1s linear infinite; margin: 10px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }
.narrow { max-width: 520px; margin: 0 auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips input:checked + span { color: var(--brand-dark); font-weight: 700; }
/* grid children must be allowed to shrink, or wide tables push the page sideways on phones */
.vendor-shell > *, .two-col > *, .chat-layout > *, .pd > * { min-width: 0; }
/* ---------- icons (Flaticon UIcons, solid rounded) ---------- */
.fi { display: inline-block; line-height: 1; }
.fi::before { display: block; }
.i { font-size: 1.1em; vertical-align: -.15em; flex: none; }
.nav .i { font-size: 1.25rem; vertical-align: -4px; }
.cat-icon { font-size: 1rem; vertical-align: -2px; margin-right: 2px; }
.thumb .fi { opacity: .85; } /* inherits each .thumb's font-size */
.gallery .main .fi { font-size: 6rem; }

/* each icon keeps its own color everywhere it appears */
.fi-sr-gift, .fi-sr-cross-circle, .fi-sr-ban, .fi-sr-marker, .fi-sr-heart, .fi-sr-cross-small { color: #e03131; }
.fi-sr-shopping-bag, .fi-sr-ribbon, .fi-sr-flower-tulip, .fi-sr-cake-birthday { color: #e64980; }
.fi-sr-palette, .fi-sr-pen-nib { color: #ae3ec9; }
.fi-sr-shop, .fi-sr-camera { color: #7048e8; }
.fi-sr-circle-user { color: #4263eb; }
.fi-sr-comment-alt, .fi-sr-search, .fi-sr-chart-pie-alt { color: #1c7ed6; }
.fi-sr-settings, .fi-sr-eye, .fi-sr-clip { color: #1098ad; }
.fi-sr-shopping-cart, .fi-sr-spa { color: #0ca678; }
.fi-sr-check-circle, .fi-sr-mobile-notch, .fi-sr-money-bill-wave { color: #2f9e44; }
.fi-sr-stopwatch, .fi-sr-hourglass-end { color: #f59f00; }
.fi-sr-box-open, .fi-sr-party-horn, .fi-sr-alarm-clock, .fi-sr-shopping-basket { color: #f76707; }
/* on filled/colored backgrounds, icons follow the text color instead */
.btn:not(.ghost):not(.secondary):not(.danger) .fi, .icon-btn.send .fi, .timeline .dot .fi { color: inherit; }

/* ---------- "Deliver to" county bar + delivery availability ---------- */
.deliver-bar { background: var(--brand-soft); border-bottom: 1px solid var(--line); font-size: .88rem; }
.deliver-bar form { display: flex; align-items: center; gap: 8px; padding: 6px 0; flex-wrap: wrap; }
.deliver-bar select { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 10px; font: inherit; max-width: 60vw; }
.deliver-bar .hint { color: var(--muted); }
.undeliverable { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--bad-soft); color: var(--bad); border-radius: var(--radius-sm); padding: 8px 10px; margin: 8px 0; font-size: .88rem; font-weight: 500; }
.undeliverable[hidden] { display: none; }
.available-here { background: var(--ok-soft); color: var(--ok); border-radius: var(--radius-sm); padding: 8px 10px; font-size: .9rem; font-weight: 500; margin: 10px 0; }
.delivery-areas { columns: 2 180px; margin: 0; padding: 0; list-style: none; font-size: .88rem; }
.delivery-areas li { break-inside: avoid; padding: 3px 0; display: flex; justify-content: space-between; gap: 8px; }
.delivery-areas li.here { font-weight: 700; color: var(--brand-dark); }
tr.row-error td { background: var(--bad-soft); }
#delivery-areas td input[type=number], #delivery-areas td input[type=text] { width: 100%; }
