/* Oli Mart storefront — built on Bootstrap 5.3 */
:root {
  --oli-red: #b0101c;
  --oli-red-dark: #8a0a14;
  --oli-red-soft: #fdecee;
  --oli-ink: #111827;
  --oli-muted: #6b7280;
  --oli-line: #e9ebef;
  --oli-bg: #f6f7f9;
  --oli-card: #ffffff;
  --oli-green: #12805c;
  --oli-amber: #f59e0b;
  --oli-radius: 16px;
  --oli-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 6px 20px rgba(17, 24, 39, .06);
  --oli-shadow-lg: 0 12px 40px rgba(17, 24, 39, .14);
  --bs-primary: var(--oli-red);
  --bs-primary-rgb: 176, 16, 28;
  --bs-link-color: var(--oli-red);
  --bs-link-hover-color: var(--oli-red-dark);
  --bs-link-color-rgb: 176, 16, 28;
  --bs-link-hover-color-rgb: 138, 10, 20;
  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-border-radius: 12px;
}

body { background: var(--oli-bg); color: var(--oli-ink); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
img { max-width: 100%; }
.text-muted { color: var(--oli-muted) !important; }
.fw-800 { font-weight: 800; }
.small-caps { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--oli-muted); }

.btn { font-weight: 600; border-radius: 12px; }
.btn-primary { --bs-btn-bg: var(--oli-red); --bs-btn-border-color: var(--oli-red); --bs-btn-hover-bg: var(--oli-red-dark);
  --bs-btn-hover-border-color: var(--oli-red-dark); --bs-btn-active-bg: var(--oli-red-dark); --bs-btn-disabled-bg: #d27b82;
  --bs-btn-disabled-border-color: #d27b82; }
.btn-outline-primary { --bs-btn-color: var(--oli-red); --bs-btn-border-color: var(--oli-red); --bs-btn-hover-bg: var(--oli-red);
  --bs-btn-hover-border-color: var(--oli-red); --bs-btn-active-bg: var(--oli-red-dark); }
.btn-soft { background: var(--oli-red-soft); color: var(--oli-red); border: 0; }
.btn-soft:hover { background: #f9d7db; color: var(--oli-red-dark); }
.form-control, .form-select { border-radius: 12px; border-color: #dfe2e8; padding: .65rem .9rem; }
.form-control:focus, .form-select:focus { border-color: var(--oli-red); box-shadow: 0 0 0 .2rem rgba(176, 16, 28, .12); }
.form-label { font-weight: 600; font-size: .9rem; }
.card-oli { background: var(--oli-card); border: 1px solid var(--oli-line); border-radius: var(--oli-radius); box-shadow: var(--oli-shadow); }
.badge-soft { background: var(--oli-red-soft); color: var(--oli-red); font-weight: 700; }

/* ── Top bar & header ───────────────────────────────────── */
.topbar { background: linear-gradient(90deg, var(--oli-red-dark), var(--oli-red)); color: #fff; font-size: .82rem; }
.topbar a { color: #fff; opacity: .92; }
.topbar a:hover { opacity: 1; }
.topbar .marquee { overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.topbar .marquee span { display: inline-block; padding-left: 100%; animation: oli-marquee 26s linear -9s infinite; }
@keyframes oli-marquee { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .topbar .marquee span { animation: none; padding-left: 0; } }

.site-header { background: rgba(255, 255, 255, .94); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--oli-line); z-index: 1030; transition: box-shadow .2s; }
.site-header.scrolled { box-shadow: 0 6px 24px rgba(17, 24, 39, .08); }
.site-header .logo { height: 46px; width: auto; border-radius: 10px; }
.header-icon { position: relative; display: inline-flex; flex-direction: column; align-items: center; color: var(--oli-ink); font-size: .72rem; font-weight: 600; gap: 2px; padding: 4px 8px; border-radius: 12px; }
.header-icon i { font-size: 1.35rem; line-height: 1; }
.header-icon:hover { color: var(--oli-red); background: var(--oli-red-soft); }
.count-badge { position: absolute; top: -2px; right: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: var(--oli-red); color: #fff; font-size: .68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.count-badge.bump { animation: oli-bump .45s ease; }
@keyframes oli-bump { 40% { transform: scale(1.35); } }

.search-box { position: relative; }
.search-box .form-control { border-radius: 999px; padding-left: 2.8rem; height: 46px; background: #f3f4f6; border-color: transparent; }
.search-box .form-control:focus { background: #fff; }
.search-box > i { position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%); color: var(--oli-muted); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border-radius: 16px; box-shadow: var(--oli-shadow-lg);
  border: 1px solid var(--oli-line); overflow: hidden; z-index: 1060; display: none; }
.search-results.show { display: block; }
.search-results a { display: flex; align-items: center; gap: .75rem; padding: .55rem .9rem; color: var(--oli-ink); }
.search-results a:hover, .search-results a.active { background: var(--oli-bg); }
.search-results img { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; background: var(--oli-bg); }
.search-results .all { justify-content: center; font-weight: 700; color: var(--oli-red); border-top: 1px solid var(--oli-line); }

.cat-nav { background: #fff; border-bottom: 1px solid var(--oli-line); }
.cat-nav .scroller { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding: .55rem 0; }
.cat-nav .scroller::-webkit-scrollbar { display: none; }
.cat-nav a { white-space: nowrap; font-size: .87rem; font-weight: 600; color: #374151; padding: .35rem .85rem; border-radius: 999px; }
.cat-nav a:hover, .cat-nav a.active { background: var(--oli-red-soft); color: var(--oli-red); }

/* ── Hero ───────────────────────────────────────────────── */
.hero { border-radius: 22px; overflow: hidden; box-shadow: var(--oli-shadow-lg); }
.hero .carousel-item img { width: 100%; height: 400px; object-fit: cover; }
.hero .shade { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(17,24,39,.78) 0%, rgba(17,24,39,.35) 45%, rgba(17,24,39,0) 75%); }
.hero .caption { position: absolute; left: 6%; bottom: 14%; max-width: 480px; color: #fff; }
.hero .caption h2 { font-weight: 800; font-size: clamp(1.5rem, 3.5vw, 2.6rem); line-height: 1.1; }
.hero-fallback { background: radial-gradient(circle at 85% 20%, #ffd2d6 0, transparent 40%), linear-gradient(120deg, var(--oli-red-dark), var(--oli-red)); color: #fff; padding: 3.5rem 2rem; }
@media (max-width: 767px) { .hero .carousel-item img { height: 210px; } .hero { border-radius: 16px; } }

.perks { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.perk { display: flex; gap: .75rem; align-items: center; background: #fff; border: 1px solid var(--oli-line); border-radius: 14px; padding: .8rem 1rem; }
.perk i { font-size: 1.4rem; color: var(--oli-red); background: var(--oli-red-soft); width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.perk b { display: block; font-size: .9rem; }
.perk span { font-size: .78rem; color: var(--oli-muted); }
@media (max-width: 991px) { .perks { grid-template-columns: repeat(2, 1fr); } }

/* ── Sections ───────────────────────────────────────────── */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-head h2 { font-size: clamp(1.15rem, 2.2vw, 1.5rem); font-weight: 800; margin: 0; }
.section-head a { font-weight: 700; font-size: .88rem; white-space: nowrap; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .75rem; }
.cat-tile { background: #fff; border: 1px solid var(--oli-line); border-radius: 16px; padding: .8rem .6rem; text-align: center; color: var(--oli-ink); transition: transform .15s, box-shadow .15s; }
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--oli-shadow); color: var(--oli-red); }
.cat-tile .pic { width: 72px; height: 72px; margin: 0 auto .5rem; border-radius: 50%; overflow: hidden; background: var(--oli-bg); display: grid; place-items: center; }
.cat-tile .pic img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile b { display: block; font-size: .84rem; line-height: 1.2; }
.cat-tile small { color: var(--oli-muted); font-size: .72rem; }

/* Horizontal product rail with scroll-snap — replaces Owl Carousel and jQuery. */
.rail-wrap { position: relative; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 1rem) / 4); gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px 2px 12px; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (max-width: 1199px) { .rail { grid-auto-columns: calc((100% - 2 * 1rem) / 3); } }
@media (max-width: 767px) { .rail { grid-auto-columns: 46%; gap: .75rem; } }
.rail-btn { position: absolute; top: 38%; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--oli-line); background: #fff; box-shadow: var(--oli-shadow); z-index: 2; display: grid; place-items: center; }
.rail-btn.prev { left: -14px; } .rail-btn.next { right: -14px; }
@media (max-width: 767px) { .rail-btn { display: none; } }

/* ── Product card ───────────────────────────────────────── */
.p-card { background: #fff; border: 1px solid var(--oli-line); border-radius: 18px; overflow: hidden; height: 100%; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.p-card:hover { transform: translateY(-3px); box-shadow: var(--oli-shadow-lg); }
.p-card .media { position: relative; aspect-ratio: 1 / 1; background: #fafafa; display: block; overflow: hidden; }
.p-card .media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.p-card .tag { position: absolute; top: 10px; left: 10px; background: var(--oli-red); color: #fff; font-size: .7rem; font-weight: 800; padding: .2rem .5rem; border-radius: 8px; }
.p-card .tag.oos { background: #374151; }
.p-card .tag.low { background: var(--oli-amber); color: #111; left: auto; right: 10px; }
.p-card .body { padding: .75rem .9rem .9rem; display: flex; flex-direction: column; flex: 1; }
.p-card .cat { font-size: .7rem; color: var(--oli-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.p-card .name { font-size: .92rem; font-weight: 600; color: var(--oli-ink); line-height: 1.3; margin: .15rem 0 .2rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.p-card .unit { font-size: .75rem; color: var(--oli-muted); }
.p-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .5rem; }
.price { font-weight: 800; color: var(--oli-ink); }
.price .was { font-weight: 500; color: #9ca3af; text-decoration: line-through; font-size: .8em; margin-left: .3rem; }
.btn-add { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; padding: 0; font-size: 1.15rem; flex-shrink: 0; }
.btn-add.loading { pointer-events: none; opacity: .6; }

/* ── Listing ────────────────────────────────────────────── */
.filter-card { position: sticky; top: 140px; }
.page-title { font-weight: 800; font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
.pagination { --bs-pagination-color: var(--oli-ink); --bs-pagination-active-bg: var(--oli-red); --bs-pagination-active-border-color: var(--oli-red); --bs-pagination-border-radius: 10px; gap: .3rem; }
.pagination .page-link { border-radius: 10px !important; }

/* ── Product detail ─────────────────────────────────────── */
.pd-media { background: #fff; border: 1px solid var(--oli-line); border-radius: 22px; padding: 1.5rem; aspect-ratio: 1 / 1; display: grid; place-items: center; }
.pd-media img { max-height: 100%; object-fit: contain; }
.qty { display: inline-flex; align-items: center; border: 1px solid #dfe2e8; border-radius: 14px; overflow: hidden; background: #fff; }
.qty button { width: 44px; height: 46px; border: 0; background: transparent; font-size: 1.2rem; }
.qty button:hover { background: var(--oli-bg); }
.qty input { width: 56px; text-align: center; border: 0; font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty.sm button { width: 34px; height: 36px; font-size: 1rem; } .qty.sm input { width: 40px; }

/* ── Cart & checkout ────────────────────────────────────── */
.cart-line { display: grid; grid-template-columns: 76px 1fr auto; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--oli-line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line img { width: 76px; height: 76px; object-fit: contain; background: #fafafa; border-radius: 12px; }
.summary { position: sticky; top: 140px; }
.summary .row-line { display: flex; justify-content: space-between; padding: .35rem 0; }
.summary .total { font-size: 1.25rem; font-weight: 800; border-top: 1px dashed #d1d5db; margin-top: .5rem; padding-top: .75rem; }
.pay-option { display: block; border: 2px solid var(--oli-line); border-radius: 14px; padding: .9rem 1rem; cursor: pointer; transition: border-color .15s, background .15s; }
.pay-option:hover { border-color: #d1d5db; }
.pay-option input { margin-right: .6rem; accent-color: var(--oli-red); }
.pay-option.selected { border-color: var(--oli-red); background: var(--oli-red-soft); }
.pay-option .desc { font-size: .8rem; color: var(--oli-muted); margin-left: 1.6rem; }
.step-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--oli-red); color: #fff; font-weight: 800; font-size: .85rem; display: inline-grid; place-items: center; margin-right: .5rem; }

/* ── Tracking ───────────────────────────────────────────── */
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.stepper .s { text-align: center; position: relative; font-size: .78rem; font-weight: 600; color: var(--oli-muted); }
.stepper .s::before { content: ''; position: absolute; top: 18px; left: -50%; width: 100%; height: 4px; background: var(--oli-line); z-index: 0; }
.stepper .s:first-child::before { display: none; }
.stepper .s.done::before, .stepper .s.current::before { background: var(--oli-green); }
.stepper .dot { position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%; margin: 0 auto .45rem; display: grid; place-items: center; background: #fff; border: 3px solid var(--oli-line); font-size: 1.05rem; color: #9ca3af; }
.stepper .done .dot { background: var(--oli-green); border-color: var(--oli-green); color: #fff; }
.stepper .current .dot { border-color: var(--oli-green); color: var(--oli-green); box-shadow: 0 0 0 6px rgba(18, 128, 92, .14); }
.stepper .done, .stepper .current { color: var(--oli-ink); }
@media (max-width: 575px) { .stepper .s { font-size: .64rem; } .stepper .dot { width: 32px; height: 32px; font-size: .9rem; } .stepper .s::before { top: 14px; } }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; }
.timeline li::before { content: ''; position: absolute; left: 5px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--oli-green); }
.timeline li::after { content: ''; position: absolute; left: 9px; top: 18px; bottom: -2px; width: 2px; background: var(--oli-line); }
.timeline li:last-child::after { display: none; }
.timeline time { display: block; font-size: .74rem; color: var(--oli-muted); }
.otp-box { font-size: 2rem; font-weight: 800; letter-spacing: .5em; text-indent: .5em; color: var(--oli-red); }
.track-map { height: 300px; border-radius: 16px; overflow: hidden; border: 1px solid var(--oli-line); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--oli-green); display: inline-block; box-shadow: 0 0 0 0 rgba(18,128,92,.6); animation: oli-pulse 1.6s infinite; }
@keyframes oli-pulse { 70% { box-shadow: 0 0 0 9px rgba(18,128,92,0); } 100% { box-shadow: 0 0 0 0 rgba(18,128,92,0); } }

/* Fonepay QR */
.qr-frame { width: 260px; height: 260px; margin: 0 auto; border-radius: 18px; border: 1px solid var(--oli-line); background: #fff; display: grid; place-items: center; overflow: hidden; }
.qr-frame img { width: 100%; height: 100%; image-rendering: pixelated; }
.qr-ring { width: 64px; height: 64px; border: 5px solid var(--oli-red-soft); border-top-color: var(--oli-red); border-radius: 50%; animation: oli-spin .9s linear infinite; }
@keyframes oli-spin { to { transform: rotate(360deg); } }

/* ── Footer & mobile nav ────────────────────────────────── */
.site-footer { background: #0f172a; color: #cbd5e1; }
.site-footer h6 { color: #fff; font-weight: 700; letter-spacing: .04em; }
.site-footer a { color: #94a3b8; }
.site-footer a:hover { color: #fff; }
.site-footer .fine { border-top: 1px solid rgba(255,255,255,.08); color: #64748b; font-size: .82rem; }
.social a { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.08); display: inline-grid; place-items: center; color: #fff; }

.mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--oli-line); display: none; z-index: 1035; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -6px 20px rgba(17,24,39,.06); }
.mobile-nav a { flex: 1; text-align: center; padding: .45rem 0 .4rem; color: #4b5563; font-size: .68rem; font-weight: 600; position: relative; }
.mobile-nav a i { display: block; font-size: 1.3rem; }
.mobile-nav a.active { color: var(--oli-red); }
.mobile-nav .count-badge { top: 2px; right: calc(50% - 22px); }
@media (max-width: 991px) { .mobile-nav { display: flex; } body { padding-bottom: 66px; } .floating-wa { bottom: 82px !important; } }
.floating-wa { position: fixed; right: 18px; bottom: 22px; width: 54px; height: 54px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; font-size: 1.6rem; box-shadow: var(--oli-shadow-lg); z-index: 1030; }
.floating-wa:hover { color: #fff; transform: scale(1.06); }

.toast-stack { position: fixed; top: 84px; right: 16px; z-index: 1090; display: flex; flex-direction: column; gap: .5rem; max-width: calc(100vw - 32px); }
.oli-toast { background: var(--oli-ink); color: #fff; border-radius: 14px; padding: .75rem 1rem; box-shadow: var(--oli-shadow-lg); display: flex; gap: .6rem; align-items: center; font-size: .9rem; animation: oli-in .25s ease; }
.oli-toast.error { background: #991b1b; }
.oli-toast a { color: #fff; font-weight: 700; text-decoration: underline; margin-left: auto; white-space: nowrap; }
@keyframes oli-in { from { opacity: 0; transform: translateY(-8px); } }
.empty-state { text-align: center; padding: 3.5rem 1rem; }
.empty-state i { font-size: 3.4rem; color: #d1d5db; }

/* Print (invoice) */
@media print { .no-print { display: none !important; } body { background: #fff; padding: 0; } }
