/* =========================================================
   SAGALA AYA STORE — NAVY + TEAL MARKETPLACE
   Storefront + admin legacy styles
   ========================================================= */

:root {
  --navy: #1B2560;
  --navy-2: #101846;
  --navy-3: #2B3778;
  --teal: #1EAFA0;
  --teal-dark: #118F84;
  --teal-soft: #E7F8F5;
  --ink: #182033;
  --muted: #6D7485;
  --paper: #F6F8FB;
  --card: #FFFFFF;
  --line: #E5E9F1;
  --line-strong: #D6DBE7;
  --warning: #F59E0B;
  --danger: #DC2626;
  --success: #159669;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 4px 16px rgba(27, 37, 96, 0.06);
  --shadow-md: 0 14px 38px rgba(27, 37, 96, 0.12);

  /* admin compatibility */
  --green: var(--teal);
  --green-dark: var(--teal-dark);
  --green-light: var(--teal-soft);
  --accent: #F59E0B;
  --accent-dark: #D97706;
  --adm-sidebar: #18223D;
  --adm-sidebar-active: #28375D;
  --adm-sidebar-text: #BFC8DC;
  --adm-topbar: #4F83C4;
  --adm-topbar-dark: #3E6DA9;
  --adm-bg: #F3F5F9;
  --adm-line: #E4E8F0;
  --badge-success: #1C8A57;
  --badge-warning: #D99A1F;
  --badge-danger: #C63B36;
  --badge-info: #4F83C4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.drawer-open { overflow: hidden; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.container {
  width: min(1220px, calc(100% - 40px));
  margin-inline: auto;
}

/* =========================================================
   MARKETPLACE HEADER
   ========================================================= */
.market-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.market-header-main {
  min-height: 76px;
  display: grid;
  grid-template-columns: 180px minmax(280px, 1fr) auto;
  align-items: center;
  gap: 22px;
}
.market-brand { display: inline-flex; align-items: center; text-decoration: none; }
.market-logo {
  width: 166px;
  height: 56px;
  object-fit: contain;
  object-position: left center;
  display: block;
}
.market-search {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  height: 46px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.market-search:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(30,175,160,.12);
}
.search-icon { text-align: center; color: var(--muted); font-size: 1.35rem; transform: rotate(-20deg); }
.market-search input {
  width: 100%;
  border: 0;
  outline: 0;
  min-width: 0;
  padding: 0 8px 0 0;
  background: transparent;
  color: var(--ink);
}
.market-search input::placeholder { color: #9AA2B2; }
.market-search button {
  height: 100%;
  border: 0;
  padding: 0 22px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}
.market-search button:hover { background: var(--navy-3); }
.market-actions { display: flex; align-items: center; gap: 8px; }
.header-icon-btn {
  min-height: 44px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
}
.header-icon-btn:hover { background: #F1F4FA; }
.header-icon { font-size: 1.12rem; }
.header-action-text { font-size: .84rem; }
.cart-count {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: .68rem;
  line-height: 1;
}
.market-subnav { background: var(--navy); color: #fff; }
.market-subnav-inner {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 25px;
  overflow-x: auto;
  scrollbar-width: none;
}
.market-subnav-inner::-webkit-scrollbar { display: none; }
.market-subnav a {
  flex: 0 0 auto;
  color: #fff;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 600;
  opacity: .9;
}
.market-subnav a:hover { opacity: 1; color: #8CE0D7; }
.subnav-spacer { flex: 1; }
.subnav-note { flex: 0 0 auto; color: #D6DAEC; font-size: .75rem; }

/* =========================================================
   HERO
   ========================================================= */
.hero-market {
  padding: 38px 0 26px;
  background:
    radial-gradient(circle at 85% 20%, rgba(30,175,160,.18), transparent 30%),
    linear-gradient(180deg, #FFFFFF 0%, #F6F8FB 100%);
}
.hero-market-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 44px;
  align-items: center;
  min-height: 420px;
}
.hero-copy { padding: 16px 0; }
.hero-kicker, .section-eyebrow {
  display: block;
  color: var(--teal-dark);
  font-size: .72rem;
  letter-spacing: .13em;
  font-weight: 800;
  margin-bottom: 8px;
}
.hero-copy h1,
.section-heading-row h2,
.page-hero h1,
.product-detail-info h1 {
  font-family: "Fraunces", Georgia, serif;
  color: var(--navy);
}
.hero-copy h1 {
  margin: 0;
  max-width: 680px;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: .98;
  letter-spacing: -.035em;
}
.hero-copy > p {
  max-width: 660px;
  margin: 22px 0 0;
  color: #555D70;
  font-size: 1.03rem;
  line-height: 1.75;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn-market {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 800;
  font-size: .88rem;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn-market:hover { transform: translateY(-1px); }
.btn-market-primary { background: var(--teal); color: #fff; }
.btn-market-primary:hover { background: var(--teal-dark); }
.btn-market-secondary { background: #fff; color: var(--navy); border-color: var(--line-strong); }
.btn-market-secondary:hover { border-color: #AEB7CB; background: #FAFBFE; }
.btn-full { width: 100%; }
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 22px;
  color: #667087;
  font-size: .78rem;
  font-weight: 600;
}
.hero-visual { position: relative; min-height: 360px; display: grid; place-items: center; }
.hero-logo-card {
  width: min(480px, 92%);
  padding: 34px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-md);
  transform: rotate(1deg);
}
.hero-logo-card img { width: 100%; display: block; }
.hero-mini-card {
  position: absolute;
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 178px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-sm);
}
.hero-mini-card strong, .hero-mini-card small { display: block; }
.hero-mini-card strong { color: var(--navy); font-size: .82rem; }
.hero-mini-card small { color: var(--muted); font-size: .67rem; margin-top: 2px; }
.mini-icon { width: 34px; height: 34px; display: grid; place-items: center; background: var(--teal-soft); border-radius: 9px; }
.hero-mini-one { left: 0; bottom: 44px; }
.hero-mini-two { right: 0; top: 44px; }

/* =========================================================
   SECTIONS
   ========================================================= */
.section-market { padding: 50px 0; }
.section-compact { padding-top: 32px; padding-bottom: 22px; }
.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.section-heading-row h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.35rem); line-height: 1.1; }
.section-heading-row p { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
.section-note { color: var(--muted); font-size: .75rem; }
.text-link { color: var(--navy); text-decoration: none; font-weight: 800; font-size: .84rem; }
.text-link:hover { color: var(--teal-dark); }

/* categories */
.category-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
}
.category-chip {
  min-width: 122px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 700;
  transition: .16s ease;
}
.category-chip:hover, .category-chip.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--navy);
}
.category-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #F4F6FA; font-size: 1rem; }
.category-chip.active .category-icon { background: #fff; }
.category-skeleton { width: 130px; height: 54px; flex: 0 0 auto; border-radius: 12px; background: linear-gradient(90deg,#EEF1F6,#F8FAFC,#EEF1F6); background-size: 200% 100%; animation: shimmer 1.3s infinite; }

/* =========================================================
   PRODUCT GRID / CARDS
   ========================================================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 15px;
}
.product-grid-featured { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.market-product-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.market-product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #CDD3E0; }
.product-image-link { display: block; text-decoration: none; }
.market-product-image {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid #F0F2F6;
}
.market-product-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  transition: transform .2s ease;
}
.market-product-card:hover .market-product-image img:not(.fallback-logo) { transform: scale(1.025); }
.market-product-image img.fallback-logo { padding: 18%; object-fit: contain; opacity: .72; }
.product-badge {
  position: absolute;
  z-index: 2;
  top: 9px;
  left: 9px;
  padding: 5px 8px;
  border-radius: 7px;
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  box-shadow: 0 3px 9px rgba(0,0,0,.08);
}
.badge-new { background: var(--navy); }
.badge-low { background: var(--warning); }
.badge-out { background: #7C8391; }
.market-product-body { display: flex; flex-direction: column; flex: 1; padding: 12px; }
.market-product-category {
  color: var(--teal-dark);
  font-size: .66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .045em;
  margin-bottom: 5px;
}
.market-product-name {
  color: var(--ink);
  text-decoration: none;
  font-size: .9rem;
  line-height: 1.35;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.45em;
}
.market-product-name:hover { color: var(--navy); }
.market-product-desc {
  flex: 1;
  margin: 7px 0 10px;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.1em;
}
.market-product-price { color: var(--navy); font-size: 1rem; font-weight: 800; }
.market-product-meta { display: flex; justify-content: space-between; gap: 8px; margin: 5px 0 9px; color: #8B92A2; font-size: .65rem; }
.market-product-meta a { color: var(--teal-dark); font-weight: 700; text-decoration: none; }
.quick-cart-btn {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--teal);
  border-radius: 9px;
  background: #fff;
  color: var(--teal-dark);
  font-size: .76rem;
  font-weight: 800;
  transition: .15s ease;
}
.quick-cart-btn:hover:not(:disabled), .quick-cart-btn.added { background: var(--teal); color: #fff; }
.quick-cart-btn:disabled { cursor: not-allowed; border-color: #D8DCE5; color: #A1A7B3; background: #F5F6F8; }

/* skeletons */
.product-skeleton {
  min-height: 310px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(#fff,#fff) padding-box,
    linear-gradient(90deg,#EEF1F6,#F8FAFC,#EEF1F6) border-box;
  position: relative;
  overflow: hidden;
}
.product-skeleton::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.72) 45%, transparent 75%);
  transform: translateX(-100%);
  animation: skeletonMove 1.35s infinite;
}
@keyframes skeletonMove { to { transform: translateX(100%); } }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* trust */
.trust-section { padding: 12px 0 24px; }
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 22px;
  background: var(--navy);
  border-radius: 18px;
  color: #fff;
}
.trust-card { display: flex; gap: 12px; align-items: flex-start; padding: 6px 10px; }
.trust-icon { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.1); }
.trust-card h3 { margin: 0; font-size: .86rem; color: #fff; }
.trust-card p { margin: 4px 0 0; color: #DDE2F2; font-size: .7rem; line-height: 1.5; }

/* catalog controls */
.all-products-section { padding-bottom: 70px; }
.products-heading { align-items: center; }
.catalog-controls { display: flex; gap: 8px; }
.catalog-controls select {
  min-height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: .78rem;
  outline: 0;
}
.catalog-controls select:focus { border-color: var(--teal); }
.catalog-empty, .catalog-error {
  grid-column: 1 / -1;
  padding: 50px 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
}
.catalog-empty.compact { padding: 25px; }
.catalog-empty h3 { margin: 8px 0 4px; color: var(--navy); }
.catalog-empty p { margin: 0 0 16px; }
.empty-icon { font-size: 2rem; }
.catalog-error { display: flex; flex-direction: column; gap: 5px; }
.catalog-error strong { color: var(--navy); }
.load-more-wrap { display: flex; justify-content: center; padding-top: 24px; }

/* =========================================================
   FOOTER
   ========================================================= */
.market-footer { background: var(--navy-2); color: #D9DEEE; padding: 48px 0 18px; }
.market-footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 34px; }
.footer-logo-img { width: 190px; height: 70px; object-fit: contain; object-position: left center; background: #fff; border-radius: 10px; padding: 5px 8px; }
.footer-brand-col p { max-width: 340px; color: #B9C1D6; font-size: .8rem; line-height: 1.7; }
.market-footer h3 { margin: 4px 0 13px; font-size: .82rem; color: #fff; }
.market-footer a, .market-footer span { display: block; margin: 8px 0; color: #B9C1D6; text-decoration: none; font-size: .75rem; line-height: 1.5; }
.market-footer a:hover { color: #77D9CF; }
.footer-bottom { margin-top: 34px; padding-top: 16px; display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid rgba(255,255,255,.1); }
.footer-bottom span { margin: 0; }

/* =========================================================
   CART DRAWER / TOAST
   ========================================================= */
.drawer-backdrop { position: fixed; inset: 0; z-index: 120; background: rgba(9,14,37,.42); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 130;
  width: min(420px, 94vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -16px 0 45px rgba(14,21,59,.18);
  transform: translateX(102%);
  transition: transform .22s ease;
}
.cart-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 0; font-family: "Fraunces",serif; color: var(--navy); font-size: 1.45rem; }
.drawer-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #F1F3F7; color: var(--navy); font-size: 1.4rem; }
.drawer-items { flex: 1; overflow-y: auto; padding: 12px 20px; }
.drawer-item { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.drawer-item-img { width: 72px; height: 72px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.drawer-product-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.drawer-item-info { min-width: 0; }
.drawer-item-info > a { display: block; color: var(--ink); text-decoration: none; font-size: .8rem; line-height: 1.35; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-item-info > strong { display: block; color: var(--navy); margin-top: 4px; font-size: .82rem; }
.drawer-qty-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.drawer-qty-row button { min-width: 26px; height: 26px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--navy); }
.drawer-qty-row button:disabled { opacity: .4; }
.drawer-qty-row span { min-width: 22px; text-align: center; font-size: .73rem; font-weight: 700; }
.drawer-qty-row .drawer-remove { width: auto; margin-left: auto; padding: 0 6px; border-color: transparent; color: var(--danger); font-size: .67rem; }
.drawer-footer { padding: 18px 20px 22px; border-top: 1px solid var(--line); background: #FAFBFD; }
.drawer-total { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer-total span { color: var(--muted); font-size: .8rem; }
.drawer-total strong { color: var(--navy); font-size: 1.02rem; }
.drawer-footer .btn-market + .btn-market { margin-top: 8px; }
.drawer-empty { padding: 55px 10px; text-align: center; color: var(--muted); }
.drawer-empty > span { font-size: 2rem; }
.drawer-empty h3 { color: var(--navy); margin: 8px 0 4px; }
.drawer-empty p { margin: 0; font-size: .78rem; }
.drawer-loading { padding: 35px 0; text-align: center; color: var(--muted); font-size: .8rem; }
.market-toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 14px; border-radius: 10px; background: var(--navy-2); color: #fff; box-shadow: var(--shadow-md); font-size: .78rem; font-weight: 700; transition: .18s ease; }
.market-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   COMMON INNER PAGES
   ========================================================= */
.simple-market-header { background: #fff; border-bottom: 1px solid var(--line); }
.simple-market-header .container { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.inner-logo { width: 170px; height: 54px; object-fit: contain; object-position: left center; }
.inner-nav { display: flex; align-items: center; gap: 10px; }
.inner-nav a { text-decoration: none; color: var(--navy); font-size: .8rem; font-weight: 700; }
.page-shell { padding: 34px 0 70px; min-height: 68vh; }
.page-hero { margin-bottom: 22px; }
.page-hero h1 { margin: 0; font-size: clamp(2rem,4vw,3rem); }
.page-hero p { margin: 7px 0 0; color: var(--muted); }
.back-link { display: inline-flex; margin-bottom: 12px; color: var(--teal-dark); text-decoration: none; font-size: .78rem; font-weight: 800; }

/* detail */
.product-detail-layout { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: 36px; align-items: start; }
.product-detail-gallery { position: sticky; top: 130px; }
.product-detail-image { aspect-ratio: 1/1; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.product-detail-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product-detail-info { padding: 8px 0; }
.detail-category { color: var(--teal-dark); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.product-detail-info h1 { margin: 8px 0; font-size: clamp(2rem,4vw,3.3rem); line-height: 1.06; }
.detail-price { color: var(--navy); font-size: 1.8rem; font-weight: 800; margin: 12px 0; }
.detail-stock { display: inline-flex; padding: 6px 10px; border-radius: 8px; background: var(--teal-soft); color: var(--teal-dark); font-size: .75rem; font-weight: 800; }
.detail-stock.out { background: #F1F2F4; color: #737A89; }
.detail-description { margin: 22px 0; padding-top: 20px; border-top: 1px solid var(--line); color: #596174; line-height: 1.75; }
.qty-picker { display: inline-flex; align-items: center; gap: 9px; padding: 5px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; }
.qty-picker button { width: 34px; height: 34px; border: 0; border-radius: 8px; background: #F2F4F8; color: var(--navy); font-size: 1.1rem; }
.qty-picker input { width: 44px; border: 0; outline: 0; text-align: center; font-weight: 800; }
.detail-buy-row { display: flex; gap: 10px; align-items: stretch; margin-top: 14px; }
.detail-buy-row .btn-market { min-height: 48px; }
.detail-trust { margin-top: 24px; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.detail-trust div { padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font-size: .7rem; }

/* cart */
.cart-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 24px; align-items: start; }
.cart-list-card, .cart-summary-card, .checkout-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); }
.cart-list-card { overflow: hidden; }
.cart-line-item { display: grid; grid-template-columns: 92px 1fr auto; gap: 14px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.cart-line-item:last-child { border-bottom: 0; }
.cart-line-image { width: 92px; height: 92px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.cart-line-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cart-line-info h3 { margin: 0; font-size: .9rem; }
.cart-line-info h3 a { color: var(--ink); text-decoration: none; }
.cart-line-info .category { margin-top: 3px; color: var(--muted); font-size: .68rem; }
.cart-line-info .price { margin-top: 8px; color: var(--navy); font-size: .92rem; font-weight: 800; }
.cart-line-actions { display: flex; flex-direction: column; align-items: end; gap: 9px; }
.cart-qty { display: flex; align-items: center; gap: 7px; }
.cart-qty button { width: 28px; height: 28px; border: 1px solid var(--line-strong); background: #fff; border-radius: 7px; color: var(--navy); }
.cart-qty button:disabled { opacity: .4; }
.cart-qty span { min-width: 24px; text-align: center; font-weight: 800; font-size: .75rem; }
.cart-remove { border: 0; background: transparent; color: var(--danger); font-size: .7rem; }
.cart-line-subtotal { color: var(--navy); font-size: .8rem; font-weight: 800; }
.cart-summary-card { position: sticky; top: 130px; padding: 20px; }
.cart-summary-card h2, .checkout-card h2 { margin: 0 0 16px; font-family: "Fraunces",serif; color: var(--navy); }
.summary-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; color: var(--muted); font-size: .78rem; }
.summary-line.total { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--navy); font-size: 1rem; font-weight: 800; }
.summary-help { margin: 12px 0 16px; color: var(--muted); font-size: .69rem; line-height: 1.5; }
.cart-empty-page { padding: 70px 20px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.cart-empty-page .icon { font-size: 2.6rem; }
.cart-empty-page h2 { font-family: "Fraunces",serif; color: var(--navy); margin: 10px 0 5px; }
.cart-empty-page p { color: var(--muted); }

/* checkout */
.checkout-layout-new { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 24px; align-items: start; }
.checkout-card { padding: 22px; margin-bottom: 14px; }
.checkout-card h2 { font-size: 1.35rem; }
.checkout-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-group { margin-bottom: 14px; }
.field-group label { display: block; margin: 0 0 6px; color: #42495A; font-size: .75rem; font-weight: 800; }
.field-group input, .field-group textarea, .field-group select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: 0;
}
.field-group textarea { min-height: 90px; resize: vertical; }
.field-group input:focus, .field-group textarea:focus, .field-group select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(30,175,160,.09); }
.option-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.option-card { position: relative; }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card label { min-height: 76px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 11px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--ink); font-size: .72rem; cursor: pointer; }
.option-card label strong { color: var(--navy); }
.option-card input:checked + label { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 0 0 2px rgba(30,175,160,.08); }
.checkout-summary-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.checkout-mini-item { display: grid; grid-template-columns: 46px 1fr auto; gap: 8px; align-items: center; }
.checkout-mini-img { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.checkout-mini-img img { width: 100%; height: 100%; object-fit: contain; }
.checkout-mini-name { min-width: 0; font-size: .72rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.checkout-mini-meta { color: var(--muted); font-size: .63rem; }
.checkout-mini-price { color: var(--navy); font-size: .7rem; font-weight: 800; }
.checkout-success { padding: 22px; border-radius: 14px; background: var(--teal-soft); color: var(--navy); }

/* =========================================================
   RESPONSIVE STOREFRONT
   ========================================================= */
@media (max-width: 1180px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .product-grid-featured { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (max-width: 930px) {
  .market-header-main { grid-template-columns: 150px 1fr auto; gap: 12px; }
  .market-logo { width: 145px; }
  .header-action-text { display: none; }
  .hero-market-grid { grid-template-columns: 1fr; gap: 16px; }
  .hero-visual { min-height: 300px; }
  .hero-logo-card { width: min(520px,85%); }
  .product-grid, .product-grid-featured { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .trust-grid { grid-template-columns: 1fr; gap: 6px; }
  .market-footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .market-footer-grid > div:last-child { grid-column: 2 / 4; }
  .cart-layout, .checkout-layout-new { grid-template-columns: 1fr; }
  .cart-summary-card { position: static; }
}
@media (max-width: 700px) {
  .container { width: min(100% - 20px, 1220px); }
  .market-header { position: relative; }
  .market-header-main {
    min-height: auto;
    padding: 8px 0 10px;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .market-brand { grid-column: 1; }
  .market-logo { width: 130px; height: 42px; }
  .market-actions { grid-column: 2; }
  .header-icon-btn { padding: 6px 7px; min-height: 38px; }
  .market-search { grid-column: 1 / -1; grid-row: 2; height: 42px; }
  .market-search button { padding: 0 14px; font-size: .76rem; }
  .market-subnav-inner { min-height: 34px; gap: 18px; }
  .market-subnav a { font-size: .7rem; }
  .subnav-note, .subnav-spacer { display: none; }

  .hero-market { padding: 22px 0 14px; }
  .hero-market-grid { min-height: auto; }
  .hero-copy { padding: 4px 0; }
  .hero-copy h1 { font-size: clamp(2.15rem,11vw,3.2rem); }
  .hero-copy > p { margin-top: 14px; font-size: .86rem; line-height: 1.6; }
  .hero-actions { margin-top: 18px; }
  .btn-market { min-height: 40px; padding: 8px 13px; font-size: .76rem; }
  .hero-points { gap: 8px 12px; margin-top: 14px; font-size: .68rem; }
  .hero-visual { min-height: 210px; }
  .hero-logo-card { width: 86%; padding: 18px; border-radius: 18px; }
  .hero-mini-card { min-width: 140px; padding: 8px; }
  .hero-mini-card strong { font-size: .7rem; }
  .hero-mini-card small { font-size: .58rem; }
  .hero-mini-one { bottom: 10px; left: 2px; }
  .hero-mini-two { top: 5px; right: 2px; }

  .section-market { padding: 30px 0; }
  .section-compact { padding: 24px 0 12px; }
  .section-heading-row { align-items: flex-start; margin-bottom: 13px; }
  .section-heading-row h2 { font-size: 1.65rem; }
  .section-heading-row p, .section-note, .text-link { font-size: .7rem; }
  .section-note { display: none; }
  .category-chip { min-width: 102px; padding: 8px 10px; font-size: .67rem; }
  .category-icon { width: 27px; height: 27px; }

  /* 2 columns on phone — user preference */
  .product-grid, .product-grid-featured {
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
  }
  .market-product-card { border-radius: 10px; }
  .market-product-body { padding: 8px; }
  .market-product-category { font-size: .56rem; margin-bottom: 3px; }
  .market-product-name { font-size: .72rem; min-height: 2.35em; }
  .market-product-desc { font-size: .6rem; line-height: 1.35; margin: 5px 0 7px; -webkit-line-clamp: 1; min-height: 1.35em; }
  .market-product-price { font-size: .84rem; }
  .market-product-meta { font-size: .56rem; margin: 3px 0 6px; }
  .quick-cart-btn { min-height: 31px; font-size: .65rem; border-radius: 7px; }
  .product-badge { top: 6px; left: 6px; padding: 3px 6px; font-size: .52rem; }
  .product-skeleton { min-height: 245px; }

  .trust-grid { padding: 14px; border-radius: 14px; }
  .trust-card { padding: 5px; }
  .trust-card h3 { font-size: .74rem; }
  .trust-card p { font-size: .62rem; }
  .trust-icon { width: 35px; height: 35px; }

  .products-heading { display: block; }
  .catalog-controls { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; }
  .catalog-controls select { min-width: 0; width: 100%; padding-left: 8px; font-size: .68rem; }

  .market-footer { padding-top: 34px; }
  .market-footer-grid { grid-template-columns: 1fr 1fr; gap: 25px 18px; }
  .footer-brand-col { grid-column: 1 / -1; }
  .market-footer-grid > div:last-child { grid-column: auto; }
  .footer-logo-img { width: 170px; }
  .footer-bottom { flex-direction: column; gap: 0; }

  .simple-market-header .container { min-height: 62px; }
  .inner-logo { width: 140px; height: 44px; }
  .inner-nav a { font-size: .7rem; }
  .page-shell { padding: 24px 0 50px; }
  .product-detail-layout { grid-template-columns: 1fr; gap: 18px; }
  .product-detail-gallery { position: static; }
  .product-detail-info h1 { font-size: 2rem; }
  .detail-price { font-size: 1.4rem; }
  .detail-trust { grid-template-columns: 1fr; }
  .cart-line-item { grid-template-columns: 72px 1fr; align-items: start; }
  .cart-line-image { width: 72px; height: 72px; }
  .cart-line-actions { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
  .checkout-form-grid { grid-template-columns: 1fr; gap: 0; }
  .option-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   ADMIN SHARED / LEGACY COMPATIBILITY
   ========================================================= */
.admin-shell { min-height: 100vh; background: var(--adm-bg); font-family: "Inter","Segoe UI",Arial,sans-serif; }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 250px; flex-shrink: 0; background: var(--adm-sidebar); color: var(--adm-sidebar-text); display: flex; flex-direction: column; }
.sidebar-brand { padding: 22px 22px 18px; font-size: 1.15rem; font-weight: 800; color: #fff; letter-spacing: .4px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand span { color: #78CFC7; }
.sidebar-profile { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--adm-topbar); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.sidebar-profile-name { font-size: .82rem; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 145px; }
.sidebar-profile-status { font-size: .7rem; color: #71D49A; display: flex; align-items: center; gap: 5px; }
.sidebar-profile-status::before { content:""; width: 7px; height: 7px; border-radius: 50%; background: #71D49A; }
.sidebar-nav { flex: 1; padding: 10px 0; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 22px; color: var(--adm-sidebar-text); text-decoration: none; font-size: .86rem; border-left: 3px solid transparent; }
.sidebar-nav a:hover { background: rgba(255,255,255,.04); color: #fff; }
.sidebar-nav a.active { background: var(--adm-sidebar-active); color: #fff; border-left-color: #69CEC3; }
.sidebar-nav a .ico { width: 18px; text-align: center; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { min-height: 58px; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; background: var(--adm-topbar); color: #fff; }
.admin-topbar .topbar-title { font-weight: 700; }
.admin-topbar .topbar-right { display: flex; align-items: center; gap: 16px; font-size: .8rem; }
.admin-topbar a { padding: 6px 12px; color: #fff; text-decoration: none; border-radius: 6px; background: rgba(0,0,0,.15); }
.admin-content { flex: 1; padding: 26px 28px 50px; }
.admin-breadcrumb { color: #8C93A4; font-size: .78rem; margin-bottom: 4px; }
.admin-content .page-title { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 4px 0 20px; }
.admin-content .page-title h2 { margin: 0; font-size: 1.2rem; color: #1F2937; }
.admin-table-wrap { overflow: hidden; background: #fff; border: 1px solid var(--adm-line); border-radius: 10px; box-shadow: 0 1px 4px rgba(27,36,56,.05); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--adm-line); font-size: .82rem; text-align: left; vertical-align: middle; }
.admin-table th { background: #F7F9FC; color: #6B7690; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: #F2F4F8; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; color: #fff; font-size: .68rem; font-weight: 700; }
.badge-success { background: var(--badge-success); }
.badge-warning { background: var(--badge-warning); }
.badge-danger { background: var(--badge-danger); }
.badge-info { background: var(--badge-info); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 8px; padding: 9px 15px; font-size: .8rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--teal); color: #fff; }
.admin-shell .btn-primary { background: var(--adm-topbar); }
.admin-shell .btn-primary:hover { background: var(--adm-topbar-dark); }
.btn-danger { border: 1px solid var(--danger); background: #fff; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-outline { border: 1px solid var(--teal); background: #fff; color: var(--teal-dark); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.form-card { width: 100%; max-width: 440px; margin: 0 auto; padding: 26px; background: #fff; border: 1px solid var(--adm-line); border-radius: 12px; box-shadow: 0 2px 10px rgba(27,36,56,.05); }
.form-card.wide { max-width: 650px; }
.form-card h2 { margin: 0 0 12px; color: #1F2937; }
.admin-shell label { display: block; margin: 14px 0 5px; color: #374151; font-size: .78rem; font-weight: 700; }
.admin-shell input[type="text"], .admin-shell input[type="email"], .admin-shell input[type="password"], .admin-shell input[type="number"], .admin-shell input[type="file"], .admin-shell select, .admin-shell textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--adm-line); border-radius: 7px; background: #FBFCFE; color: #1F2937; outline: 0; }
.admin-shell textarea { min-height: 90px; resize: vertical; }
.admin-shell input:focus, .admin-shell select:focus, .admin-shell textarea:focus { border-color: var(--adm-topbar); box-shadow: 0 0 0 3px rgba(79,131,196,.08); }
.form-msg { display: none; margin-top: 14px; padding: 10px 12px; border-radius: 7px; font-size: .8rem; }
.form-msg.show { display: block; }
.form-msg.error { background: #FCEAE8; color: #B42318; }
.form-msg.success { background: #E8F6EE; color: #146C43; }
.form-msg.info { background: #EAF1FB; color: #315F9A; }
.text-muted { color: var(--muted); font-size: .8rem; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--adm-sidebar); }
.login-wrap .form-card { border: 0; }
.login-logo { text-align: center; margin-bottom: 6px; color: var(--ink); font-size: 1.3rem; font-weight: 800; }
.login-logo span { color: var(--adm-topbar); }

@media (max-width: 860px) {
  .admin-sidebar { display: none; }
  .admin-content { padding: 20px 14px 40px; }
  .admin-table-wrap { overflow-x: auto; }
  .admin-table { min-width: 760px; }
}

/* =========================================================
   ADMIN MARKETPLACE REDESIGN v20
   Navy #1B2560 + Teal #1EAFA0
   ========================================================= */
.admin-marketplace,
.admin-shell {
  --adm-sidebar: #11183F;
  --adm-sidebar-active: rgba(30,175,160,.14);
  --adm-sidebar-text: #B8C2DD;
  --adm-topbar: #FFFFFF;
  --adm-topbar-dark: #1B2560;
  --adm-bg: #F5F7FB;
  --adm-line: #E7EAF2;
}

.admin-shell {
  min-height: 100vh;
  background: var(--adm-bg);
  font-family: "Inter", sans-serif;
}

.admin-layout { min-height: 100vh; display: flex; }

.admin-sidebar {
  width: 270px;
  flex: 0 0 270px;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg,#11183F 0%,#182355 100%);
  color: #fff;
  border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: 12px 0 32px rgba(17,24,63,.08);
  z-index: 20;
}

.admin-brand-lockup {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-logo-box {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(0,0,0,.12);
}
.admin-logo-box img { width: 48px; height: 48px; object-fit: contain; }
.admin-brand-text { display: flex; flex-direction: column; min-width: 0; }
.admin-brand-text strong { color: #fff; font-family: "Fraunces",serif; font-size: 1.12rem; letter-spacing: -.01em; }
.admin-brand-text small { margin-top: 1px; color: #79D8CF; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.admin-sidebar > .sidebar-brand { padding: 24px 22px; font-family: "Fraunces",serif; font-size: 1.25rem; color:#fff; border-bottom:1px solid rgba(255,255,255,.08); }
.admin-sidebar > .sidebar-brand span { color: #55D1C4; }

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 16px 16px 6px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  background: rgba(255,255,255,.045);
}
.sidebar-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg,#1EAFA0,#62D8CE);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(30,175,160,.22);
}
.sidebar-profile-copy { min-width: 0; }
.sidebar-profile-name { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:#fff; font-size:.73rem; font-weight:700; }
.sidebar-profile-status { margin-top:3px; display:flex; align-items:center; gap:5px; color:#8ADFD6; font-size:.66rem; }
.sidebar-profile-status::before { content:""; width:6px; height:6px; border-radius:50%; background:#45D6A1; box-shadow:0 0 0 3px rgba(69,214,161,.1); }
.sidebar-section-label { padding: 19px 22px 7px; color:#6F7BA5; font-size:.62rem; font-weight:800; letter-spacing:.12em; }
.sidebar-nav { padding: 0 11px; }
.sidebar-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 3px 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #C7CFE3;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 600;
  transition: .16s ease;
}
.sidebar-nav a .ico { width: 20px; text-align:center; color:#7DD9D0; font-size:1rem; }
.sidebar-nav a:hover { color:#fff; background:rgba(255,255,255,.055); }
.sidebar-nav a.active { color:#fff; background:rgba(30,175,160,.14); border-color:rgba(77,211,198,.18); box-shadow:inset 3px 0 0 #1EAFA0; }
.sidebar-nav-secondary { margin-bottom: 10px; }
.sidebar-footer { margin-top:auto; padding:14px 16px 20px; border-top:1px solid rgba(255,255,255,.07); }
.sidebar-logout { display:flex; align-items:center; gap:8px; padding:10px 12px; border-radius:9px; color:#FFB5B5; text-decoration:none; font-size:.76rem; font-weight:700; }
.sidebar-logout:hover { background:rgba(220,38,38,.09); }

.admin-main { min-width:0; flex:1; background:#F5F7FB; }
.admin-topbar {
  min-height: 76px;
  position: sticky;
  top: 0;
  z-index: 15;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding: 12px 30px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  border-bottom:1px solid #E6EAF2;
  color:var(--navy);
  box-shadow:0 1px 0 rgba(27,37,96,.02);
}
.admin-topbar-kicker { color:#8991A6; font-size:.58rem; font-weight:800; letter-spacing:.13em; }
.admin-topbar .topbar-title { margin-top:2px; color:var(--navy); font-family:"Fraunces",serif; font-size:1.35rem; font-weight:700; }
.admin-topbar .topbar-right { display:flex; align-items:center; gap:10px; color:#697186; font-size:.72rem; }
.admin-online-pill { display:inline-flex; align-items:center; gap:6px; padding:6px 9px; border-radius:999px; background:#ECFBF5; color:#16805C; font-size:.65rem; font-weight:800; }
.admin-online-pill span { width:6px; height:6px; border-radius:50%; background:#20B77D; }
.admin-email-top { max-width:220px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.admin-topbar a.admin-store-link { padding:8px 11px; border-radius:9px; background:#F1F4FA; color:var(--navy); font-size:.68rem; font-weight:800; text-decoration:none; }
.admin-topbar a.admin-store-link:hover { background:var(--teal-soft); color:var(--teal-dark); }

.admin-content { padding: 30px; }
.admin-welcome { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:24px; }
.admin-breadcrumb { color:#9299AA; font-size:.68rem; font-weight:600; }
.admin-welcome h1 { margin:5px 0 5px; color:var(--navy); font-family:"Fraunces",serif; font-size:clamp(1.75rem,3vw,2.4rem); line-height:1.1; }
.admin-welcome p { margin:0; color:#747C8F; font-size:.78rem; }
.admin-primary-action { min-height:44px; display:inline-flex; align-items:center; justify-content:center; padding:0 16px; border-radius:10px; background:var(--teal); color:#fff; text-decoration:none; font-size:.75rem; font-weight:800; box-shadow:0 9px 22px rgba(30,175,160,.18); }
.admin-primary-action:hover { background:var(--teal-dark); transform:translateY(-1px); }

.admin-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:22px; }
.admin-summary-card { min-width:0; display:flex; align-items:center; gap:13px; padding:17px; border:1px solid #E7EAF2; border-radius:15px; background:#fff; box-shadow:0 5px 18px rgba(27,37,96,.045); }
.summary-icon { width:44px; height:44px; flex:0 0 44px; display:grid; place-items:center; border-radius:12px; font-size:1.2rem; font-weight:800; }
.summary-icon.navy { background:#EEF0FA; color:var(--navy); }
.summary-icon.teal { background:#E8F9F6; color:var(--teal-dark); }
.summary-icon.amber { background:#FFF6DF; color:#B77900; }
.summary-icon.red { background:#FFF0F0; color:#D14343; }
.admin-summary-card div:last-child { min-width:0; }
.admin-summary-card span { display:block; color:#858C9D; font-size:.65rem; font-weight:700; }
.admin-summary-card strong { display:block; margin:2px 0 0; color:#151D35; font-size:1.6rem; line-height:1.1; }
.admin-summary-card small { display:block; margin-top:3px; color:#A1A7B5; font-size:.58rem; }

.admin-panel { overflow:hidden; border:1px solid #E5E9F1; border-radius:17px; background:#fff; box-shadow:0 7px 24px rgba(27,37,96,.055); }
.admin-panel-head { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:19px 20px; border-bottom:1px solid #EDF0F5; }
.panel-kicker { color:var(--teal-dark); font-size:.58rem; font-weight:800; letter-spacing:.13em; }
.admin-panel-head h2 { margin:2px 0 1px; color:var(--navy); font-family:"Fraunces",serif; font-size:1.25rem; }
.admin-panel-head p { margin:0; color:#8B92A3; font-size:.67rem; }
.admin-toolbar { display:flex; align-items:center; gap:8px; }
.admin-search-box { width:220px; min-height:38px; display:flex; align-items:center; gap:7px; padding:0 10px; border:1px solid #DBE0EA; border-radius:9px; background:#FAFBFD; }
.admin-search-box span { color:#969EAF; font-size:1.05rem; }
.admin-search-box input { width:100%; min-width:0; border:0!important; outline:0!important; padding:0!important; background:transparent!important; font-size:.7rem!important; box-shadow:none!important; }
.admin-filter-select { min-height:38px; padding:0 30px 0 10px; border:1px solid #DBE0EA; border-radius:9px; background:#fff; color:#5F687B; font-size:.68rem; font-weight:600; }

.modern-table-wrap { border:0!important; border-radius:0!important; box-shadow:none!important; overflow-x:auto; }
.modern-admin-table { min-width:860px; }
.modern-admin-table th { padding:11px 14px; background:#FAFBFD!important; color:#8B93A5!important; font-size:.6rem!important; letter-spacing:.08em!important; border-bottom:1px solid #EDF0F5!important; }
.modern-admin-table td { padding:13px 14px!important; border-bottom:1px solid #F0F2F6!important; vertical-align:middle!important; font-size:.72rem!important; }
.modern-admin-table tbody tr { transition:background .14s ease; }
.modern-admin-table tbody tr:hover { background:#FBFCFE; }
.admin-product-cell { min-width:250px; display:flex; align-items:center; gap:11px; }
.admin-product-image { width:54px; height:54px; flex:0 0 54px; display:grid; place-items:center; overflow:hidden; border:1px solid #E5E9F0; border-radius:10px; background:#fff; }
.admin-product-thumb { width:100%; height:100%; object-fit:contain; display:block; }
.admin-product-thumb.logo-fallback { padding:7px; opacity:.72; }
.admin-product-copy { min-width:0; }
.admin-product-copy strong { display:block; color:#222A3E; font-size:.75rem; line-height:1.35; }
.admin-product-copy span { display:block; max-width:280px; margin-top:3px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:#969DAC; font-size:.62rem; }
.admin-category-chip { display:inline-flex; padding:5px 8px; border-radius:7px; background:#F1F4FA; color:#626B7E; font-size:.62rem; font-weight:700; }
.admin-price-text { color:var(--navy); font-size:.74rem; }
.admin-stock-number { display:inline-flex; min-width:30px; justify-content:center; padding:5px 8px; border-radius:7px; background:#F6F7FA; color:#525B6D; font-weight:800; }
.admin-status-badge { display:inline-flex; align-items:center; gap:5px; padding:5px 8px; border-radius:999px; font-size:.6rem; font-weight:800; }
.admin-status-badge i { width:6px; height:6px; border-radius:50%; }
.admin-status-badge.available { background:#EAF9F3; color:#167656; }
.admin-status-badge.available i { background:#22A976; }
.admin-status-badge.low { background:#FFF6DF; color:#A86C00; }
.admin-status-badge.low i { background:#E6A11A; }
.admin-status-badge.out { background:#FFF0F0; color:#C54141; }
.admin-status-badge.out i { background:#DD4A4A; }
.admin-row-actions { display:flex; align-items:center; gap:6px; }
.admin-action-btn { min-height:32px; display:inline-flex; align-items:center; justify-content:center; padding:0 9px; border:1px solid transparent; border-radius:8px; text-decoration:none; font-size:.62rem; font-weight:800; }
.admin-action-btn.edit { border-color:#D6EAE8; background:#F0FBF9; color:#118F84; }
.admin-action-btn.edit:hover { background:#DFF6F2; }
.admin-action-btn.delete { border-color:#F2D2D2; background:#FFF8F8; color:#D34848; }
.admin-action-btn.delete:hover { background:#FFEDED; }
.admin-action-btn:disabled { opacity:.55; cursor:not-allowed; }
.admin-loading-cell, .admin-error-cell, .admin-empty-cell { padding:42px 20px!important; text-align:center!important; color:#8D95A7!important; }
.admin-loading-cell { font-size:.72rem!important; }
.admin-spinner { width:16px; height:16px; display:inline-block; margin-right:7px; vertical-align:-3px; border:2px solid #DFE4EE; border-top-color:var(--teal); border-radius:50%; animation:adminSpin .7s linear infinite; }
@keyframes adminSpin { to { transform:rotate(360deg); } }
.admin-error-cell strong, .admin-empty-cell strong { display:block; color:#4A5264; }
.admin-error-cell span, .admin-empty-cell small { display:block; margin-top:4px; color:#9AA1B0; font-size:.64rem; }
.admin-empty-cell > span { display:block; color:#A8AFBD; font-size:1.4rem; }

/* Forms in admin inherit the new visual language */
.admin-shell .form-card { max-width:700px; padding:24px; border:1px solid #E5E9F1; border-radius:16px; background:#fff; box-shadow:0 7px 24px rgba(27,37,96,.055); }
.admin-shell .form-card h2 { font-family:"Fraunces",serif; color:var(--navy); font-size:1.6rem; }
.admin-shell label { color:#525A6C; font-size:.7rem; }
.admin-shell input[type="text"], .admin-shell input[type="email"], .admin-shell input[type="password"], .admin-shell input[type="number"], .admin-shell input[type="file"], .admin-shell textarea, .admin-shell select { border:1px solid #DDE2EC; border-radius:9px; background:#FBFCFE; }
.admin-shell input:focus, .admin-shell textarea:focus, .admin-shell select:focus { outline:0; border-color:var(--teal); box-shadow:0 0 0 3px rgba(30,175,160,.1); }
.admin-shell .btn-primary { background:var(--navy)!important; }
.admin-shell .btn-primary:hover { background:var(--navy-3)!important; }
.admin-shell .btn-outline { border-color:#D9DFEA; color:var(--navy); background:#fff; }

@media (max-width: 1080px) {
  .admin-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-panel-head { align-items:flex-start; flex-direction:column; }
  .admin-toolbar { width:100%; }
  .admin-search-box { flex:1; }
}

@media (max-width: 860px) {
  .admin-sidebar { display:none; }
  .admin-topbar { padding:12px 16px; }
  .admin-topbar .admin-email-top, .admin-online-pill { display:none; }
  .admin-content { padding:18px 12px 36px; }
  .admin-welcome { align-items:flex-start; flex-direction:column; }
  .admin-primary-action { width:100%; }
  .admin-summary-grid { grid-template-columns:1fr 1fr; gap:9px; }
  .admin-summary-card { padding:13px; }
  .summary-icon { width:38px; height:38px; flex-basis:38px; }
  .admin-summary-card strong { font-size:1.3rem; }
  .admin-panel-head { padding:15px; }
  .admin-toolbar { align-items:stretch; flex-direction:column; }
  .admin-search-box { width:100%; }
  .admin-filter-select { width:100%; }
}

@media (max-width: 480px) {
  .admin-summary-grid { grid-template-columns:1fr; }
  .admin-topbar .admin-store-link { font-size:0; width:38px; height:38px; padding:0; display:grid; place-items:center; }
  .admin-topbar .admin-store-link::after { content:"↗"; font-size:1rem; }
}

/* =========================================================
   ADMIN — ORDER MANAGEMENT
   ========================================================= */
.admin-welcome-compact { margin-bottom:16px; }
.order-summary-grid { margin-bottom:18px; }
.order-admin-table { min-width:900px; }
.order-code { color:var(--navy); font-weight:800; }
.order-customer-name { color:#252D3D; font-weight:700; }
.order-customer-phone { margin-top:2px; color:#9299A8; font-size:.63rem; }
.order-badge { display:inline-flex; align-items:center; padding:5px 8px; border-radius:999px; font-size:.59rem; line-height:1; font-weight:800; white-space:nowrap; }
.order-badge.paid, .order-badge.done { background:#EAF9F3; color:#167656; }
.order-badge.dp, .order-badge.process { background:#EEF5FF; color:#315FA8; }
.order-badge.unpaid, .order-badge.new { background:#FFF6DF; color:#A86C00; }
.order-badge.cancelled { background:#FFF0F0; color:#C54141; }

/* DETAIL PESANAN */
.order-detail-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(280px,.75fr); gap:16px; }
.order-detail-card { padding:20px; border:1px solid #E7EAF0; border-radius:16px; background:#fff; box-shadow:0 6px 20px rgba(27,37,96,.04); }
.order-detail-card h2 { margin:0 0 14px; color:var(--navy); font-family:"Fraunces",serif; font-size:1.1rem; }
.order-detail-row { display:grid; grid-template-columns:150px 1fr; gap:12px; padding:10px 0; border-bottom:1px solid #F0F2F6; font-size:.72rem; }
.order-detail-row:last-child { border-bottom:0; }
.order-detail-row span:first-child { color:#9299A8; }
.order-detail-row strong { color:#2E3545; }
.order-items-table { width:100%; border-collapse:collapse; }
.order-items-table th, .order-items-table td { padding:10px 9px; border-bottom:1px solid #EEF1F5; text-align:left; font-size:.7rem; }
.order-items-table th { color:#8B93A5; font-size:.59rem; text-transform:uppercase; letter-spacing:.06em; }
.order-status-form { display:grid; gap:12px; }
.order-status-form label { margin:0 0 5px; color:#5E6677; font-size:.68rem; }
.order-status-form select, .order-status-form input, .order-status-form textarea { width:100%; padding:10px 11px; border:1px solid #DDE2EB; border-radius:9px; background:#fff; font:inherit; font-size:.72rem; }
.order-status-form textarea { min-height:86px; resize:vertical; }
.order-save-btn { width:100%; border:0; border-radius:10px; padding:11px 14px; background:var(--teal,#1EAFA0); color:#fff; font-weight:800; cursor:pointer; }
.order-save-btn:disabled { opacity:.6; cursor:not-allowed; }
.order-detail-message { display:none; margin-top:10px; padding:9px 11px; border-radius:8px; font-size:.68rem; }
.order-detail-message.show { display:block; }
.order-detail-message.success { background:#EAF9F3; color:#167656; }
.order-detail-message.error { background:#FFF0F0; color:#C54141; }

@media (max-width:900px) {
  .order-detail-grid { grid-template-columns:1fr; }
}


/* =========================================================
   V6 — HARGA DISKON / HARGA CORET
   ========================================================= */
.discount-admin-box{
  margin:12px 0 4px;
  padding:14px;
  border:1px solid #dce3ee;
  border-radius:10px;
  background:#f8fafc;
}
.discount-toggle{
  display:flex !important;
  align-items:center;
  gap:9px;
  margin:0 !important;
  cursor:pointer;
  font-weight:700 !important;
  color:var(--navy, #1B2560);
}
.discount-toggle input{width:18px;height:18px;margin:0;accent-color:var(--teal,#1EAFA0)}
.discount-fields{display:none;margin-top:14px}.discount-fields.show{display:block}
.discount-help{display:block;margin-top:7px;color:#7b8794;font-size:.75rem;line-height:1.4}
.discount-preview-admin{margin-top:12px;padding:12px;border-radius:9px;background:#fff;border:1px dashed #d8dee8;min-height:38px}
.discount-preview-price{font-size:1.35rem;font-weight:800;color:#111827;line-height:1.15}
.discount-preview-sub,.market-old-price-row,.detail-old-price-row,.cart-discount-line{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:5px}
.discount-percent-chip,.market-discount-badge{display:inline-flex;align-items:center;justify-content:center;padding:3px 6px;border-radius:5px;background:#ffe0e5;color:#ef3f58;font-size:.72rem;font-weight:800;line-height:1.15}
.discount-old-price,.market-old-price,.detail-old-price,.cart-old-price,.checkout-old-price{color:#98a2b3;text-decoration:line-through;font-weight:600}
.discount-preview-hint{color:#7b8794;font-size:.8rem}.discount-preview-error{color:#dc2626;font-size:.8rem;font-weight:700}

.market-discount-price{margin-top:1px}
.market-product-price{color:var(--navy);font-size:1rem;font-weight:800;line-height:1.15}
.market-old-price{font-size:.76rem}
.market-old-price-row{margin-top:4px}

.detail-price-wrap{margin:12px 0}
.detail-price-wrap .detail-price{margin:0}
.detail-old-price{font-size:.96rem}
.detail-old-price-row{margin-top:6px}

.cart-discount-line{margin-top:4px}
.cart-old-price{font-size:.76rem}
.checkout-old-price{margin-left:4px;font-size:.72rem}

.admin-price-old{display:flex;align-items:center;gap:5px;margin-top:4px;color:#9aa4b2;font-size:.66rem}
.admin-price-old span{padding:2px 4px;border-radius:4px;background:#ffe0e5;color:#ef3f58;font-weight:800}

@media only screen and (max-width:640px){
  .market-product-price{font-size:.84rem!important}
  .market-old-price-row{gap:4px;margin-top:3px}
  .market-discount-badge{font-size:.58rem;padding:2px 4px}
  .market-old-price{font-size:.64rem}
}
