/* HB Laptops - Design System */
:root {
  --navy: #0f1b3d;
  --navy-light: #16234f;
  --orange: #ff7a1a;
  --orange-dark: #e56100;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1c2333;
  --muted: #6b7280;
  --border: #e5e8f0;
  --success: #17a568;
  --danger: #e0393e;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(15, 27, 61, 0.08);
  --shadow-hover: 0 10px 28px rgba(15, 27, 61, 0.15);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}
.logo span { color: var(--orange); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.main-nav a {
  color: #cfd6e8;
  font-weight: 500;
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.main-nav a:hover, .main-nav a.active {
  color: #fff;
  border-color: var(--orange);
}
.cart-link {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--orange);
  color: #fff !important;
  padding: 8px 16px !important;
  border-radius: 999px;
  border: none !important;
}
.cart-link:hover { background: var(--orange-dark); color: #fff !important; }
.cart-badge {
  background: #fff;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: #fff;
  display: block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .2s;
  font-size: 15px;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-light); }
.btn-outline { background: transparent; border: 2px solid var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-block { width: 100%; text-align: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1d2f66 100%);
  color: #fff;
  padding: 70px 0;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 320px;
  height: 320px;
  background: var(--orange);
  opacity: 0.15;
  border-radius: 50%;
}
.hero-inner { position: relative; z-index: 1; max-width: 600px; }
.hero h1 { font-size: 42px; margin: 0 0 14px; line-height: 1.2; }
.hero h1 span { color: var(--orange); }
.hero p { font-size: 17px; color: #cfd6e8; margin-bottom: 28px; }

.category-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-top: -40px;
  position: relative;
  z-index: 2;
}
.category-tile {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 18px;
  transition: transform .2s, box-shadow .2s;
}
.category-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.category-tile .icon { font-size: 34px; margin-bottom: 10px; }

/* ---------- Sections ---------- */
.section { padding: 50px 0; }
.section-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title a { font-size: 14px; color: var(--orange-dark); font-weight: 600; }

/* ---------- Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.product-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.product-thumb {
  aspect-ratio: 1 / 1;
  background: #eef1f8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-cat { font-size: 12px; color: var(--orange-dark); font-weight: 700; text-transform: uppercase; }
.product-name { font-weight: 700; font-size: 15px; }
.product-price { font-size: 18px; font-weight: 800; color: var(--navy); margin-top: auto; }
.stock-badge { font-size: 12px; font-weight: 600; }
.stock-badge.in { color: var(--success); }
.stock-badge.low { color: var(--orange-dark); }
.stock-badge.out { color: var(--danger); }

/* ---------- Filters / search ---------- */
.toolbar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 26px;
  background: var(--card);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.toolbar select, .toolbar input[type="text"] {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.toolbar input[type="text"] { flex: 1; min-width: 180px; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--orange);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 500;
}
.alert-error { background: #fdeceb; color: var(--danger); border: 1px solid #f5c6c6; }
.alert-success { background: #e9f9f1; color: var(--success); border: 1px solid #b9ecd3; }

/* ---------- Product detail ---------- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}
.product-detail-img { background: #eef1f8; border-radius: var(--radius); overflow: hidden; }
.product-detail h1 { font-size: 26px; margin: 0 0 10px; }
.product-detail .price { font-size: 30px; font-weight: 800; color: var(--navy); margin: 14px 0; }
.qty-selector { display: flex; align-items: center; gap: 10px; margin: 20px 0; }
.qty-selector button {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; font-size: 18px; cursor: pointer;
}
.qty-selector input { width: 60px; text-align: center; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }

/* ---------- Cart ---------- */
.cart-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cart-table th, .cart-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.cart-table th { background: #f9fafc; font-size: 13px; text-transform: uppercase; color: var(--muted); }
.cart-item-info { display: flex; align-items: center; gap: 14px; }
.cart-item-thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: #eef1f8; flex-shrink: 0; }
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-summary { max-width: 380px; margin-left: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-top: 24px; }
.cart-summary .row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 15px; }
.cart-summary .total { font-size: 20px; font-weight: 800; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.remove-link { color: var(--danger); font-size: 13px; font-weight: 600; }

/* ---------- Order tracking timeline ---------- */
.timeline { display: flex; justify-content: space-between; margin: 40px 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  top: 16px; left: 0; right: 0;
  height: 3px;
  background: var(--border);
  z-index: 0;
}
.timeline-step { text-align: center; position: relative; z-index: 1; flex: 1; }
.timeline-dot {
  width: 34px; height: 34px; border-radius: 50%; background: var(--border);
  margin: 0 auto 10px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.timeline-step.done .timeline-dot { background: var(--success); }
.timeline-step.current .timeline-dot { background: var(--orange); box-shadow: 0 0 0 4px rgba(255,122,26,0.25); }
.timeline-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.timeline-step.done .timeline-label, .timeline-step.current .timeline-label { color: var(--text); }
.order-cancelled-badge { display: inline-block; background: #fdeceb; color: var(--danger); font-weight: 700; padding: 10px 18px; border-radius: 999px; }

/* ---------- Order summary card ---------- */
.order-info-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px; }
.order-info-card .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.order-info-card .label { font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #cfd6e8; margin-top: 60px; }
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  padding: 40px 20px;
}
.footer-inner h3 { color: #fff; margin: 0 0 8px; }
.footer-inner h3 span { color: var(--orange); }
.footer-inner h4 { color: #fff; margin: 0 0 12px; font-size: 15px; }
.footer-inner a { display: block; margin-bottom: 8px; color: #cfd6e8; }
.footer-inner a:hover { color: var(--orange); }
.footer-bottom { text-align: center; padding: 16px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; color: #9aa4c0; }
.footer-bottom a { color: var(--orange); font-weight: 600; }
.footer-bottom a:hover { text-decoration: underline; }

/* ---------- Admin ---------- */
.admin-wrap { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar { width: 230px; background: var(--navy); color: #fff; flex-shrink: 0; padding: 20px 0; }
.admin-sidebar .logo { display: block; padding: 0 20px 20px; font-size: 20px; font-weight: 800; }
.admin-sidebar .logo span { color: var(--orange); }
.admin-sidebar a {
  display: block;
  padding: 12px 20px;
  color: #cfd6e8;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,0.06); color: #fff; border-color: var(--orange); }
.admin-main { flex: 1; padding: 30px; max-width: 100%; overflow-x: auto; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.admin-topbar h1 { font-size: 24px; margin: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.stat-card .label { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.stat-card .value { font-size: 28px; font-weight: 800; margin-top: 8px; }
.stat-card.orange .value { color: var(--orange-dark); }
.stat-card.green .value { color: var(--success); }
.stat-card.red .value { color: var(--danger); }

.data-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th, .data-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.data-table th { background: #f9fafc; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.data-table img.thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; background: #eef1f8; }
.table-actions { display: flex; gap: 8px; }

.status-pill { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-block; }
.status-Pending { background: #fff4e5; color: #b5680a; }
.status-Confirmed { background: #e7f0fe; color: #1a56c4; }
.status-Shipped { background: #eee6fd; color: #6b2fd6; }
.status-Out-for-Delivery { background: #fef0dd; color: #b5680a; }
.status-Delivered { background: #e9f9f1; color: var(--success); }
.status-Cancelled { background: #fdeceb; color: var(--danger); }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #1d2f66 100%);
}
.login-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-hover); padding: 40px; width: 100%; max-width: 380px; }
.login-card h2 { text-align: center; margin-top: 0; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-detail { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-sidebar { width: 70px; }
  .admin-sidebar .logo, .admin-sidebar a span.label { display: none; }
  .admin-main { padding: 18px; }
}

@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: var(--navy);
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 20px 20px;
    gap: 6px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .hero h1 { font-size: 30px; }
  .category-tiles { grid-template-columns: 1fr 1fr; margin-top: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
}

@media (max-width: 520px) {
  .product-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .stat-grid { grid-template-columns: 1fr; }
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
  .cart-table tr { margin-bottom: 14px; border-bottom: 8px solid var(--bg); }
  .cart-table td { border-bottom: 1px solid var(--border); }
}
