/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', sans-serif; background: #f5f5f5; color: #333; font-size: 15px; line-height: 1.6; }
a { color: #e53935; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ===== HEADER ===== */
header { background: #e53935; color: white; padding: 0; box-shadow: 0 2px 6px rgba(0,0,0,.2); position: sticky; top: 0; z-index: 100; }
.header-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 12px; }
.logo { font-size: 22px; font-weight: 700; color: white; letter-spacing: -0.5px; }
.logo span { color: #ffcdd2; font-weight: 400; font-size: 13px; display: block; line-height: 1; }
.search-bar { flex: 1; max-width: 420px; display: flex; }
.search-bar input { flex: 1; padding: 8px 14px; border: none; border-radius: 4px 0 0 4px; font-size: 14px; outline: none; }
.search-bar button { padding: 8px 16px; background: #b71c1c; color: white; border: none; border-radius: 0 4px 4px 0; cursor: pointer; }
.header-actions { display: flex; gap: 12px; align-items: center; }
.header-actions a { color: white; font-size: 13px; display: flex; align-items: center; gap: 5px; }
.badge { background: #fff; color: #e53935; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
nav.kategori-nav { background: #c62828; }
nav.kategori-nav ul { display: flex; list-style: none; gap: 0; }
nav.kategori-nav ul li a { display: block; padding: 9px 16px; color: #ffcdd2; font-size: 13px; transition: background .15s; }
nav.kategori-nav ul li a:hover, nav.kategori-nav ul li a.aktif { background: rgba(255,255,255,.1); color: white; text-decoration: none; }

/* ===== HERO / BANNER ===== */
.hero { background: linear-gradient(135deg, #e53935, #b71c1c); color: white; padding: 48px 0; text-align: center; }
.hero h1 { font-size: 32px; margin-bottom: 8px; }
.hero p { font-size: 16px; opacity: .85; margin-bottom: 20px; }
.btn { display: inline-block; padding: 10px 24px; border-radius: 4px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: opacity .15s, transform .1s; }
.btn:hover { opacity: .9; text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: #e53935; color: white; }
.btn-white { background: white; color: #e53935; }
.btn-success { background: #43a047; color: white; }
.btn-danger { background: #e53935; color: white; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ===== SECTION ===== */
.section { padding: 32px 0; }
.section-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; color: #222; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ''; flex: 1; height: 2px; background: #eee; }

/* ===== PRODUK GRID ===== */
.produk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.produk-card { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); transition: box-shadow .2s, transform .2s; }
.produk-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.14); transform: translateY(-2px); }
.produk-card .gambar { position: relative; aspect-ratio: 4/3; overflow: hidden; background: #f5f5f5; }
.produk-card .gambar img { width: 100%; height: 100%; object-fit: cover; }
.produk-card .stok-habis { position: absolute; inset: 0; background: rgba(0,0,0,.5); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.produk-card .info { padding: 12px; }
.produk-card .nama { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: #222; line-height: 1.3; }
.produk-card .kategori { font-size: 11px; color: #999; margin-bottom: 6px; }
.produk-card .harga { font-size: 16px; font-weight: 700; color: #e53935; }
.produk-card .aksi { margin-top: 10px; display: flex; gap: 6px; }

/* ===== PRODUK DETAIL ===== */
.produk-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; background: white; border-radius: 8px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.produk-detail img { width: 100%; border-radius: 6px; }
.produk-detail .nama { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.produk-detail .harga { font-size: 28px; font-weight: 700; color: #e53935; margin-bottom: 16px; }
.produk-detail .stok { font-size: 13px; color: #666; margin-bottom: 16px; }
.qty-control { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.qty-control button { width: 32px; height: 32px; border: 1px solid #ddd; background: white; border-radius: 4px; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qty-control input { width: 60px; text-align: center; border: 1px solid #ddd; height: 32px; border-radius: 4px; font-size: 15px; }

/* ===== KERANJANG ===== */
.keranjang-table { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
table { width: 100%; border-collapse: collapse; }
table thead tr { background: #fafafa; }
table th, table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
table tbody tr:last-child td { border-bottom: none; }
.ringkasan { background: white; border-radius: 8px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.ringkasan h3 { margin-bottom: 16px; }
.ringkasan .row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.ringkasan .total { font-size: 18px; font-weight: 700; color: #e53935; border-top: 1px solid #eee; padding-top: 10px; margin-top: 10px; }

/* ===== LAYOUT 2-COL ===== */
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ===== FORM ===== */
.form-card { background: white; border-radius: 8px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #444; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 9px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; outline: none; transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #e53935; }
.form-group textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== ALERT ===== */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.alert-danger  { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.alert-info    { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

/* ===== BADGE / TAG ===== */
.tag { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.tag-pending   { background: #fff3e0; color: #e65100; }
.tag-dibayar   { background: #e3f2fd; color: #1565c0; }
.tag-diproses  { background: #f3e5f5; color: #6a1b9a; }
.tag-dikirim   { background: #e8eaf6; color: #283593; }
.tag-selesai   { background: #e8f5e9; color: #2e7d32; }
.tag-dibatalkan{ background: #ffebee; color: #c62828; }

/* ===== FOOTER ===== */
footer { background: #222; color: #aaa; padding: 40px 0 20px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; margin-bottom: 24px; }
footer h4 { color: white; margin-bottom: 12px; font-size: 14px; }
footer ul { list-style: none; }
footer ul li { margin-bottom: 6px; }
footer ul li a { color: #aaa; font-size: 13px; }
footer ul li a:hover { color: white; text-decoration: none; }
.footer-bottom { border-top: 1px solid #333; padding-top: 16px; text-align: center; font-size: 12px; }

/* ===== BREADCRUMB ===== */
.breadcrumb { font-size: 13px; color: #999; margin-bottom: 16px; }
.breadcrumb a { color: #999; }
.breadcrumb span { color: #333; }

/* ===== ADMIN ===== */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { background: #1a1a2e; color: white; padding: 0; }
.sidebar-brand { padding: 20px; font-size: 18px; font-weight: 700; background: #e53935; color: white; display: block; }
.sidebar ul { list-style: none; padding: 12px 0; }
.sidebar ul li a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: #aaa; font-size: 14px; transition: background .15s; }
.sidebar ul li a:hover, .sidebar ul li a.aktif { background: rgba(229,57,53,.15); color: white; text-decoration: none; }
.sidebar ul li a i { width: 18px; text-align: center; }
.admin-main { padding: 28px; background: #f5f5f5; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-header h1 { font-size: 22px; font-weight: 700; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: white; border-radius: 8px; padding: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.stat-card .label { font-size: 12px; color: #999; margin-bottom: 6px; }
.stat-card .value { font-size: 26px; font-weight: 700; color: #333; }
.stat-card .icon { float: right; font-size: 32px; opacity: .15; }
.data-table { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.data-table-header { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f0f0f0; }
.data-table table th { background: #fafafa; font-size: 12px; text-transform: uppercase; color: #888; letter-spacing: .5px; }
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; color: #555; }
.pagination a:hover { background: #f5f5f5; text-decoration: none; }
.pagination .aktif { background: #e53935; color: white; border-color: #e53935; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .produk-detail { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .search-bar { display: none; }
    .admin-layout { grid-template-columns: 1fr; }
    nav.kategori-nav ul { overflow-x: auto; flex-wrap: nowrap; }
}
@media (max-width: 480px) {
    .grid-3 { grid-template-columns: 1fr; }
    .header-actions a span { display: none; }
}
</style>
