/* Customer account (storefront) */
.ac-wrap { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1.6rem; align-items: start; padding: 2rem 0 3rem; }
.ac-side { position: sticky; top: 92px; background: #fff; border: 1px solid var(--bf-line); border-radius: 22px; padding: 1.3rem; box-shadow: 0 6px 22px rgba(31, 91, 46, .06); }
.ac-who { display: flex; align-items: center; gap: .8rem; padding-bottom: 1rem; margin-bottom: .8rem; border-bottom: 1px dashed var(--bf-line); }
.ac-av { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--bf-green-700), var(--bf-green-500)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.3rem; flex: none; }
.ac-who strong { display: block; line-height: 1.2; } .ac-who small { color: var(--bf-muted); word-break: break-all; }
.ac-nav { display: grid; gap: .25rem; }
.ac-nav a, .ac-nav button { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border-radius: 14px; color: var(--bf-ink); font-weight: 500; background: none; border: 0; width: 100%; text-align: left; transition: all .2s; }
.ac-nav a i, .ac-nav button i { width: 34px; height: 34px; border-radius: 10px; background: var(--bf-green-100); color: var(--bf-green-700); display: grid; place-items: center; font-size: .9rem; transition: all .2s; }
.ac-nav a:hover { background: var(--bf-cream); transform: translateX(3px); }
.ac-nav a.on { background: var(--bf-green-100); color: var(--bf-green-900); font-weight: 600; } .ac-nav a.on i { background: var(--bf-green-700); color: #fff; }
.ac-nav .badge-n { margin-left: auto; background: var(--bf-orange-500); color: #fff; font-size: .7rem; border-radius: 99px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; }
.ac-nav .out { color: #b0392e; } .ac-nav .out i { background: #fbe3e1; color: #b0392e; }

.ac-card { background: #fff; border: 1px solid var(--bf-line); border-radius: 22px; padding: 1.4rem; box-shadow: 0 6px 22px rgba(31, 91, 46, .05); }
.ac-card + .ac-card, .ac-stack > * + * { margin-top: 1.2rem; }
.ac-card h2 { font-size: 1.15rem; margin: 0 0 1rem; font-family: var(--bf-font-body); font-weight: 600; display: flex; align-items: center; gap: .6rem; }
.ac-card h2 i { color: var(--bf-orange-500); }
.ac-hero { background: linear-gradient(120deg, var(--bf-green-900), var(--bf-green-700) 70%, var(--bf-green-500)); color: #fff; border-radius: 26px; padding: 1.8rem 2rem; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ac-hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(240, 138, 28, .55), transparent 70%); }
.ac-hero h1 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0 0 .3rem; } .ac-hero p { margin: 0; opacity: .85; }
.ac-hero > * { position: relative; z-index: 2; }
.ac-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.ac-stat { background: #fff; border: 1px solid var(--bf-line); border-radius: 20px; padding: 1rem 1.1rem; display: flex; align-items: center; gap: .9rem; transition: transform .3s, box-shadow .3s; }
.ac-stat:hover { transform: translateY(-4px); box-shadow: var(--bf-shadow); }
.ac-stat .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.15rem; flex: none; }
.ac-stat:nth-child(1) .ic { background: var(--bf-green-100); color: var(--bf-green-700); } .ac-stat:nth-child(2) .ic { background: var(--bf-orange-100); color: var(--bf-orange-600); }
.ac-stat:nth-child(3) .ic { background: #e3f4e8; color: #2e9e4f; } .ac-stat:nth-child(4) .ic { background: #fde4ee; color: #d6457f; }
.ac-stat b { display: block; font-size: 1.35rem; line-height: 1.1; } .ac-stat span { color: var(--bf-muted); font-size: .8rem; }

/* status chip */
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .8rem; border-radius: 99px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.chip.processed { background: #e1eefb; color: #2f7fd1; } .chip.packed { background: #ece6fb; color: #6b4bd1; } .chip.shipped { background: #fdf1d6; color: #b57400; }
.chip.delivered { background: #e3f4e8; color: #2e9e4f; } .chip.cancelled { background: #fbe3e3; color: #d64545; } .chip.other { background: #eee; color: #666; }

/* order cards */
.ord { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: 1rem 1.1rem; border: 1px solid var(--bf-line); border-radius: 18px; background: #fff; transition: all .25s; color: var(--bf-ink); }
.ord:hover { border-color: var(--bf-green-500); box-shadow: var(--bf-shadow); transform: translateY(-2px); color: var(--bf-ink); }
.ord + .ord { margin-top: .8rem; }
.ord .thumbs { display: flex; } .ord .thumbs img, .ord .thumbs span { width: 52px; height: 52px; border-radius: 14px; border: 2px solid #fff; background: var(--bf-orange-100); object-fit: contain; margin-left: -14px; box-shadow: 0 2px 8px rgba(0, 0, 0, .1); } .ord .thumbs > :first-child { margin-left: 0; }
.ord .thumbs span { display: grid; place-items: center; font-size: .8rem; font-weight: 600; color: var(--bf-green-700); }
.ord .meta strong { font-size: 1rem; } .ord .meta small { color: var(--bf-muted); display: block; }
.ord .right { text-align: right; } .ord .right .amt { font-weight: 700; font-size: 1.05rem; display: block; margin-bottom: .3rem; }
.ord .unread { display: inline-grid; place-items: center; background: var(--bf-orange-500); color: #fff; border-radius: 99px; font-size: .7rem; min-width: 20px; height: 20px; padding: 0 6px; margin-left: .4rem; }
.ac-tabs { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: 1rem; scrollbar-width: none; } .ac-tabs::-webkit-scrollbar { display: none; }
.ac-tabs button { border: 1px solid var(--bf-line); background: #fff; border-radius: 99px; padding: .45rem 1.1rem; font-weight: 500; font-size: .88rem; white-space: nowrap; color: var(--bf-ink); transition: all .2s; }
.ac-tabs button.on { background: var(--bf-green-700); color: #fff; border-color: var(--bf-green-700); }

/* tracker */
.track { display: flex; align-items: flex-start; position: relative; margin: .6rem 0 .2rem; }
.track .st { flex: 1; text-align: center; position: relative; }
.track .st::before { content: ''; position: absolute; top: 21px; left: -50%; width: 100%; height: 4px; background: var(--bf-line); z-index: 0; border-radius: 4px; }
.track .st:first-child::before { display: none; }
.track .st.done::before, .track .st.now::before { background: var(--bf-green-500); }
.track .dot { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto .5rem; background: #fff; border: 3px solid var(--bf-line); color: var(--bf-muted); position: relative; z-index: 1; font-size: 1rem; transition: all .3s; }
.track .st.done .dot { background: var(--bf-green-500); border-color: var(--bf-green-500); color: #fff; }
.track .st.now .dot { background: var(--bf-green-700); border-color: var(--bf-green-700); color: #fff; box-shadow: 0 0 0 6px rgba(63, 138, 75, .2); animation: pulseDot 2s infinite; }
@keyframes pulseDot { 50% { box-shadow: 0 0 0 10px rgba(63, 138, 75, .08); } }
.track .st b { display: block; font-size: .85rem; } .track .st small { color: var(--bf-muted); font-size: .72rem; }
.ac-banner { display: flex; gap: .8rem; align-items: center; border-radius: 16px; padding: .9rem 1.1rem; margin-bottom: 1rem; font-size: .92rem; }
.ac-banner.cancel { background: #fbe3e3; color: #a12d2d; } .ac-banner.info { background: var(--bf-green-100); color: var(--bf-green-900); }

/* order items */
.line { display: flex; gap: 1rem; align-items: center; padding: .8rem 0; border-bottom: 1px dashed var(--bf-line); } .line:last-child { border: 0; }
.line img { width: 64px; height: 64px; object-fit: contain; background: var(--bf-orange-100); border-radius: 14px; flex: none; }
.sum-row { display: flex; justify-content: space-between; padding: .35rem 0; color: var(--bf-muted); } .sum-row.tot { color: var(--bf-ink); font-weight: 700; font-size: 1.1rem; border-top: 2px solid var(--bf-line); margin-top: .4rem; padding-top: .7rem; }
.kvx { display: grid; grid-template-columns: 110px 1fr; gap: .45rem 1rem; font-size: .92rem; } .kvx dt { color: var(--bf-muted); font-weight: 500; } .kvx dd { margin: 0; word-break: break-word; }

/* chat */
.chat { border: 1px solid var(--bf-line); border-radius: 20px; overflow: hidden; background: #fff; }
.chat-h { background: linear-gradient(120deg, var(--bf-green-900), var(--bf-green-700)); color: #fff; padding: .85rem 1.1rem; display: flex; align-items: center; gap: .8rem; }
.chat-h .av { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; padding: 5px; } .chat-h .av img { width: 100%; }
.chat-h small { opacity: .8; display: block; }
.chat-b { height: 340px; overflow-y: auto; padding: 1rem; background: var(--bf-cream); display: flex; flex-direction: column; gap: .6rem; scroll-behavior: smooth; }
.msg { max-width: 82%; padding: .6rem .9rem; border-radius: 18px; font-size: .92rem; line-height: 1.5; word-break: break-word; animation: msgIn .3s ease; }
.msg small { display: block; opacity: .65; font-size: .7rem; margin-top: .25rem; }
.msg.shop { align-self: flex-start; background: #fff; border: 1px solid var(--bf-line); border-bottom-left-radius: 5px; }
.msg.me { align-self: flex-end; background: var(--bf-green-700); color: #fff; border-bottom-right-radius: 5px; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }
.chat-empty { margin: auto; text-align: center; color: var(--bf-muted); font-size: .9rem; }
.chat-f { padding: .8rem; border-top: 1px solid var(--bf-line); display: flex; gap: .6rem; align-items: flex-end; background: #fff; }
.chat-f textarea { resize: none; border-radius: 16px; }
.chat-f button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--bf-orange-500); color: #fff; flex: none; display: grid; place-items: center; transition: transform .2s; } .chat-f button:hover { transform: scale(1.08); } .chat-f button:disabled { opacity: .6; }

/* login */
.lg-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 560px; border-radius: 28px; overflow: hidden; background: #fff; border: 1px solid var(--bf-line); box-shadow: var(--bf-shadow); margin: 2.5rem 0 3.5rem; }
.lg-art { background: linear-gradient(150deg, var(--bf-green-900), var(--bf-green-700)); color: #fff; padding: 2.6rem; display: flex; flex-direction: column; justify-content: center; gap: 1.4rem; position: relative; overflow: hidden; }
.lg-art::after { content: ''; position: absolute; right: -80px; bottom: -80px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(240, 138, 28, .5), transparent 70%); }
.lg-art h1 { color: #fff; font-size: clamp(1.7rem, 3vw, 2.4rem); } .lg-art ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; position: relative; z-index: 2; }
.lg-art li { display: flex; gap: .9rem; align-items: center; } .lg-art li i { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; color: #ffd27a; flex: none; }
.lg-form { padding: 2.4rem; display: flex; flex-direction: column; justify-content: center; }
.lg-tabs { display: flex; background: var(--bf-cream); border-radius: 14px; padding: 4px; margin-bottom: 1.3rem; }
.lg-tabs button { flex: 1; border: 0; background: none; padding: .6rem .5rem; border-radius: 11px; font-weight: 600; font-size: .85rem; color: var(--bf-muted); transition: all .2s; }
.lg-tabs button.on { background: #fff; color: var(--bf-green-900); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.lg-err { display: none; background: #fbe3e3; color: #a12d2d; border-radius: 12px; padding: .7rem .9rem; font-size: .88rem; margin-bottom: 1rem; } .lg-err.on { display: block; animation: msgIn .3s; }

@media (max-width: 991px) {
  .ac-wrap { grid-template-columns: 1fr; gap: 1rem; padding-top: 1.2rem; }
  .ac-side { position: static; padding: .8rem; border-radius: 18px; }
  .ac-who { display: none; }
  .ac-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3rem; }
  .ac-nav a, .ac-nav button { flex-direction: column; gap: .3rem; padding: .55rem .2rem; font-size: .72rem; text-align: center; justify-content: center; }
  .ac-nav a:hover { transform: none; } .ac-nav .badge-n { position: absolute; margin: 0; transform: translate(14px, -10px); } .ac-nav a { position: relative; }
  .ac-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-wrap { grid-template-columns: 1fr; } .lg-art { padding: 1.6rem; gap: .9rem; } .lg-art ul { display: none; } .lg-form { padding: 1.5rem 1.2rem; }
}
@media (max-width: 575px) {
  .ac-hero { padding: 1.3rem; } .ac-card { padding: 1.1rem; border-radius: 18px; }
  .ord { grid-template-columns: 1fr auto; } .ord .thumbs { grid-column: 1 / -1; }
  .track .dot { width: 38px; height: 38px; font-size: .85rem; } .track .st::before { top: 17px; } .track .st b { font-size: .72rem; } .track .st small { display: none; }
  .kvx { grid-template-columns: 1fr; gap: .1rem; } .kvx dd { margin-bottom: .6rem; }
  .chat-b { height: 300px; } .msg { max-width: 90%; }
}
@media (prefers-reduced-motion: reduce) { .track .st.now .dot, .msg, .lg-err.on { animation: none; } }

/* order card: link area + chat button; chat slide-in panel */
.ord { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 1rem 1.1rem; border: 1px solid var(--bf-line); border-radius: 18px; background: #fff; transition: all .25s; }
.ord:hover { border-color: var(--bf-green-500); box-shadow: var(--bf-shadow); transform: translateY(-2px); }
.ord-link { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: center; color: var(--bf-ink); min-width: 0; } .ord-link:hover { color: var(--bf-ink); }
.ord .right { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; } .ord .right .amt { margin: 0; }
.btn-chat { display: inline-flex; align-items: center; gap: .4rem; border: 1.5px solid var(--bf-green-700); color: var(--bf-green-700); background: #fff; border-radius: 99px; padding: .3rem .9rem; font-size: .82rem; font-weight: 600; transition: all .2s; position: relative; }
.btn-chat:hover { background: var(--bf-green-700); color: #fff; } .btn-chat .unread { background: var(--bf-orange-500); color: #fff; border-radius: 99px; min-width: 18px; height: 18px; font-size: .68rem; display: grid; place-items: center; padding: 0 5px; margin: 0; }
.chat-panel { width: min(440px, 100vw) !important; border: 0; background: var(--bf-cream); }
.chat-panel .chat-h { flex: none; } .chat-panel .chat-b { height: auto; flex: 1; min-height: 0; } .chat-panel { display: flex; flex-direction: column; }
.chat-open, .chat-x { color: #fff; background: rgba(255, 255, 255, .15); border: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; flex: none; } .chat-open:hover, .chat-x:hover { background: rgba(255, 255, 255, .3); color: #fff; }
@media (max-width: 575px) { .ord { grid-template-columns: 1fr; } .ord .right { flex-direction: row; align-items: center; flex-wrap: wrap; justify-content: space-between; } .ord .right .btn-chat { margin-left: auto; } .ord-link { grid-template-columns: auto minmax(0, 1fr); } }

/* mobile: let grid children shrink (no sideways overflow) */
@media (max-width: 991px) { .ac-wrap { grid-template-columns: minmax(0, 1fr); } .ac-stack, .ac-card, .ord, .ac-side { min-width: 0; max-width: 100%; } .ac-nav a, .ac-nav button { min-width: 0; } }

/* Cancellation dialog */
.cancel-modal .modal-content { border: 0; border-radius: 24px; overflow: hidden; background: #fff; }
.cm-head { display: flex; gap: 1rem; align-items: center; padding: 1.3rem 1.4rem; background: linear-gradient(120deg, #fdecea, #fff4e8); border-bottom: 1px solid var(--bf-line); position: relative; }
.cm-ic { width: 52px; height: 52px; border-radius: 16px; background: #b0392e; color: #fff; display: grid; place-items: center; font-size: 1.3rem; flex: none; box-shadow: 0 8px 18px rgba(176, 57, 46, .3); }
.cm-head h2 { font-size: 1.25rem; margin: 0 0 .1rem; font-family: var(--bf-font-body); font-weight: 700; } .cm-head p { margin: 0; color: var(--bf-muted); font-size: .85rem; }
.cm-x { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .06); flex: none; } .cm-x:hover { background: rgba(0, 0, 0, .12); }
.cm-body { padding: 1.2rem 1.4rem; overflow-y: auto; }
.cm-thumbs { display: flex; align-items: center; gap: .9rem; background: var(--bf-cream); border-radius: 16px; padding: .7rem .9rem; margin-bottom: 1.1rem; font-size: .88rem; } .cm-thumbs .thumbs { display: flex; flex: none; } .cm-thumbs .thumbs img, .cm-thumbs .thumbs span { width: 40px; height: 40px; border-radius: 10px; margin-left: -10px; border: 2px solid #fff; background: var(--bf-orange-100); object-fit: contain; display: grid; place-items: center; font-size: .72rem; } .cm-thumbs .thumbs > :first-child { margin-left: 0; }
.cm-label { font-weight: 600; font-size: .92rem; margin-bottom: .5rem; display: block; }
.cm-reasons { display: grid; gap: .5rem; }
.cm-reason { display: flex; align-items: center; gap: .8rem; border: 1.5px solid var(--bf-line); border-radius: 14px; padding: .7rem .9rem; cursor: pointer; transition: all .2s; font-size: .92rem; margin: 0; }
.cm-reason:hover { border-color: var(--bf-green-500); background: var(--bf-cream); } .cm-reason.on { border-color: #b0392e; background: #fdf3f1; }
.cm-reason input { position: absolute; opacity: 0; pointer-events: none; } .cm-reason .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--bf-line); flex: none; display: grid; place-items: center; transition: all .2s; }
.cm-reason.on .dot { border-color: #b0392e; } .cm-reason.on .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #b0392e; }
.cm-reason:has(input:focus-visible) { outline: 2px solid var(--bf-green-500); outline-offset: 2px; }
.cm-info { display: flex; gap: .8rem; background: var(--bf-green-100); color: var(--bf-green-900); border-radius: 16px; padding: .9rem 1rem; margin-top: 1.1rem; font-size: .85rem; } .cm-info i { margin-top: .2rem; } .cm-info ul { margin: .3rem 0 0; padding-left: 1.1rem; } .cm-info li { margin-bottom: .2rem; }
.cm-err { margin-top: .8rem; background: #fbe3e3; color: #a12d2d; border-radius: 12px; padding: .6rem .9rem; font-size: .88rem; }
.cm-foot { display: flex; gap: .7rem; justify-content: flex-end; flex-wrap: wrap; padding: 1rem 1.4rem; border-top: 1px solid var(--bf-line); background: #fff; }
.cm-foot .btn-bf:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
@media (max-width: 575px) { .cm-head { padding: 1rem; } .cm-body { padding: 1rem; } .cm-foot { padding: .9rem 1rem; } .cm-foot .btn-bf, .cm-foot .btn-bf-outline { flex: 1; justify-content: center; } }
