/* GLOBAL & RESET */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; -webkit-tap-highlight-color: transparent; }
html, body { background: #f5f5f5; }
body { min-height: 100vh; position: relative; padding-bottom: 70px; }
a { text-decoration: none; color: inherit; }
input, select, textarea, button { font-family: inherit; }

/* HEADER GAYA ALFAGIFT */
.header-wrapper { background: #fff; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* BARIS 1: HEAD BAR (TIPIS) */
.head-bar { padding: 8px 15px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #666; position: relative; }
.loc-btn { display: flex; align-items: center; gap: 5px; cursor: pointer; background: transparent; border: none; color: #666; padding: 0; max-width: 60%; }
.loc-btn svg { width: 14px; height: 14px; stroke: #ee2d24; fill: none; stroke-width: 2; flex-shrink: 0; }
.loc-btn span { font-weight: 700; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-btn .arrow { stroke: #999; width: 12px; height: 12px; flex-shrink: 0; }
.auth-links { display: flex; gap: 15px; align-items: center; flex-shrink: 0; }
.auth-links a { font-weight: 600; }
.auth-links .login { color: #666; }
.auth-links .register { color: #ee2d24; }

/* CUSTOM DROPDOWN LOKASI */
.loc-dropdown { display: none; position: absolute; top: 35px; left: 15px; background: #fff; width: 240px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); z-index: 200; overflow: hidden; }
.loc-dropdown.show { display: block; }
.loc-item { padding: 10px 15px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f5f5f5; display: flex; align-items: center; gap: 8px; color: #444; }
.loc-item:hover { background: #fff8f8; }
.loc-item.active { background: #fff0f0; color: #ee2d24; font-weight: bold; }
.loc-item svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* BARIS 2: MAIN HEADER (TEBAL) */
.main-header { padding: 15px; display: flex; align-items: center; gap: 15px; }
.brand { font-size: 24px; font-weight: 800; color: #ee2d24; flex: 1; }
.main-search { 
  width: 140px; 
  max-width: 50%; 
  display: flex; 
  align-items: center; 
  background: #f4f4f4; 
  border: 1px solid #eee; 
  border-radius: 20px; /* Bentuk Pill membulat */
  padding: 8px 15px; 
  flex-shrink: 0; 
}
.main-search svg { width: 16px; height: 16px; stroke: #888; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.main-search input { background: transparent; border: none; outline: none; width: 100%; font-size: 13px; margin-left: 8px; color: #333; min-width: 0; }
.main-search input::placeholder { color: #999; }
.cart-icon-wrapper { position: relative; cursor: pointer; display: flex; align-items: center; flex-shrink: 0; }
.cart-icon-wrapper svg { width: 26px; height: 26px; stroke: #333; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cart-badge { position: absolute; top: -8px; right: -8px; background: #ee2d24; color: #fff; width: 18px; height: 18px; border-radius: 50%; display: none; justify-content: center; align-items: center; font-size: 10px; font-weight: bold; }

/* BUTTONS */
.btn-primary { width: 100%; background: #ee2d24; color: #fff; border: none; padding: 14px; border-radius: 8px; font-size: 16px; font-weight: 700; cursor: pointer; }
.btn-primary:active { background: #c81d14; }
.btn-secondary { width: 100%; background: #f4f4f4; color: #333; border: 1px solid #ddd; padding: 12px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; margin-bottom: 15px; }
.btn-outline { font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 6px; border: 1px solid #ee2d24; color: #ee2d24; background: transparent; cursor: pointer; }
.btn-solid { font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 6px; border: 1px solid #ee2d24; color: #fff; background: #ee2d24; cursor: pointer; }
.btn-action { width: 100%; padding: 12px; border: none; border-radius: 8px; margin-top: 10px; font-weight: bold; cursor: pointer; color: #fff; font-size: 14px; }
.btn-proses { background: #0c5460; }
.btn-selesai { background: #155724; }
.btn-wa { background: #25D366; color: #fff; border: none; padding: 14px; border-radius: 8px; width: 100%; font-weight: bold; margin-top: 15px; text-decoration: none; display: flex; align-items:center; justify-content:center; gap:8px; }

/* FORMS & CONTAINERS */
.form-container, .dasbor-container, .struk-container { max-width: 500px; margin: 20px auto; background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.form-container h2 { color: #222; margin-bottom: 20px; text-align: center; font-size: 20px; }
label { display: block; font-size: 13px; color: #555; margin-bottom: 8px; font-weight: 600; margin-top: 15px; }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; margin-bottom: 15px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #ee2d24; }
.helper-text { font-size: 11px; color: #888; margin-top: -10px; margin-bottom: 15px; }
.coord-box { background: #f9f9f9; border: 1px dashed #ccc; padding: 10px; border-radius: 8px; font-size: 12px; color: #555; min-height: 40px; margin-bottom: 15px; word-break: break-word; }

/* KATEGORI */
.categories { display: flex; gap: 20px; padding: 20px 15px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; max-width: 100%; background: #fff; margin-bottom: 10px; }
.categories::-webkit-scrollbar { display: none; }
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.cat-circle { width: 50px; height: 50px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.08); transition: all 0.2s; color: #555; border: 1px solid #eee; }
.cat-circle svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cat-name { font-size: 12px; color: #444; font-weight: 600; }
.cat-item.active .cat-circle { background: #ee2d24; color: #fff; transform: scale(1.05); border-color: #ee2d24; }

.section-title { padding: 0 15px 15px; font-size: 18px; font-weight: 800; color: #222; max-width: 1200px; margin: 0 auto; }

/* GRID PRODUK */
.list-container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; padding: 0 15px 20px; max-width: 1200px; margin: 0 auto; }
@media (min-width: 600px) { .list-container { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .list-container { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .list-container { grid-template-columns: repeat(5, 1fr); } }

.list-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.list-card img { width: 100%; height: 140px; object-fit: cover; background: #eee; }
.list-body { padding: 12px; display: flex; flex-direction: column; flex: 1; }
.list-store { font-size: 11px; color: #888; margin-bottom: 4px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.list-title { font-size: 15px; font-weight: 700; color: #222; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #666; margin-bottom: 8px; }
.list-rating { background: #fff8e1; color: #f57f17; padding: 2px 6px; border-radius: 4px; font-weight: bold; }
.list-price { display: flex; flex-direction: column; margin-top: auto; }
.list-price .coret { font-size: 12px; color: #999; text-decoration: line-through; }
.list-price .real { font-size: 16px; font-weight: 800; color: #ee2d24; }
.badge-po { display: inline-block; background: #e3f2fd; color: #1976d2; font-size: 9px; padding: 2px 6px; border-radius: 4px; margin-bottom: 4px; font-weight: bold; width: fit-content; }

/* MODAL DETAIL PRODUK */
.modal-bg { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 300; justify-content: center; align-items: flex-end; }
.modal-content { background: #fff; width: 100%; max-width: 500px; border-radius: 16px 16px 0 0; padding: 20px; max-height: 90vh; overflow-y: auto; animation: slideUp 0.3s ease; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-img { width: 100%; height: 250px; object-fit: cover; border-radius: 12px; margin-bottom: 15px; }
.modal-close { float: right; font-size: 24px; cursor: pointer; color: #888; line-height: 1; }
.modal-title { font-size: 20px; font-weight: 800; margin-bottom: 5px; }
.modal-store { color: #ee2d24; font-weight: 600; font-size: 14px; margin-bottom: 10px; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.modal-price { font-size: 18px; font-weight: 800; color: #ee2d24; margin: 15px 0; display: flex; align-items: center; gap: 10px; }
.modal-desc { font-size: 14px; color: #555; line-height: 1.5; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #eee; }

/* MODAL KERANJANG */
.cart-item { display: flex; gap: 15px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #eee; }
.cart-item img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-info h5 { font-size: 14px; margin-bottom: 5px; }
.cart-item-info .price { font-size: 13px; color: #ee2d24; font-weight: bold; margin-bottom: 8px; }
.qty-control { display: flex; align-items: center; gap: 10px; }
.qty-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #ee2d24; background: #fff; color: #ee2d24; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qty-input { width: 40px; text-align: center; border: 1px solid #ddd; border-radius: 4px; padding: 4px; font-size: 14px; }
.cart-note { width: 100%; border: 1px solid #ddd; border-radius: 6px; padding: 8px; font-size: 12px; margin-top: 8px; resize: none; }

/* SECTION INFO */
.info-section { max-width: 1200px; margin: 20px auto; padding: 0 15px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
@media (min-width: 768px) { .info-section { grid-template-columns: repeat(4, 1fr); } }
.info-card { background: #fff; padding: 15px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.info-card svg { width: 28px; height: 28px; stroke: #ee2d24; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.info-card h3 { font-size: 14px; color: #333; }
.info-card p { font-size: 11px; color: #777; line-height: 1.5; }

/* CART BAR */
.cart-bar { position: fixed; bottom: 0; left: 0; width: 100%; background: #fff; padding: 15px; box-shadow: 0 -4px 10px rgba(0,0,0,0.05); display: none; z-index: 150; }
.btn-checkout { background: #ee2d24; color: #fff; border: none; padding: 15px; border-radius: 10px; font-weight: 800; font-size: 16px; width: 100%; max-width: 500px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }

/* DASHBOARD */
.nav { display: flex; background: #fff; border-radius: 12px; margin-bottom: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); overflow: hidden; }
.nav button { flex: 1; padding: 15px; border: none; background: transparent; cursor: pointer; font-weight: bold; color: #888; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.nav button.active { background: #ee2d24; color: #fff; }
.card { background: #fff; padding: 15px; border-radius: 12px; margin-bottom: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.card h4 { margin-bottom: 10px; color: #333; display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.upload-area { width: 100%; height: 150px; border: 2px dashed #ddd; border-radius: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; background: #fafafa; color: #888; font-size: 14px; }
.upload-area img { width: 100%; height: 100%; object-fit: cover; }
.status-badge { padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: bold; text-transform: uppercase; }
.status-menunggu { background: #fff3cd; color: #856404; }
.status-diproses { background: #d1ecf1; color: #0c5460; }
.status-selesai { background: #d4edda; color: #155724; }
.product-item { display: flex; gap: 15px; align-items: center; border-bottom: 1px solid #eee; padding: 10px 0; }
.product-item img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; background: #eee; }
.product-info { flex: 1; }
.product-info h5 { font-size: 14px; color: #222; display: flex; align-items: center; gap: 5px; }
.product-info p { font-size: 13px; color: #ee2d24; font-weight: bold; }
.btn-delete { background: none; border: none; padding: 5px; cursor: pointer; display: flex; }

/* STRUK & TOKO */
.store-header { background: #fff; padding: 20px; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); margin-bottom: 20px; }
.store-logo { width: 80px; height: 80px; background: #eee; border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; }
.store-name { font-size: 20px; font-weight: 800; color: #222; }
.store-meta { font-size: 13px; color: #666; margin-top: 5px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.status-box { padding: 15px; border-radius: 8px; font-weight: bold; font-size: 18px; margin-bottom: 20px; }
.item-list { text-align: left; margin: 15px 0; border-top: 1px dashed #ccc; border-bottom: 1px dashed #ccc; padding: 15px 0; }
.trx-note { font-size: 12px; color: #666; font-style: italic; margin-top: 4px; }

/* MISC */
.loading { text-align: center; padding: 40px; color: #888; font-weight: 600; }
.blokir-page { display: none; flex-direction: column; align-items: center; justify-content: center; height: 100vh; text-align: center; padding: 20px; }
.blokir-page h2 { color: #ee2d24; margin-bottom: 10px; }
.link-bottom { text-align: center; margin-top: 20px; font-size: 14px; color: #666; }
.link-bottom a { color: #ee2d24; font-weight: 700; }