/* ============================================================
   BUMI SUPERMARKET — base stylesheet
   Design tokens
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800&family=Inter:wght@400;500;600&family=Space+Mono:wght@400;700&display=swap');

:root{
  /* colour */
  --green-deep:   #0B6E36;
  --green-bright: #14A44D;
  --green-shade:  #08512A;
  --amber:        #E8A93B;
  --amber-deep:   #C6821E;
  --rust:         #C6541D;
  --cream:        #FBF6EC;
  --cream-dim:    #F2EAD8;
  --charcoal:     #20241F;
  --charcoal-60:  rgba(32,36,31,.6);
  --white:        #FFFFFF;

  /* type */
  --font-display: 'Poppins', 'Segoe UI', sans-serif;
  --font-body:    'Inter', 'Segoe UI', sans-serif;
  --font-mono:    'Space Mono', 'Courier New', monospace;

  /* layout */
  --max-w: 1180px;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11,110,54,.10);
  --shadow-sm: 0 4px 14px rgba(32,36,31,.08);
}

*{ margin:0; padding:0; box-sizing:border-box; }

html{ scroll-behavior:smooth; }

body{
  font-family:var(--font-body);
  background:var(--cream);
  color:var(--charcoal);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}

img{ max-width:100%; display:block; }

a{ color:inherit; }

h1,h2,h3,h4{
  font-family:var(--font-display);
  line-height:1.15;
  color:var(--charcoal);
}

.container{
  max-width:var(--max-w);
  margin:0 auto;
  padding:0 6%;
}

:focus-visible{
  outline:3px solid var(--amber);
  outline-offset:2px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:0.001ms !important; transition-duration:0.001ms !important; }
}

/* ---------- eyebrow / section labels ---------- */
.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-family:var(--font-mono);
  font-size:12px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--green-shade);
  background:rgba(20,164,77,.10);
  padding:6px 14px;
  border-radius:999px;
  margin-bottom:16px;
}
.eyebrow::before{
  content:"";
  width:6px; height:6px;
  background:var(--amber);
  border-radius:50%;
  display:inline-block;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header{
  background:var(--green-deep);
  color:var(--white);
  position:sticky;
  top:0;
  z-index:100;
  box-shadow:0 2px 0 rgba(0,0,0,.06);
}
.site-header .container{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-top:16px;
  padding-bottom:16px;
  gap:20px;
}
.logo{
  font-family:var(--font-display);
  font-weight:800;
  font-size:22px;
  letter-spacing:.01em;
  text-decoration:none;
  color:var(--white);
  display:flex;
  align-items:center;
  gap:10px;
  white-space:nowrap;
}
.logo .mark{
  width:34px; height:34px;
  border-radius:9px;
  background:var(--amber);
  color:var(--green-shade);
  font-family:var(--font-mono);
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:15px;
  flex:none;
}
nav.primary-nav{
  display:flex;
  align-items:center;
  gap:26px;
  flex-wrap:wrap;
}
nav.primary-nav a{
  text-decoration:none;
  color:rgba(255,255,255,.82);
  font-weight:600;
  font-size:14.5px;
  padding:6px 2px;
  border-bottom:2px solid transparent;
  transition:color .15s ease, border-color .15s ease;
}
nav.primary-nav a:hover,
nav.primary-nav a[aria-current="page"]{
  color:var(--white);
  border-bottom-color:var(--amber);
}
.header-actions{
  display:flex;
  align-items:center;
  gap:14px;
}
.icon-btn{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  width:38px; height:38px;
  border-radius:10px;
  background:rgba(255,255,255,.10);
  text-decoration:none;
  color:var(--white);
  font-size:16px;
  transition:background .15s ease;
}
.icon-btn:hover{ background:rgba(255,255,255,.2); }
.cart-count{
  position:absolute;
  top:-6px; right:-6px;
  background:var(--amber);
  color:var(--green-shade);
  font-family:var(--font-mono);
  font-size:11px;
  font-weight:700;
  min-width:18px; height:18px;
  border-radius:999px;
  display:flex; align-items:center; justify-content:center;
  padding:0 4px;
}
.nav-toggle{
  display:none;
  background:none;
  border:none;
  color:var(--white);
  font-size:22px;
  cursor:pointer;
}

@media (max-width: 860px){
  nav.primary-nav{
    display:none;
    position:absolute;
    top:100%; left:0; right:0;
    background:var(--green-deep);
    flex-direction:column;
    align-items:flex-start;
    padding:14px 6%;
    gap:14px;
  }
  nav.primary-nav.open{ display:flex; }
  .nav-toggle{ display:block; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:14px 30px;
  border-radius:999px;
  font-weight:700;
  font-size:14.5px;
  text-decoration:none;
  border:2px solid transparent;
  cursor:pointer;
  transition:transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  font-family:var(--font-body);
}
.btn:active{ transform:translateY(1px); }
.btn-primary{
  background:var(--amber);
  color:var(--green-shade);
  box-shadow:0 8px 20px rgba(232,169,59,.35);
}
.btn-primary:hover{ background:var(--amber-deep); }
.btn-outline{
  background:transparent;
  border-color:rgba(255,255,255,.5);
  color:var(--white);
}
.btn-outline:hover{ border-color:var(--white); }
.btn-dark{
  background:var(--green-deep);
  color:var(--white);
}
.btn-dark:hover{ background:var(--green-shade); }
.btn-block{ width:100%; }
.btn-sm{ padding:9px 18px; font-size:13px; }
.btn[disabled]{ opacity:.5; cursor:not-allowed; }

/* ============================================================
   SECTIONS / CARDS
   ============================================================ */
.section{ padding:78px 0; }
.section-head{
  text-align:center;
  max-width:620px;
  margin:0 auto 44px;
}
.section-head h2{ font-size:34px; font-weight:800; }
.section-head p{ color:var(--charcoal-60); margin-top:10px; font-size:15.5px; }

/* ---- category pills (used on homepage and shop page) ---- */
.category-row{
  display:flex;
  gap:14px;
  overflow-x:auto;
  padding:6px 0 10px;
  scrollbar-width:thin;
}
.category-pill{
  flex:none;
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--white);
  border:1.5px solid #EAE2CC;
  border-radius:999px;
  padding:10px 20px;
  font-weight:600;
  font-size:14px;
  text-decoration:none;
  color:var(--charcoal);
  transition:border-color .15s ease, background .15s ease;
}
.category-pill .dot{
  width:8px; height:8px;
  border-radius:50%;
  background:var(--green-bright);
}
.category-pill:hover{ border-color:var(--green-bright); background:var(--cream-dim); }
.category-pill.active{ border-color:var(--green-bright); background:var(--cream-dim); }

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(230px, 1fr));
  gap:26px;
}

.card{
  background:var(--white);
  border-radius:var(--radius);
  box-shadow:var(--shadow-sm);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  transition:transform .18s ease, box-shadow .18s ease;
}
.card:hover{ transform:translateY(-4px); box-shadow:var(--shadow); }

/* ---- product card ---- */
.product-card{ position:relative; }
.product-card .thumb{
  position:relative;
  display:block;
  height:170px;
  overflow:hidden;
  background:var(--cream-dim);
}
.product-card .thumb img{
  width:100%; height:100%;
  object-fit:cover;
}
.wishlist-btn{
  position:absolute;
  top:12px; left:12px;
  z-index:2;
  width:34px; height:34px;
  border-radius:50%;
  border:none;
  background:rgba(255,255,255,.92);
  color:var(--rust);
  font-size:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 4px 10px rgba(0,0,0,.15);
  transition:transform .15s ease;
}
.wishlist-btn:hover{ transform:scale(1.08); }
.wishlist-btn.active{ background:var(--rust); color:var(--white); }

.pill{
  display:inline-block;
  font-size:11.5px;
  font-weight:700;
  padding:5px 12px;
  border-radius:999px;
}
.pill.approved{ background:rgba(20,164,77,.14); color:var(--green-shade); }
.pill.pending{ background:rgba(232,169,59,.2); color:var(--amber-deep); }
.pill.rejected{ background:rgba(198,84,29,.14); color:var(--rust); }
.pill.suspended{ background:rgba(120,120,120,.16); color:#555; }

/* ---- data tables (used by both admin panel and customer-facing
   pages like order history) ---- */
.admin-table{ width:100%; border-collapse:collapse; }
.admin-table th{
  text-align:left;
  font-size:11.5px;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:var(--charcoal-60);
  padding:0 12px 10px;
  border-bottom:2px solid var(--cream-dim);
}
.admin-table td{
  padding:12px;
  border-bottom:1px solid var(--cream-dim);
  font-size:13.5px;
  vertical-align:middle;
}
.admin-table tr:last-child td{ border-bottom:none; }
.admin-table input[type="number"],
.admin-table input[type="text"]{
  width:90px;
  padding:7px 9px;
  border:1.5px solid #E3DCC9;
  border-radius:7px;
  font-family:var(--font-mono);
  font-size:13px;
}
.admin-table select{
  padding:7px 9px;
  border:1.5px solid #E3DCC9;
  border-radius:7px;
  font-size:13px;
  background:var(--white);
}
@media (max-width:760px){
  .admin-table{ font-size:12.5px; }
}

.inline-form{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
  gap:14px;
  align-items:end;
}
.inline-form .field{ margin-bottom:0; }

.btn-icon-sm{
  background:none;
  border:1.5px solid #E3DCC9;
  border-radius:7px;
  padding:6px 10px;
  cursor:pointer;
  font-size:12.5px;
  font-weight:600;
  color:var(--charcoal);
  text-decoration:none;
  display:inline-block;
}
.btn-icon-sm:hover{ border-color:var(--green-bright); }
.btn-icon-sm.danger{ color:var(--rust); border-color:rgba(198,84,29,.3); }
.btn-icon-sm.danger:hover{ border-color:var(--rust); }

/* ---- tabs (used on the seller registration form) ---- */
.admin-tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:28px;
  border-bottom:1px solid #E3DCC9;
  padding-bottom:0;
}
.admin-tab-btn{
  background:none;
  border:none;
  padding:12px 18px;
  font-size:14.5px;
  font-weight:700;
  color:var(--charcoal-60);
  cursor:pointer;
  border-bottom:3px solid transparent;
  margin-bottom:-1px;
}
.admin-tab-btn:hover{ color:var(--charcoal); }
.admin-tab-btn.active{ color:var(--green-shade); border-bottom-color:var(--green-deep); }
.admin-tab-btn.has-error{ color:var(--rust); }
.admin-panel{ display:none; }
.admin-panel.active{ display:block; }

/* ---- split auth layout (seller login/register) — a wider, less
   "slim" presentation than a lone centered card on a big empty page ---- */
.auth-split{
  display:grid;
  grid-template-columns: 1fr 1.15fr;
  gap:44px;
  align-items:start;
  max-width:980px;
  margin:0 auto;
}
.auth-side{
  background:linear-gradient(160deg, var(--green-deep), var(--green-shade));
  color:#fff;
  padding:44px;
  border-radius:20px;
  order:1;
}
.auth-side h2{ font-size:26px; font-weight:800; line-height:1.3; margin-bottom:18px; }
.auth-side p{ color:rgba(255,255,255,.8); font-size:14.5px; margin-bottom:22px; }
.auth-side ul{ list-style:none; padding:0; margin:0; }
.auth-side li{ display:flex; gap:12px; align-items:flex-start; margin-bottom:16px; font-size:14.5px; }
.auth-side li i{ color:var(--amber); margin-top:3px; }
.auth-form-col{ order:2; }
.auth-form-col .form-panel{ width:100%; max-width:none; }

@media (max-width: 860px){
  .auth-split{ grid-template-columns:1fr; max-width:520px; }
  .auth-side{ order:2; padding:32px; }
  .auth-form-col{ order:1; }
}
.pill.low{ background:rgba(198,84,29,.14); color:var(--rust); }
.pill.ok{ background:rgba(20,164,77,.14); color:var(--green-shade); }
.product-card .body{
  padding:18px 18px 20px;
  display:flex;
  flex-direction:column;
  gap:10px;
  flex:1;
}
.product-card .category{
  font-family:var(--font-mono);
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--green-bright);
}
.product-card h3{ font-size:16.5px; font-weight:700; }
.product-card .row{
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

/* ---- signature element: torn market price-tag sticker ---- */
.price-tag{
  position:absolute;
  top:12px;
  right:-6px;
  background:var(--green-deep);
  color:var(--white);
  font-family:var(--font-mono);
  font-weight:700;
  font-size:14px;
  padding:7px 14px 7px 12px;
  transform:rotate(3deg);
  box-shadow:0 6px 14px rgba(0,0,0,.18);
  clip-path:polygon(
    0% 15%, 8% 0%, 16% 15%, 24% 0%, 32% 15%, 40% 0%, 48% 15%, 56% 0%,
    64% 15%, 72% 0%, 80% 15%, 88% 0%, 96% 15%, 100% 0%,
    100% 100%, 0% 100%
  );
}
.price-tag::after{
  content:"";
  position:absolute;
  left:-4px; top:50%;
  width:8px; height:8px;
  background:var(--cream);
  border-radius:50%;
  transform:translateY(-50%);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);
}
.price-tag.sale{ background:var(--rust); }

/* ============================================================
   FORMS
   ============================================================ */
.form-panel{
  background:var(--white);
  border-radius:var(--radius);
  box-shadow:var(--shadow-sm);
  padding:38px;
}
.field{ margin-bottom:18px; }
.field label{
  display:block;
  font-size:13.5px;
  font-weight:600;
  margin-bottom:7px;
  color:var(--charcoal);
}
.field input,
.field select,
.field textarea{
  width:100%;
  padding:13px 15px;
  border:1.5px solid #E3DCC9;
  border-radius:10px;
  background:var(--cream);
  font-family:var(--font-body);
  font-size:16px; /* 16px+ stops iOS Safari auto-zooming the page on focus */
  color:var(--charcoal);
  transition:border-color .15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus{
  outline:none;
  border-color:var(--green-bright);
}
.field textarea{ resize:vertical; min-height:110px; }
.field .hint{ font-size:12.5px; color:var(--charcoal-60); margin-top:6px; }
.field .error{ font-size:12.5px; color:var(--rust); margin-top:6px; display:none; }
.field.has-error input{ border-color:var(--rust); }
.field.has-error .error{ display:block; }

.form-note{
  text-align:center;
  margin-top:20px;
  font-size:14px;
  color:var(--charcoal-60);
}
.form-note a{ color:var(--green-shade); font-weight:700; text-decoration:none; }
.form-note a:hover{ text-decoration:underline; }

/* ============================================================
   BREADCRUMB / PAGE HERO (inner pages)
   ============================================================ */
.page-hero{
  background:var(--green-deep);
  color:var(--white);
  padding:56px 0 46px;
}
.page-hero .eyebrow{ background:rgba(255,255,255,.14); color:var(--cream); }
.page-hero .eyebrow::before{ background:var(--amber); }
.page-hero h1{ color:var(--white); font-size:38px; font-weight:800; }
.page-hero p{ color:rgba(255,255,255,.78); margin-top:10px; max-width:520px; }

/* ============================================================
   ALERTS / EMPTY STATES / TOASTS
   ============================================================ */
.empty-state{
  text-align:center;
  padding:70px 20px;
  color:var(--charcoal-60);
}
.empty-state h3{ color:var(--charcoal); margin-bottom:8px; }
.empty-state .btn{ margin-top:20px; }

.toast{
  position:fixed;
  bottom:26px; left:50%;
  transform:translateX(-50%) translateY(20px);
  background:var(--charcoal);
  color:var(--white);
  padding:14px 22px;
  border-radius:10px;
  font-size:14px;
  font-weight:600;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
  z-index:1000;
  display:flex; align-items:center; gap:10px;
}
.toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
  pointer-events:auto;
}
.toast::before{ content:"✓"; color:var(--amber); font-weight:800; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer{
  background:var(--charcoal);
  color:rgba(255,255,255,.78);
  padding:56px 0 26px;
  margin-top:80px;
}
.footer-grid{
  display:grid;
  grid-template-columns:1.4fr 1fr 1fr 1.2fr;
  gap:34px;
  padding-bottom:36px;
  border-bottom:1px solid rgba(255,255,255,.12);
}
.footer-grid h4{
  color:var(--white);
  font-size:14px;
  letter-spacing:.06em;
  text-transform:uppercase;
  margin-bottom:16px;
}
.footer-grid .logo{ color:var(--white); margin-bottom:12px; }
.footer-grid p{ font-size:14px; line-height:1.7; }
.footer-grid ul{ list-style:none; }
.footer-grid li{ margin-bottom:10px; }
.footer-grid a{ text-decoration:none; font-size:14px; color:rgba(255,255,255,.78); }
.footer-grid a:hover{ color:var(--amber); }
.footer-bottom{
  padding-top:22px;
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px;
  font-size:13px;
  color:rgba(255,255,255,.5);
}

@media (max-width:760px){
  .footer-grid{ grid-template-columns:1fr 1fr; }
}
@media (max-width:480px){
  .footer-grid{ grid-template-columns:1fr; }
  .page-hero h1{ font-size:30px; }
  .section-head h2{ font-size:27px; }
}

/* ============================================================
   CHATBOT WIDGET
   ============================================================ */
#bumi-chat-widget{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:900;
  font-family:var(--font-body);
}
.chat-fab{
  width:58px; height:58px;
  border-radius:50%;
  background:var(--green-deep);
  color:var(--white);
  border:none;
  font-size:24px;
  cursor:pointer;
  box-shadow:0 12px 28px rgba(11,110,54,.35);
  transition:transform .15s ease, opacity .15s ease;
}
.chat-fab:hover{ transform:scale(1.06); }
.chat-fab.hidden{ opacity:0; pointer-events:none; transform:scale(.8); }

.chat-panel{
  position:absolute;
  right:0; bottom:74px;
  width:320px;
  max-width:calc(100vw - 44px);
  background:var(--white);
  border-radius:16px;
  box-shadow:0 20px 50px rgba(0,0,0,.22);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  opacity:0;
  transform:translateY(12px) scale(.98);
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
}
.chat-panel.open{
  opacity:1;
  transform:translateY(0) scale(1);
  pointer-events:auto;
}
.chat-panel-header{
  background:var(--green-deep);
  color:var(--white);
  padding:16px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.chat-panel-header strong{ font-family:var(--font-display); font-size:15px; }
.chat-panel-sub{ font-size:12px; color:rgba(255,255,255,.75); margin-top:2px; }
.chat-panel-header button{
  background:rgba(255,255,255,.15);
  border:none;
  color:var(--white);
  width:26px; height:26px;
  border-radius:50%;
  cursor:pointer;
  font-size:12px;
}
.chat-log{
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height:280px;
  min-height:120px;
  overflow-y:auto;
  background:var(--cream);
}
.chat-bubble{
  max-width:85%;
  padding:10px 14px;
  border-radius:14px;
  font-size:13.5px;
  line-height:1.5;
}
.chat-bubble.bot{
  background:var(--white);
  color:var(--charcoal);
  align-self:flex-start;
  box-shadow:var(--shadow-sm);
  border-bottom-left-radius:4px;
}
.chat-bubble.user{
  background:var(--green-deep);
  color:var(--white);
  align-self:flex-end;
  border-bottom-right-radius:4px;
}
.chat-quick{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:0 16px 12px;
  background:var(--cream);
}
.chat-quick-btn{
  border:1.5px solid #E3DCC9;
  background:var(--white);
  border-radius:999px;
  padding:7px 12px;
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  color:var(--charcoal);
}
.chat-quick-btn:hover{ border-color:var(--green-bright); }
.chat-input-row{
  display:flex;
  border-top:1px solid var(--cream-dim);
  padding:10px;
  gap:8px;
  background:var(--white);
}
.chat-input-row input{
  flex:1;
  border:1.5px solid #E3DCC9;
  border-radius:999px;
  padding:9px 14px;
  font-size:13.5px;
  background:var(--cream);
}
.chat-input-row input:focus{ outline:none; border-color:var(--green-bright); }
.chat-input-row button{
  width:38px; height:38px;
  border-radius:50%;
  border:none;
  background:var(--green-deep);
  color:var(--white);
  cursor:pointer;
  font-size:15px;
}

@media (max-width:480px){
  .chat-panel{ width:calc(100vw - 44px); }
}
