/* ===== রং ও সাধারণ সেটিংস ===== */
:root {
  --blue: #0b4fd6;
  --blue-dark: #082f8a;
  --blue-soft: #eaf1ff;
  --ink: #12203a;
  --muted: #62708a;
  --line: #d9e2f3;
  --white: #fff;
  --ok: #12945a;
  --err: #c62828;
}
* { box-sizing: border-box; margin: 0; }
body { font-family: "Hind Siliguri", "Noto Sans Bengali", Arial, sans-serif; color: var(--ink); background: #f6f9ff; line-height: 1.55; }
.wrap { width: min(1100px, 100% - 24px); margin-inline: auto; }
.muted { color: var(--muted); font-size: .9rem; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #7aa5ff; outline-offset: 2px; }

/* ===== হেডার ===== */
.header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 0; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 1.25rem; color: var(--blue-dark); text-decoration: none; }
.logo b { color: var(--blue); }
.search { flex: 1 1 200px; order: 3; width: 100%; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--blue-soft); }
.cart-btn { margin-left: auto; background: var(--blue); color: #fff; border: 0; border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 600; }
.cart-btn span { background: #fff; color: var(--blue); border-radius: 99px; padding: 0 8px; margin-left: 4px; }

/* ===== ব্যানার ===== */
.hero { background: linear-gradient(120deg, var(--blue-dark), var(--blue)); color: #fff; padding: 36px 0 40px; }
.hero h1 { font-size: clamp(1.5rem, 5.5vw, 2.6rem); line-height: 1.3; margin-bottom: 10px; }
.hero p { opacity: .9; margin-bottom: 18px; }

/* ===== বাটন ===== */
.btn { display: block; width: 100%; text-align: center; text-decoration: none; background: var(--blue); color: #fff; border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 600; cursor: pointer; margin-top: 10px; }
.btn.light { display: inline-block; width: auto; background: #fff; color: var(--blue-dark); }
.btn.ghost { background: var(--blue-soft); color: var(--blue-dark); }
.btn:hover { background: var(--blue-dark); }
.btn.light:hover { background: var(--blue-soft); }

/* ===== ক্যাটাগরি ও ফিল্টার ===== */
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 8px; scrollbar-width: none; }
.cats button { white-space: nowrap; border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 8px 16px; cursor: pointer; }
.cats button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0 14px; }
.filters select { padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }
.filters .muted { margin-left: auto; }

/* ===== পণ্য কার্ড ===== */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding-bottom: 36px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.card .pic { background: var(--blue-soft); font-size: 3.4rem; text-align: center; padding: 22px 0; }
.card .info { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.card small { color: var(--muted); }
.card h3 { font-size: 1rem; font-weight: 600; margin: 2px 0 6px; }
.price { color: var(--blue); font-weight: 700; font-size: 1.1rem; }
.price s { color: var(--muted); font-weight: 400; font-size: .85rem; margin-left: 4px; }
.card .btn { margin-top: auto; padding: 9px; }
.empty { grid-column: 1 / -1; text-align: center; padding: 40px 0; color: var(--muted); }

/* ===== কার্ট প্যানেল ===== */
.panel { position: fixed; top: 0; right: 0; height: 100%; width: min(400px, 100%); background: #fff; z-index: 40; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s; }
.panel.open { transform: none; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.x { background: none; border: 0; font-size: 1.3rem; cursor: pointer; }
.panel-body { flex: 1; overflow-y: auto; padding: 12px 16px; }
.panel-foot { padding: 14px 16px; border-top: 1px solid var(--line); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; }
.item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item .em { font-size: 2rem; }
.item .mid { flex: 1; font-size: .95rem; }
.qty { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.qty button { width: 28px; height: 28px; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; }
.rm { color: var(--err); background: none; border: 0; cursor: pointer; }

/* ===== মডাল / ফর্ম ===== */
.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 12px; }
.modal.open { display: flex; }
.box { background: #fff; width: min(480px, 100%); border-radius: 16px; padding: 4px 16px 18px; margin: auto; }
.box label { display: block; margin-top: 12px; font-weight: 500; font-size: .95rem; }
.box input:not([type=radio]), .box select, .box textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
fieldset { border: 1.5px solid var(--line); border-radius: 12px; padding: 4px 12px 12px; margin: 16px 0 8px; }
legend { padding: 0 6px; font-weight: 600; }
.box label.opt { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.payinfo { background: var(--blue-soft); border-radius: 10px; padding: 4px 12px 12px; margin-top: 6px; font-size: .92rem; }
.error { color: var(--err); min-height: 1.3em; font-size: .9rem; }
.center { text-align: center; padding-top: 22px; }
.tick { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 2rem; display: grid; place-items: center; margin: 0 auto 10px; }

/* ===== ওভারলে, টোস্ট, ফুটার ===== */
.overlay { position: fixed; inset: 0; background: rgba(8, 20, 50, .55); z-index: 30; display: none; }
.overlay.open { display: block; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translate(-50%, 80px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 60; transition: transform .25s; }
.toast.show { transform: translate(-50%, 0); }
.footer { background: var(--blue-dark); color: #dbe6ff; text-align: center; padding: 18px 12px; font-size: .9rem; }

/* ===== বড় স্ক্রিন ===== */
@media (min-width: 700px) {
  .search { order: 0; width: auto; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .btn { width: auto; }
  .panel-foot .btn, .box .btn { width: 100%; }
}
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
