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

:root {
  --red:      #DC2626;
  --red-d:    #B91C1C;
  --red-l:    #FEE2E2;
  --gray-50:  #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --green:    #16A34A;
  --yellow:   #D97706;
  --radius:   8px;
  --shadow:   0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 15px; color: var(--gray-900); background: var(--gray-50); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Navbar ── */
.nav { background: var(--gray-900); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; height: 58px; gap: 16px; }
.nav-logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-logo-text { font-size: 1.15rem; font-weight: 800; color: #fff; letter-spacing: 1px; text-transform: uppercase; }
.nav-logo-text span { color: var(--red); }
.nav-search { flex: 1; max-width: 400px; display: flex; background: rgba(255,255,255,.1); border-radius: 6px; border: 1px solid rgba(255,255,255,.15); transition: all .2s; }
.nav-search:focus-within { background: #fff; border-color: #fff; }
.nav-search:focus-within input { color: var(--gray-900); }
.nav-search:focus-within input::placeholder { color: var(--gray-400); }
.nav-search:focus-within button { color: var(--gray-500); }
.nav-search input { flex: 1; background: none; border: none; padding: 8px 12px; outline: none; font-size: 13px; color: #fff; }
.nav-search input::placeholder { color: rgba(255,255,255,.5); }
.nav-search button { background: none; border: none; padding: 0 10px; cursor: pointer; color: rgba(255,255,255,.6); }
.nav-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-btn { display: flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; color: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.2); background: transparent; cursor: pointer; white-space: nowrap; transition: all .15s; }
.nav-btn:hover { color: #fff; border-color: rgba(255,255,255,.5); }
.nav-btn.primary { background: var(--red); color: #fff; border-color: var(--red); }
.nav-btn.primary:hover { background: var(--red-d); }
.cart-badge { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; height: 18px; min-width: 18px; padding: 0 4px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; margin-left: 2px; }

/* ── Layout ── */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page { padding: 24px 0 56px; }

/* ── Flash ── */
.flash { padding: 11px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }
.flash.ok  { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.flash.err { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

/* ── Card ── */
.card { background: #fff; border-radius: var(--radius); border: 1px solid var(--gray-200); }
.card-body { padding: 20px; }

/* ── Product Card ── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 14px; }
.product-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--gray-200); overflow: hidden; transition: box-shadow .2s, transform .2s; display: block; }
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--gray-300, #D1D5DB); }
.product-card-img { width: 100%; height: 185px; object-fit: cover; background: var(--gray-100); }
.product-card-body { padding: 11px 12px; }
.product-card-cat  { font-size: 10px; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.product-card-name { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--gray-900); margin-bottom: 7px; }
.product-card-price { font-size: 14px; font-weight: 700; color: var(--gray-900); }
.product-card-old   { font-size: 11px; color: var(--gray-400); text-decoration: line-through; }
.product-card-meta  { font-size: 11px; color: var(--gray-500); margin-top: 5px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: all .15s; }
.btn-red     { background: var(--red);   color: #fff; border-color: var(--red); }
.btn-red:hover     { background: var(--red-d); border-color: var(--red-d); }
.btn-outline { background: #fff; color: var(--gray-700); border-color: var(--gray-200); }
.btn-outline:hover { border-color: var(--red); color: var(--red); }
.btn-dark    { background: var(--gray-900); color: #fff; }
.btn-dark:hover    { background: var(--gray-700); }
.btn-danger  { background: #FEE2E2; color: #991B1B; border-color: #FECACA; }
.btn-danger:hover  { background: #FECACA; }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Form ── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 4px; }
.form-input { width: 100%; padding: 9px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius); outline: none; transition: border-color .15s; background: #fff; font-size: 14px; }
.form-input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,.08); }
.form-select { appearance: none; cursor: pointer; }

/* ── Badge ── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-red    { background: #FEE2E2; color: #991B1B; }
.badge-yellow { background: #FEF9C3; color: #92400E; }
.badge-blue   { background: #DBEAFE; color: #1E40AF; }
.badge-green  { background: #DCFCE7; color: #166534; }
.badge-purple { background: #EDE9FE; color: #5B21B6; }
.badge-gray   { background: var(--gray-100); color: var(--gray-500); }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }

/* ── Divider ── */
.divider { height: 1px; background: var(--gray-100); margin: 16px 0; }

/* ── Section ── */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 17px; font-weight: 700; }

/* ── Qty ── */
.qty-ctrl { display: inline-flex; align-items: center; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.qty-btn { width: 34px; height: 34px; border: none; background: var(--gray-50); cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: background .15s; color: var(--gray-700); }
.qty-btn:hover { background: var(--gray-200); }
.qty-inp { width: 42px; height: 34px; border: none; border-left: 1px solid var(--gray-200); border-right: 1px solid var(--gray-200); text-align: center; font-size: 14px; font-weight: 600; outline: none; -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ── Pagination ── */
.pagination { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 18px; }
.page-btn { padding: 6px 11px; border-radius: 6px; font-size: 12px; border: 1px solid var(--gray-200); background: #fff; cursor: pointer; color: var(--gray-700); }
.page-btn.active { background: var(--red); color: #fff; border-color: var(--red); }
.page-btn:hover:not(.active) { border-color: var(--red); color: var(--red); }

/* ── Footer ── */
footer { background: var(--gray-900); color: #6B7280; padding: 36px 0 18px; margin-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr; gap: 28px; margin-bottom: 24px; }
.footer-logo { font-size: 1rem; font-weight: 800; color: #fff; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 7px; }
.footer-logo span { color: var(--red); }
.footer-desc { font-size: 12px; line-height: 1.7; }
.footer-title { color: #fff; font-weight: 600; font-size: 12px; margin-bottom: 9px; text-transform: uppercase; letter-spacing: .5px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1F2937; padding-top: 14px; text-align: center; font-size: 11px; }

/* ── Admin ── */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: var(--gray-900); flex-shrink: 0; position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; z-index: 50; }
.sidebar-logo { padding: 18px 16px; border-bottom: 1px solid #1F2937; }
.sidebar-logo-text { font-size: 1rem; font-weight: 800; color: #fff; letter-spacing: 1px; text-transform: uppercase; }
.sidebar-logo-text span { color: var(--red); }
.sidebar-nav { padding: 10px 0; flex: 1; }
.sidebar-label { font-size: 10px; font-weight: 700; color: #4B5563; padding: 10px 16px 3px; text-transform: uppercase; letter-spacing: .6px; }
.sidebar-link { display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: 13px; font-weight: 500; color: #9CA3AF; border-left: 3px solid transparent; transition: all .15s; }
.sidebar-link svg { flex-shrink: 0; opacity: .6; transition: opacity .15s; }
.sidebar-link:hover svg, .sidebar-link.on svg { opacity: 1; }
.sidebar-link:hover, .sidebar-link.on { color: #fff; background: rgba(220,38,38,.15); border-left-color: var(--red); }
.admin-main { margin-left: 210px; flex: 1; display: flex; flex-direction: column; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--gray-200); height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; position: sticky; top: 0; z-index: 40; }
.admin-topbar h1 { font-size: 14px; font-weight: 600; }
.admin-content { padding: 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 18px; border: 1px solid var(--gray-200); border-left: 3px solid; }
.stat-val { font-size: 1.4rem; font-weight: 700; margin-bottom: 2px; }
.stat-lbl { font-size: 11px; color: var(--gray-500); font-weight: 500; }

/* ── Hero strip ── */
.hero-strip { background: var(--gray-900); color: #fff; padding: 36px 0; margin-bottom: 28px; }
.hero-strip h1 { font-size: 1.8rem; font-weight: 800; line-height: 1.25; margin-bottom: 8px; }
.hero-strip h1 span { color: var(--red); }
.hero-strip p { font-size: 14px; color: #9CA3AF; margin-bottom: 18px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-search { display: none; }
  .product-grid { grid-template-columns: repeat(2,1fr); }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-strip h1 { font-size: 1.4rem; }
}
