/* ============================================
   YACIMA SHOP - Global Styles (Shopee-like)
   ============================================ */
:root {
  --primary: #ee4d2d;
  --primary-dark: #f53d2d;
  --text: #222;
  --muted: #7a7a7a;
  --border: #e5e5e5;
  --bg: #f5f5f5;
  --white: #fff;
  --success: #26aa99;
  --danger: #d0021b;
  --warning: #f4b400;
  --shadow: 0 2px 8px rgba(0,0,0,.06);
  --radius: 4px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* ---- Topbar ---- */
.topbar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 13px;
}
.topbar-inner { display: flex; justify-content: space-between; padding: 8px 16px; }
.topbar-links a { margin-left: 16px; opacity: .9; }
.topbar-links a:hover { opacity: 1; text-decoration: underline; }

/* ---- Navbar ---- */
.navbar { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); padding: 12px 0 20px; color: #fff; }
.navbar-inner { display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 20px; white-space: nowrap; }
.brand img { height: 36px; }
.brand-mark { font-size: 28px; }
.search { flex: 1; display: flex; background: #fff; border-radius: 3px; overflow: hidden; padding: 3px; }
.search input { flex: 1; border: 0; padding: 10px 12px; font-size: 14px; outline: none; }
.search button { background: var(--primary); color: #fff; border: 0; padding: 0 24px; cursor: pointer; border-radius: 2px; font-weight: 600; }
.search button:hover { background: var(--primary-dark); }
.cart-btn { position: relative; color: #fff; font-size: 26px; padding: 4px 8px; }
.cart-badge {
  position: absolute; top: -4px; right: -4px;
  background: #fff; color: var(--primary); font-size: 11px;
  min-width: 20px; height: 20px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}

/* ---- Main ---- */
.main { min-height: 60vh; padding: 24px 0 48px; }

/* ---- Hero / Banner ---- */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; padding: 32px; border-radius: 8px; margin-bottom: 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 8px; font-size: 28px; }
.hero p { margin: 0; opacity: .95; }
.hero-badge { background: rgba(255,255,255,.15); padding: 16px 24px; border-radius: 8px; text-align: center; }

/* ---- Categories row ---- */
.section-title { font-size: 16px; text-transform: uppercase; color: var(--muted); border-bottom: 3px solid var(--primary); padding-bottom: 8px; margin: 32px 0 16px; letter-spacing: 1px; }
.categories-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px;
  background: #fff; border-radius: 4px; padding: 16px; box-shadow: var(--shadow);
}
.category-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  text-align: center; transition: transform .15s; background: #fff;
}
.category-card:hover { transform: translateY(-2px); color: var(--primary); box-shadow: var(--shadow); }
.category-icon { font-size: 32px; margin-bottom: 8px; }

/* ---- Product grid ---- */
.products-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px;
}
.product-card {
  background: #fff; border-radius: 4px; overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: block; position: relative;
}
.product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-2px); }
.product-card:hover .product-name { color: var(--primary); }
.product-image {
  aspect-ratio: 1; background: #fafafa; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 8px; }
.product-name {
  font-size: 13px; line-height: 1.4; height: 36px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  margin-bottom: 6px;
}
.product-price { color: var(--primary); font-size: 16px; font-weight: 600; }
.product-price small { font-size: 11px; }
.product-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; }
.product-badge { position: absolute; top: 6px; left: 6px; background: var(--primary); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 2px; font-weight: 600; }

/* ---- Product detail ---- */
.product-detail { background: #fff; border-radius: 4px; padding: 24px; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr 1.4fr; gap: 32px; }
.product-detail-image { aspect-ratio: 1; background: #fafafa; border-radius: 4px; overflow: hidden; }
.product-detail-image img { width: 100%; height: 100%; object-fit: cover; }
.product-detail h1 { margin: 0 0 12px; font-size: 22px; }
.price-box { background: #fafafa; padding: 16px; border-radius: 4px; margin: 16px 0; }
.price-big { color: var(--primary); font-size: 30px; font-weight: 700; }
.detail-row { display: flex; padding: 12px 0; border-bottom: 1px solid var(--border); }
.detail-row .label { width: 120px; color: var(--muted); }
.qty-selector { display: inline-flex; border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.qty-selector button { width: 34px; height: 34px; border: 0; background: #fff; cursor: pointer; font-size: 16px; }
.qty-selector input { width: 50px; text-align: center; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); font-size: 14px; }
.detail-actions { display: flex; gap: 12px; margin-top: 24px; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: 3px; border: 0; cursor: pointer; font-size: 14px; font-weight: 500; text-align: center; transition: all .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: #fff5f0; }
.btn-secondary { background: #f5f5f5; color: var(--text); }
.btn-secondary:hover { background: #e5e5e5; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-lg { padding: 14px 32px; font-size: 15px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Cart / Checkout tables ---- */
.card { background: #fff; border-radius: 4px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h2 { margin-top: 0; font-size: 18px; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 12px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.tbl th { background: #fafafa; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.tbl-product { display: flex; align-items: center; gap: 12px; }
.tbl-product img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.summary { display: flex; justify-content: space-between; padding: 8px 0; }
.summary.total { font-size: 18px; font-weight: 700; color: var(--primary); border-top: 2px solid var(--border); padding-top: 12px; margin-top: 8px; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-control, input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=url], input[type=date], input[type=datetime-local], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 3px; font-size: 14px; font-family: inherit;
}
.form-control:focus, input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--primary); }
textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

/* ---- Alerts ---- */
.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; background: #eee; font-size: 11px; text-transform: uppercase; font-weight: 600; }
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-primary { background: var(--primary); color: #fff; }

/* ---- Auth box ---- */
.auth-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.auth-box { background: #fff; padding: 32px; border-radius: 4px; box-shadow: var(--shadow); width: 100%; max-width: 400px; }
.auth-box h1 { margin: 0 0 24px; text-align: center; }

/* ---- Footer ---- */
.footer { background: #fff; border-top: 3px solid var(--primary); padding: 32px 0 0; margin-top: 48px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding-bottom: 32px; }
.footer h4 { color: var(--primary); margin: 0 0 12px; }
.footer a { display: block; padding: 4px 0; color: var(--text); }
.footer a:hover { color: var(--primary); }
.footer-bottom { text-align: center; padding: 16px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }

/* ============================================
   ADMIN
   ============================================ */
body.admin-body { background: #f0f2f5; margin: 0; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 230px;
  background: #001529; color: #fff; overflow-y: auto;
}
.sidebar-brand { padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 16px; }
.sidebar-nav { padding: 8px 0; }
.sidebar-nav a { display: block; padding: 12px 20px; color: rgba(255,255,255,.75); font-size: 14px; border-left: 3px solid transparent; }
.sidebar-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar-nav a.active { background: var(--primary); color: #fff; border-left-color: #fff; }
.sidebar-nav hr { border: 0; border-top: 1px solid rgba(255,255,255,.1); margin: 8px 0; }

.admin-main { margin-left: 230px; padding: 24px; min-height: 100vh; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-topbar h1 { margin: 0; font-size: 22px; }
.admin-user { color: var(--muted); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: var(--shadow); }
.stat-card .label { color: var(--muted); font-size: 13px; text-transform: uppercase; }
.stat-card .value { font-size: 26px; font-weight: 700; margin: 8px 0 4px; color: var(--primary); }

.admin-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: var(--shadow); margin-bottom: 16px; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.admin-toolbar .search-inline { display: flex; gap: 8px; }
.admin-toolbar .search-inline input { min-width: 240px; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; }
.admin-table th { background: #fafafa; font-weight: 600; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.admin-table tr:hover td { background: #fafafa; }
.admin-actions { display: flex; gap: 6px; }
.admin-actions a, .admin-actions button { padding: 6px 10px; font-size: 12px; border-radius: 3px; text-decoration: none; border: 0; cursor: pointer; }
.admin-actions .edit { background: #e3f2fd; color: #1565c0; }
.admin-actions .delete { background: #ffebee; color: #c62828; }
.admin-actions .view { background: #f3e5f5; color: #6a1b9a; }

.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tabs a { padding: 12px 20px; border-bottom: 2px solid transparent; margin-bottom: -2px; color: var(--muted); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---- Print label ---- */
@media print {
  body { background: #fff !important; }
  .no-print { display: none !important; }
  .label-sheet { box-shadow: none !important; border: 1px solid #000 !important; }
}
.label-sheet {
  max-width: 700px; margin: 20px auto; padding: 20px;
  background: #fff; border: 2px solid #000; font-family: Arial, sans-serif;
}
.label-header { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 8px; }
.label-header h2 { margin: 0; }
.label-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px dashed #000; }
.label-block h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; }
.label-block p { margin: 2px 0; font-size: 13px; }
.label-items table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.label-items th, .label-items td { border: 1px solid #000; padding: 6px; font-size: 12px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .navbar-inner { flex-wrap: wrap; }
  .brand { flex: 1; }
  .search { order: 3; flex-basis: 100%; }
  .hero { flex-direction: column; text-align: center; }
  .product-detail { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; z-index: 100; }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
}
