:root {
  --red: #e31b4b;
  --red-dark: #c9153e;
  --red-soft: #fff0f4;
  --pink: #ff5a7d;
  --ink: #232631;
  --muted: #747b8c;
  --line: #edf0f5;
  --bg: #f6f7fb;
  --card: #ffffff;
  --green: #13a567;
  --orange: #ff9d2e;
  --shadow: 0 16px 40px rgba(24, 32, 52, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }

.market-header {
  position: sticky;
  top: 0;
  z-index: 30;
  color: #fff;
  background: linear-gradient(135deg, var(--red), #ff3c68 58%, #ff6a47);
  box-shadow: 0 10px 26px rgba(227, 27, 75, .22);
}
.top-strip {
  display: flex;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 22px 0;
  color: rgba(255,255,255,.78);
  font-size: 12px;
}
.bot-username { font-weight: 700; }
.header-main {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 22px 18px;
}
.store-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
  text-decoration: none;
}
.brand-bag {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--red);
  background: #fff;
  border-radius: 13px;
  box-shadow: 0 10px 24px rgba(136, 0, 37, .22);
  font-size: 22px;
}
.store-brand strong, .store-brand small { display: block; }
.store-brand strong { max-width: 180px; overflow: hidden; font-size: 19px; font-weight: 900; letter-spacing: -.5px; text-overflow: ellipsis; white-space: nowrap; }
.store-brand small { margin-top: 2px; color: rgba(255,255,255,.75); font-size: 9px; font-weight: 900; letter-spacing: 1.2px; }
.search-bar {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  height: 46px;
  padding: 0 5px 0 14px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 14px 32px rgba(117, 0, 36, .18);
}
.search-bar svg { width: 19px; height: 19px; color: #9aa1ae; }
.search-bar input {
  min-width: 0;
  height: 100%;
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 14px;
}
.search-bar input::placeholder { color: #a3a8b4; }
.search-bar button, .header-action {
  height: 36px;
  border: 0;
  border-radius: 999px;
  font-weight: 850;
}
.search-bar button { padding: 0 18px; color: #fff; background: var(--red); }
.search-bar button:hover { background: var(--red-dark); }
.header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  color: #fff;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.24);
}
.header-action:hover { background: rgba(255,255,255,.26); }

main { max-width: 1180px; margin: 0 auto; padding: 26px 22px 90px; }
.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  min-height: 260px;
  overflow: hidden;
  padding: 34px;
  background:
    radial-gradient(circle at 78% 20%, rgba(255,255,255,.38), transparent 26%),
    linear-gradient(135deg, #e31b4b, #ff5378 52%, #ff9a3d);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -80px -160px auto;
  width: 330px;
  height: 330px;
  background: rgba(255,255,255,.18);
  border-radius: 50%;
}
.hero-copy { position: relative; z-index: 1; color: #fff; }
.hero-kicker {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 7px 12px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}
.hero-copy h1 { max-width: 640px; margin: 0; font-size: clamp(31px, 4vw, 48px); line-height: 1.05; letter-spacing: -1.6px; }
.hero-copy p:not(.hero-kicker) { max-width: 560px; margin: 14px 0 0; color: rgba(255,255,255,.84); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-actions button {
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 900;
}
#heroShopButton { color: var(--red); background: #fff; border: 0; }
#heroCategoryButton { color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.45); }
.hero-visual { position: relative; z-index: 1; min-height: 210px; }
.promo-card { position: absolute; color: var(--ink); background: #fff; border-radius: 22px; box-shadow: 0 18px 34px rgba(95, 0, 28, .2); }
.promo-main { right: 24px; top: 18px; width: 235px; padding: 24px; }
.promo-main span { display: inline-flex; padding: 5px 10px; color: var(--red); background: var(--red-soft); border-radius: 999px; font-size: 12px; font-weight: 900; }
.promo-main strong { display: block; margin-top: 14px; font-size: 24px; line-height: 1.05; }
.promo-main small { display: block; margin-top: 8px; color: var(--muted); }
.promo-mini { display: grid; width: 74px; height: 74px; place-items: center; font-size: 30px; }
.promo-mini.one { left: 22px; bottom: 26px; transform: rotate(-8deg); }
.promo-mini.two { right: 4px; bottom: 18px; transform: rotate(10deg); }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
.stats-row article { padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 22px rgba(24,32,52,.04); }
.stats-row strong { display: block; color: var(--red); font-size: 25px; font-weight: 950; }
.stats-row span { color: var(--muted); font-size: 13px; }
.section-card, .filter-panel, .products-section { background: var(--card); border: 1px solid var(--line); box-shadow: 0 10px 26px rgba(24,32,52,.04); }
.section-card { margin-bottom: 18px; padding: 20px; border-radius: var(--radius); }
.section-head, .products-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.section-kicker { margin: 0 0 5px; color: var(--red); font-size: 11px; font-weight: 950; letter-spacing: .6px; text-transform: uppercase; }
h2 { margin: 0; color: var(--ink); font-size: 22px; letter-spacing: -.5px; }
.section-head button { height: 34px; padding: 0 13px; color: var(--red); background: var(--red-soft); border: 1px solid #ffd5df; border-radius: 999px; font-weight: 850; }
.category-chips { display: flex; gap: 10px; margin-top: 16px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.category-chips::-webkit-scrollbar { display: none; }
.category-chip {
  flex: 0 0 auto;
  min-width: 116px;
  padding: 13px 14px;
  text-align: left;
  color: #3a3e4a;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: .16s;
}
.category-chip:hover, .category-chip.active { color: var(--red); border-color: #ffb6c8; background: var(--red-soft); }
.category-chip strong, .category-chip span { display: block; }
.category-chip strong { font-size: 13px; }
.category-chip span { margin-top: 3px; color: var(--muted); font-size: 11px; }

.content-grid { display: grid; grid-template-columns: 245px minmax(0, 1fr); gap: 18px; align-items: start; }
.filter-panel { position: sticky; top: 92px; padding: 18px; border-radius: var(--radius); }
.filter-title { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.filter-title span { display: grid; width: 29px; height: 29px; place-items: center; color: var(--red); background: var(--red-soft); border-radius: 9px; }
.filter-panel label { display: block; margin: 14px 0 7px; color: #555b6b; font-size: 13px; font-weight: 850; }
.filter-panel select { width: 100%; height: 40px; padding: 0 10px; color: var(--ink); background: #fff; border: 1px solid #dde2eb; border-radius: 12px; outline: 0; }
.check-line { display: flex !important; align-items: center; gap: 8px; font-weight: 750 !important; }
.check-line input { accent-color: var(--red); }
.products-section { padding: 20px; border-radius: var(--radius); }
.result-count { display: inline-flex; padding: 7px 11px; color: var(--red); background: var(--red-soft); border-radius: 999px; font-size: 12px; font-weight: 900; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.product-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; transition: .18s; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(24,32,52,.1); border-color: #ffd1dc; }
.product-media { position: relative; aspect-ratio: 1 / .78; overflow: hidden; background: linear-gradient(135deg, #fff0f4, #fff7e8); }
.product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-fallback { display: grid; width: 100%; height: 100%; place-items: center; color: var(--red); font-size: 44px; font-weight: 950; }
.product-badge { position: absolute; top: 10px; left: 10px; padding: 5px 8px; color: #fff; background: var(--red); border-radius: 999px; font-size: 10px; font-weight: 900; }
.product-body { padding: 13px; }
.product-name { display: -webkit-box; min-height: 40px; overflow: hidden; margin: 0; color: #2c303a; font-size: 14px; line-height: 1.35; font-weight: 850; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-price { display: block; margin-top: 8px; color: var(--red); font-size: 16px; font-weight: 950; }
.product-desc { display: -webkit-box; min-height: 34px; overflow: hidden; margin: 7px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.product-actions button, .product-actions a { display: inline-flex; align-items: center; justify-content: center; height: 36px; border-radius: 11px; font-size: 12px; font-weight: 900; text-decoration: none; }
.detail-button { color: var(--red); background: var(--red-soft); border: 1px solid #ffd4df; }
.card-order { padding: 0 11px; color: #fff; background: var(--green); border: 0; }
.card-order.disabled { cursor: not-allowed; opacity: .45; }

.skeleton-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.skeleton-grid span { height: 245px; border-radius: 18px; background: linear-gradient(90deg, #eef1f6, #fafbfe, #eef1f6); background-size: 220% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }
.empty-state { display: grid; place-items: center; min-height: 260px; padding: 30px; text-align: center; }
.empty-state span { font-size: 42px; }
.empty-state strong { margin-top: 8px; }
.empty-state p { color: var(--muted); }

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16, 20, 31, .55); backdrop-filter: blur(3px); }
.detail-sheet { position: relative; z-index: 1; display: grid; grid-template-columns: 43% minmax(0, 1fr); width: min(920px, 100%); max-height: min(720px, calc(100vh - 36px)); overflow: hidden; background: #fff; border-radius: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 3; display: grid; width: 34px; height: 34px; place-items: center; color: #4e5564; background: rgba(255,255,255,.86); border: 0; border-radius: 50%; font-size: 24px; }
.detail-image-wrap { min-height: 420px; background: linear-gradient(135deg, #fff0f4, #fff7e8); }
.detail-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-body { padding: 34px; overflow-y: auto; }
.detail-badge { display: inline-flex; padding: 6px 10px; color: var(--red); background: var(--red-soft); border-radius: 999px; font-size: 11px; font-weight: 900; }
.detail-body h2 { margin-top: 12px; font-size: clamp(24px, 3vw, 34px); }
.detail-price { display: block; margin-top: 12px; color: var(--red); font-size: 26px; }
.detail-description { margin: 18px 0 0; color: #555d6d; line-height: 1.7; white-space: pre-wrap; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.order-button, .secondary-detail { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 950; text-decoration: none; }
.order-button { color: #fff; background: var(--green); }
.secondary-detail { color: var(--red); background: var(--red-soft); border: 1px solid #ffd4df; }

.mobile-nav { display: none; }

@media (max-width: 960px) {
  .header-main { grid-template-columns: 1fr; gap: 12px; }
  .store-brand { min-width: 0; }
  .header-action { display: none; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .content-grid { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
  .product-grid, .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .top-strip { display: none; }
  .header-main { padding: 12px 14px 15px; }
  .search-bar { height: 43px; }
  .search-bar button { display: none; }
  main { padding: 16px 12px 84px; }
  .hero-card { padding: 24px 20px; border-radius: 22px; }
  .hero-copy h1 { font-size: 30px; }
  .hero-copy p:not(.hero-kicker) { font-size: 13px; }
  .stats-row { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stats-row article { padding: 12px; }
  .stats-row strong { font-size: 20px; }
  .stats-row span { font-size: 11px; }
  .section-card, .products-section, .filter-panel { padding: 15px; border-radius: 16px; }
  h2 { font-size: 18px; }
  .product-grid, .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-body { padding: 10px; }
  .product-name { min-height: 38px; font-size: 13px; }
  .product-price { font-size: 14px; }
  .product-desc { display: none; }
  .product-actions { grid-template-columns: 1fr; }
  .card-order { display: none !important; }
  .detail-sheet { grid-template-columns: 1fr; max-height: calc(100vh - 28px); border-radius: 22px; }
  .detail-image-wrap { min-height: 280px; max-height: 42vh; }
  .detail-body { padding: 22px; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.95); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
  .mobile-nav button { display: grid; gap: 2px; place-items: center; color: #656d7d; background: transparent; border: 0; font-size: 10px; font-weight: 850; }
  .mobile-nav span { font-size: 18px; }
}
@media (max-width: 390px) {
  .product-grid, .skeleton-grid { grid-template-columns: 1fr; }
}

/* === Responsive polish: tablet & mobile storefront === */
@media (max-width: 1120px) {
  .header-main,
  .top-strip,
  main { max-width: 100%; }
  .hero-card { grid-template-columns: minmax(0, 1fr) 280px; padding: 30px; }
  .promo-main { right: 0; width: 215px; }
  .product-grid, .skeleton-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .market-header { position: sticky; }
  .header-main {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 13px 18px 16px;
  }
  .store-brand { min-width: 0; }
  .store-brand strong { max-width: 46vw; }
  .search-bar { grid-column: 1 / -1; order: 3; }
  .header-action { display: inline-flex; height: 38px; padding: 0 13px; }
  .hero-card { grid-template-columns: 1fr; min-height: auto; }
  .hero-visual { display: none; }
  .content-grid { grid-template-columns: 1fr; }
  .filter-panel {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
  }
  .filter-title { grid-column: 1 / -1; margin-bottom: 2px; }
  .filter-panel label { margin: 0 0 6px; }
  .filter-panel label:not(.check-line) { align-self: end; }
  .filter-panel select { height: 42px; }
  .check-line { grid-column: 1 / -1; min-height: 38px; margin: 2px 0 0 !important; padding: 0 12px; background: #fff7fa; border: 1px solid #ffd6df; border-radius: 12px; }
  .product-grid, .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  body { background: #f7f8fc; }
  .market-header { border-radius: 0 0 18px 18px; }
  .header-main { padding: 11px 12px 14px; }
  .brand-bag { width: 38px; height: 38px; border-radius: 12px; font-size: 20px; }
  .store-brand { gap: 8px; }
  .store-brand strong { max-width: 58vw; font-size: 16px; }
  .store-brand small { font-size: 8px; }
  .header-action { display: none; }
  .search-bar {
    height: 44px;
    grid-template-columns: 21px 1fr;
    padding: 0 13px;
    border-radius: 14px;
  }
  .search-bar button { display: none; }
  main { padding: 14px 12px 96px; }
  .hero-card {
    padding: 23px 18px;
    border-radius: 22px;
    box-shadow: 0 14px 30px rgba(227, 27, 75, .16);
  }
  .hero-kicker { font-size: 11px; padding: 6px 10px; }
  .hero-copy h1 { font-size: clamp(26px, 8vw, 34px); letter-spacing: -1px; }
  .hero-copy p:not(.hero-kicker) { font-size: 13px; line-height: 1.55; }
  .hero-actions { margin-top: 18px; }
  .hero-actions button { flex: 1 1 135px; height: 40px; padding: 0 12px; font-size: 13px; }
  .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
  .stats-row article { padding: 12px 8px; border-radius: 15px; text-align: center; }
  .stats-row strong { font-size: 19px; }
  .stats-row span { font-size: 10.5px; }
  .section-card,
  .filter-panel,
  .products-section { padding: 14px; border-radius: 16px; }
  .section-head,
  .products-head { align-items: flex-start; }
  .section-head button { height: 32px; padding: 0 10px; font-size: 11px; white-space: nowrap; }
  h2 { font-size: 18px; }
  .category-chips { gap: 8px; margin: 13px -2px 0; padding: 0 2px 2px; }
  .category-chip { min-width: 106px; padding: 11px 12px; border-radius: 14px; }
  .category-chip strong { font-size: 12px; }
  .category-chip span { font-size: 10px; }
  .filter-panel { grid-template-columns: 1fr 1fr; }
  .filter-title { font-size: 14px; }
  .filter-panel label { font-size: 11.5px; }
  .filter-panel select { height: 39px; border-radius: 11px; font-size: 12px; }
  .products-head { gap: 10px; }
  .result-count { padding: 6px 9px; font-size: 11px; white-space: nowrap; }
  .product-grid, .skeleton-grid { gap: 10px; margin-top: 14px; }
  .product-card { border-radius: 15px; }
  .product-card:hover { transform: none; box-shadow: 0 10px 24px rgba(24,32,52,.08); }
  .product-media { aspect-ratio: 1 / .86; }
  .product-badge { top: 7px; left: 7px; padding: 4px 7px; font-size: 9px; }
  .product-body { padding: 10px; }
  .product-name { min-height: 36px; font-size: 12.5px; line-height: 1.35; }
  .product-price { margin-top: 6px; font-size: 14px; }
  .product-desc { display: none; }
  .product-actions { grid-template-columns: 1fr; margin-top: 9px; }
  .product-actions button, .product-actions a { height: 34px; border-radius: 10px; font-size: 11.5px; }
  .card-order { display: none !important; }
  .skeleton-grid span { height: 205px; }
  .mobile-nav { box-shadow: 0 -10px 30px rgba(25, 30, 45, .08); }
}

@media (max-width: 520px) {
  .product-grid, .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-panel { grid-template-columns: 1fr; }
  .check-line { grid-column: auto; }
  .detail-sheet {
    align-self: end;
    width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
  }
  .detail-image-wrap { min-height: 230px; max-height: 36vh; }
  .detail-body { padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
  .detail-body h2 { font-size: 23px; }
  .detail-price { font-size: 22px; }
  .detail-description { font-size: 13.5px; line-height: 1.6; }
  .detail-actions { display: grid; grid-template-columns: 1fr; }
  .order-button, .secondary-detail { width: 100%; min-height: 43px; }
}

@media (max-width: 380px) {
  main { padding-left: 10px; padding-right: 10px; }
  .product-grid, .skeleton-grid { grid-template-columns: 1fr; }
  .product-media { aspect-ratio: 1 / .72; }
  .product-actions { grid-template-columns: 1fr auto; }
  .card-order { display: inline-flex !important; }
}


/* Tombol keranjang dibuat lebih jelas */
.product-actions { grid-template-columns: minmax(0, 1fr) minmax(92px, auto); }
.card-order {
  gap: 5px;
  min-width: 92px;
  padding: 0 12px;
  box-shadow: 0 8px 18px rgba(19, 165, 103, .18);
  white-space: nowrap;
}
.card-order:hover:not(.disabled) {
  background: #0f925b;
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .product-actions { grid-template-columns: 1fr; }
  .card-order {
    display: inline-flex !important;
    width: 100%;
    min-width: 0;
    height: 34px;
  }
}

@media (max-width: 380px) {
  .product-actions { grid-template-columns: 1fr; }
}


/* Logo toko dari admin panel */
.brand-bag { overflow: hidden; }
.store-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#storeLogoFallback { display: grid; width: 100%; height: 100%; place-items: center; }

/* === Keranjang mengambang kiri bawah === */
.cart-widget {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 65;
  display: grid;
  gap: 10px;
  justify-items: start;
}
.cart-float {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 174px;
  min-height: 56px;
  padding: 8px 16px 8px 10px;
  color: #fff;
  background: linear-gradient(135deg, #13a567, #0d8f59);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 18px 38px rgba(19, 165, 103, .32);
  text-align: left;
}
.cart-float-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  background: rgba(255,255,255,.18);
  border-radius: 50%;
  font-size: 21px;
}
.cart-float strong, .cart-float small { display: block; line-height: 1.1; }
.cart-float strong { font-size: 13px; font-weight: 950; }
.cart-float small { margin-top: 3px; color: rgba(255,255,255,.82); font-size: 11px; font-weight: 750; }
.cart-float em {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  color: var(--red);
  background: #fff;
  border: 2px solid #10a161;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
}
.cart-pulse { animation: cartPulse .42s ease; }
@keyframes cartPulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.cart-panel {
  width: min(380px, calc(100vw - 24px));
  max-height: min(620px, calc(100vh - 110px));
  overflow: hidden;
  background: #fff;
  border: 1px solid #dfe6ee;
  border-radius: 22px;
  box-shadow: 0 26px 80px rgba(24,32,52,.23);
}
.cart-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 13px;
  border-bottom: 1px solid var(--line);
}
.cart-panel-head strong, .cart-panel-head small { display: block; }
.cart-panel-head strong { font-size: 16px; }
.cart-panel-head small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.cart-panel-head button {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: #687182;
  background: #f4f6fa;
  border: 0;
  border-radius: 50%;
  font-size: 22px;
}
.cart-items {
  display: grid;
  gap: 10px;
  max-height: min(360px, calc(100vh - 330px));
  overflow-y: auto;
  padding: 13px;
}
.cart-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  background: #fbfcff;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.cart-item-media {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  overflow: hidden;
  color: var(--red);
  background: linear-gradient(135deg, #fff0f4, #fff7e8);
  border-radius: 13px;
  font-size: 24px;
  font-weight: 950;
}
.cart-item-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-item-body { min-width: 0; }
.cart-item-body strong {
  display: block;
  overflow: hidden;
  color: #2d3340;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cart-item-body small { display: block; margin-top: 3px; color: var(--red); font-size: 11px; font-weight: 850; }
.cart-qty { display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; background: #fff; border: 1px solid #e0e6ef; border-radius: 999px; }
.cart-qty button {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--red);
  background: transparent;
  border: 0;
  font-size: 16px;
  font-weight: 950;
}
.cart-qty span { min-width: 22px; text-align: center; font-size: 12px; font-weight: 900; }
.cart-item-side { display: grid; gap: 8px; justify-items: end; }
.cart-item-side strong { color: #303744; font-size: 12px; white-space: nowrap; }
.cart-item-side button { color: var(--red); background: transparent; border: 0; font-size: 10.5px; font-weight: 850; }
.cart-empty { display: grid; place-items: center; padding: 32px 22px; text-align: center; }
.cart-empty span { font-size: 38px; }
.cart-empty strong { margin-top: 8px; }
.cart-empty p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.cart-footer { padding: 13px; border-top: 1px solid var(--line); }
.cart-total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; }
.cart-total-row span { color: var(--muted); font-size: 12px; font-weight: 750; }
.cart-total-row strong { color: var(--red); font-size: 17px; }
.cart-footer-actions { display: grid; grid-template-columns: .7fr 1.3fr; gap: 8px; }
.cart-clear, .cart-checkout { height: 39px; border-radius: 12px; font-size: 12px; font-weight: 950; }
.cart-clear { color: #687182; background: #f3f5f8; border: 1px solid #e2e7ee; }
.cart-checkout { color: #fff; background: var(--green); border: 0; }
.cart-clear:disabled, .cart-checkout:disabled { cursor: not-allowed; opacity: .55; }
.card-order { border: 0; }
.order-button { border: 0; }

@media (max-width: 720px) {
  .cart-widget { left: 12px; right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); }
  .cart-float { min-width: 158px; min-height: 50px; padding: 7px 14px 7px 8px; }
  .cart-float-icon { width: 36px; height: 36px; font-size: 19px; }
  .cart-panel { width: 100%; max-height: calc(100vh - 120px); border-radius: 20px; }
  .cart-items { max-height: calc(100vh - 360px); }
}
@media (max-width: 430px) {
  .cart-item { grid-template-columns: 52px minmax(0, 1fr); }
  .cart-item-media { width: 52px; height: 52px; }
  .cart-item-side { grid-column: 2; grid-template-columns: 1fr auto; width: 100%; align-items: center; }
  .cart-footer-actions { grid-template-columns: 1fr; }
}


/* Keranjang dipindah ke kanan bawah dan tidak dibuka otomatis saat klik Pesan */
.cart-widget {
  left: auto;
  right: 22px;
  justify-items: end;
}
@media (max-width: 720px) {
  .cart-widget {
    left: 12px;
    right: 12px;
    justify-items: end;
  }
}


/* Tombol keranjang di modal detail: ikon saja */
.detail-cart-icon {
  width: 52px;
  min-width: 52px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}
.detail-cart-icon:hover:not(:disabled) {
  background: #0f925b;
  transform: translateY(-1px);
}
@media (max-width: 520px) {
  .detail-actions { grid-template-columns: 56px 1fr; }
  .detail-cart-icon {
    width: 52px !important;
    min-width: 52px;
  }
  .secondary-detail { width: 100%; }
}


/* Tombol pesan langsung di modal detail */
.detail-direct-order {
  min-width: 154px;
  background: var(--green);
}
.detail-direct-order:hover {
  background: #0f925b;
  transform: translateY(-1px);
}
@media (max-width: 520px) {
  .detail-actions {
    display: grid;
    grid-template-columns: 56px 1fr;
  }
  .detail-direct-order {
    grid-column: 1 / -1;
    width: 100%;
  }
  .detail-cart-icon { grid-column: 1; }
  .secondary-detail { grid-column: 2; }
}


/* === Ikon SVG marketplace/e-commerce === */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.eco-icon {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: -0.17em;
}
.brand-bag .eco-icon { width: 24px; height: 24px; stroke-width: 2.2; }
.header-action .eco-icon { width: 17px; height: 17px; }
.promo-mini .eco-icon { width: 34px; height: 34px; stroke-width: 1.85; }
.filter-title span .eco-icon { width: 16px; height: 16px; }
.empty-state > span { display: grid; width: 48px; height: 48px; place-items: center; color: var(--red); background: var(--red-soft); border-radius: 50%; }
.empty-state > span .eco-icon { width: 26px; height: 26px; }
.mobile-nav span { display: grid; width: 22px; height: 22px; place-items: center; font-size: 0; }
.mobile-nav span .eco-icon { width: 20px; height: 20px; }
.cart-float-icon .eco-icon { width: 22px; height: 22px; stroke-width: 2.1; }
.cart-empty > span { display: grid; width: 52px; height: 52px; place-items: center; color: var(--green); background: #edfff6; border-radius: 50%; }
.cart-empty > span .eco-icon { width: 28px; height: 28px; }
.card-order .eco-icon, .detail-direct-order .eco-icon { width: 16px; height: 16px; }
.detail-cart-icon .eco-icon { width: 23px; height: 23px; }

/* === Redesign pop-up keranjang: marketplace checkout sheet === */
.cart-panel {
  width: min(420px, calc(100vw - 24px));
  overflow: hidden;
  background: linear-gradient(180deg, #fff 0%, #fff 62%, #fff8fa 100%);
  border: 0;
  border-radius: 26px;
  box-shadow: 0 28px 90px rgba(20, 28, 45, .28);
  animation: cartPanelIn .18s ease-out;
}
@keyframes cartPanelIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.cart-panel-head {
  padding: 18px 18px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--red), #ff4d72 72%, #ff865b);
  border-bottom: 0;
}
.cart-panel-head strong { color: #fff; font-size: 17px; letter-spacing: -.25px; }
.cart-panel-head small { color: rgba(255,255,255,.82); font-weight: 700; }
.cart-panel-head button {
  color: #fff;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.22);
}
.cart-panel-head button:hover { background: rgba(255,255,255,.28); }
.cart-items {
  gap: 11px;
  padding: 14px;
  background: #f8f9fd;
}
.cart-items::-webkit-scrollbar { width: 7px; }
.cart-items::-webkit-scrollbar-thumb { background: #d7dce7; border-radius: 999px; }
.cart-item {
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 11px;
  background: #fff;
  border: 1px solid #eef1f6;
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(25, 32, 46, .045);
}
.cart-item-media {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}
.cart-item-body strong { font-size: 13px; line-height: 1.35; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cart-item-body small { margin-top: 4px; font-size: 12px; }
.cart-qty {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid #ffd4df;
  background: var(--red-soft);
}
.cart-qty button { color: var(--red); background: #fff; }
.cart-qty button:hover { background: #ffe4eb; }
.cart-qty span { color: var(--red); }
.cart-item-side {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-top: 8px;
  border-top: 1px dashed #edf0f5;
}
.cart-item-side strong { font-size: 13px; color: #1f2530; }
.cart-item-side button {
  height: 27px;
  padding: 0 10px;
  color: #e31b4b;
  background: #fff2f6;
  border: 1px solid #ffd6df;
  border-radius: 999px;
}
.cart-empty { background: #f8f9fd; }
.cart-footer {
  padding: 14px;
  background: #fff;
  border-top: 1px solid #eef1f6;
  box-shadow: 0 -10px 24px rgba(25,32,46,.04);
}
.cart-total-row {
  margin-bottom: 12px;
  padding: 12px 13px;
  background: linear-gradient(135deg, #fff5f8, #fff);
  border: 1px solid #ffe0e8;
  border-radius: 16px;
}
.cart-total-row span { color: #8b5364; font-size: 12px; }
.cart-total-row strong { color: var(--red); font-size: 19px; }
.cart-footer-actions { grid-template-columns: .78fr 1.22fr; }
.cart-clear, .cart-checkout {
  height: 43px;
  border-radius: 14px;
  font-size: 12.5px;
}
.cart-clear { background: #fff; border: 1px solid #dfe5ee; }
.cart-checkout {
  background: linear-gradient(135deg, #12a362, #0f8d57);
  box-shadow: 0 12px 24px rgba(19,165,103,.22);
}
.cart-checkout:hover:not(:disabled) { background: linear-gradient(135deg, #0f965b, #0d7e50); transform: translateY(-1px); }

@media (max-width: 720px) {
  .cart-widget { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .cart-panel {
    width: 100%;
    max-height: min(78vh, 680px);
    border-radius: 24px 24px 18px 18px;
  }
  .cart-panel-head::before {
    content: "";
    position: absolute;
  }
  .cart-items { max-height: calc(78vh - 230px); }
}
@media (max-width: 430px) {
  .cart-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    max-height: 82vh;
    border-radius: 24px 24px 0 0;
  }
  .cart-panel-head { padding-top: 22px; }
  .cart-panel-head::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 46px;
    height: 4px;
    background: rgba(255,255,255,.55);
    border-radius: 999px;
    transform: translateX(-50%);
  }
  .cart-items { max-height: calc(82vh - 250px); }
  .cart-item { grid-template-columns: 58px minmax(0, 1fr); }
  .cart-item-media { width: 58px; height: 58px; }
  .cart-footer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}
.cart-panel-head { position: relative; }


/* Tombol silang: ikon lebih premium dan touch-friendly */
.close-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
}
#cartClose,
.modal-close {
  display: grid;
  place-items: center;
  transition: transform .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}
#cartClose {
  width: 34px;
  height: 34px;
  color: #fff;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}
#cartClose:hover {
  color: #fff;
  background: rgba(255,255,255,.28);
  transform: rotate(90deg) scale(1.04);
}
.modal-close {
  width: 38px;
  height: 38px;
  color: #4b5566;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(214,222,233,.95);
  box-shadow: 0 10px 28px rgba(21,31,48,.16);
  font-size: 0;
}
.modal-close:hover {
  color: var(--red);
  background: #fff3f6;
  border-color: #ffd2dc;
  transform: rotate(90deg) scale(1.04);
}
@media (max-width: 520px) {
  .modal-close { width: 36px; height: 36px; }
  #cartClose { width: 33px; height: 33px; }
}

/* Infinite scroll produk */
.load-more-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin: 18px 0 4px;
  padding: 13px;
  color: #7b5363;
  background: #fff7fa;
  border: 1px solid #ffe0e8;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 850;
}
.load-more-state span {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(227, 27, 75, .18);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
