/* =====================================================
   ShopKart — Main Stylesheet
   ===================================================== */

:root {
  --primary: #0066cc;
  --primary-dark: #004d99;
  --secondary: #ff6600;
  --success: #28a745;
  --bg-light: #f8f9fa;
  --white: #ffffff;
  --text: #333333;
  --radius: 8px;
  --shadow: 0 2px 10px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.14);
}

[data-theme="dark"] {
  --bg-light: #14181d;
  --white: #1e242b;
  --text: #e9ecef;
}

* { box-sizing: border-box; }

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background: var(--bg-light);
  transition: background .3s ease, color .3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text);
}

a { text-decoration: none; }

.text-primary-custom { color: var(--primary) !important; }
.text-secondary-custom { color: var(--secondary) !important; }

.btn-primary-custom {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary-custom:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}
.btn-secondary-custom {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}
.btn-secondary-custom:hover {
  background: #e65c00;
  border-color: #e65c00;
  color: #fff;
}
.btn-outline-primary-custom {
  color: var(--primary);
  border: 1px solid var(--primary);
  background: transparent;
}
.btn-outline-primary-custom:hover {
  background: var(--primary);
  color: #fff;
}

/* -------- Preloader -------- */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .4s ease, visibility .4s ease;
}
#preloader.hide { opacity: 0; visibility: hidden; }
.spinner-brand {
  width: 54px; height: 54px;
  border: 5px solid #e3e8ee;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------- Navbar -------- */
.navbar-shop {
  background: var(--white);
  box-shadow: var(--shadow);
  padding: .6rem 0;
}
.navbar-shop .navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary);
}
.navbar-shop .navbar-brand span { color: var(--secondary); }
.navbar-shop .nav-link {
  font-weight: 500;
  color: var(--text);
}
.navbar-shop .nav-link:hover,
.navbar-shop .nav-link.active { color: var(--primary); }

.search-bar-form { max-width: 480px; width: 100%; }
.search-bar-form input {
  border-radius: 30px 0 0 30px;
}
.search-bar-form button {
  border-radius: 0 30px 30px 0;
}

.cart-icon-wrap { position: relative; }
.cart-badge {
  position: absolute;
  top: -6px; right: -10px;
  background: var(--secondary);
  color: #fff;
  font-size: .65rem;
  border-radius: 50%;
  padding: 2px 6px;
}

/* -------- Hero / Carousel -------- */
.hero-slide {
  height: 420px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  color: #fff;
}
.hero-slide .overlay {
  background: linear-gradient(90deg, rgba(0,20,50,.75), rgba(0,20,50,.15));
  width: 100%; height: 100%;
  position: absolute; inset: 0;
}
.hero-slide .container { position: relative; z-index: 2; }

/* -------- Category Grid -------- */
.category-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  padding: 1.5rem 1rem;
  transition: transform .25s ease, box-shadow .25s ease;
  cursor: pointer;
  height: 100%;
}
.category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}
.category-card i {
  font-size: 2.2rem;
  color: var(--primary);
  margin-bottom: .6rem;
}

/* -------- Product Card -------- */
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  height: 100%;
  transition: transform .25s ease, box-shadow .25s ease;
  border: 1px solid rgba(0,0,0,0.04);
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.product-card .product-img-wrap {
  height: 190px;
  overflow: hidden;
  background: #eef2f6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card img { width: 100%; height: 100%; object-fit: cover; }
.product-card .card-body { padding: 1rem; }
.product-card .price { font-weight: 700; color: var(--primary); font-size: 1.1rem; }
.product-card .old-price { text-decoration: line-through; color: #999; font-size: .85rem; }
.wishlist-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: #fff;
  border-radius: 50%;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  border: none;
  z-index: 2;
}
.wishlist-btn.active i { color: var(--secondary); }
.product-img-wrap { position: relative; }

.rating-stars i { color: #ffb400; font-size: .85rem; }

.badge-offer {
  background: var(--secondary);
  color: #fff;
  font-size: .7rem;
  padding: .25rem .5rem;
  border-radius: 4px;
}

/* -------- Sections -------- */
.section-title {
  font-weight: 700;
  border-left: 5px solid var(--secondary);
  padding-left: .75rem;
  margin-bottom: 1.75rem;
}

.seller-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  text-align: center;
}
.seller-card img { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; margin-bottom: .75rem; }

.newsletter-section {
  background: var(--primary);
  color: #fff;
}

footer.site-footer {
  background: #1a1f27;
  color: #cfd6dd;
}
footer.site-footer h5 { color: #fff; }
footer.site-footer a { color: #cfd6dd; }
footer.site-footer a:hover { color: var(--secondary); }

/* -------- Back to top -------- */
#backToTop {
  position: fixed;
  bottom: 90px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  display: none;
  align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  z-index: 1000;
}

/* -------- WhatsApp button -------- */
#whatsappBtn {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  box-shadow: var(--shadow);
  z-index: 1000;
}

/* -------- Dashboards (customer/admin) -------- */
.dash-sidebar {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}
.dash-sidebar .nav-link {
  color: var(--text);
  border-radius: 6px;
  padding: .6rem .9rem;
  margin-bottom: .25rem;
}
.dash-sidebar .nav-link i { width: 22px; }
.dash-sidebar .nav-link.active,
.dash-sidebar .nav-link:hover {
  background: var(--primary);
  color: #fff;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-card .icon-box {
  width: 54px; height: 54px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: #fff;
}
.stat-card h3 { margin: 0; font-weight: 700; }
.stat-card p { margin: 0; color: #888; font-size: .85rem; }

/* Admin layout */
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 250px;
  background: #1a1f27;
  color: #c8d0d8;
  flex-shrink: 0;
  transition: margin-left .3s ease;
}
.admin-sidebar .brand {
  padding: 1.1rem 1.25rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-sidebar .nav-link {
  color: #c8d0d8;
  padding: .75rem 1.25rem;
  border-left: 3px solid transparent;
}
.admin-sidebar .nav-link i { width: 22px; }
.admin-sidebar .nav-link.active,
.admin-sidebar .nav-link:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  border-left-color: var(--secondary);
}
.admin-content { flex-grow: 1; }
.admin-topbar {
  background: var(--white);
  box-shadow: var(--shadow);
  padding: .85rem 1.5rem;
}
@media (max-width: 991px) {
  .admin-sidebar { position: fixed; z-index: 1050; margin-left: -250px; height: 100%; }
  .admin-sidebar.show { margin-left: 0; }
}

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 220px; }
.bar-chart .bar {
  flex: 1;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  border-radius: 6px 6px 0 0;
  position: relative;
  min-height: 4px;
  transition: height 1s ease;
}
.bar-chart .bar span {
  position: absolute; top: -22px; left: 0; right: 0;
  text-align: center; font-size: .75rem; font-weight: 600;
}
.bar-chart .bar-label {
  text-align: center; font-size: .75rem; color: #888; margin-top: 6px;
}
.bar-col { display: flex; flex-direction: column; justify-content: flex-end; flex: 1; height: 100%; }

/* Status badges */
.badge-status-pending { background:#ffc107; color:#212529; }
.badge-status-processing { background:#0dcaf0; color:#212529; }
.badge-status-shipped { background:#0066cc; }
.badge-status-delivered { background:#28a745; }
.badge-status-cancelled { background:#dc3545; }

/* Auth pages */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--primary) 0%, #003d73 100%);
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  overflow: hidden;
}
.auth-side {
  background: var(--primary-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem;
}
.social-btn {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: #fff;
}
.social-btn:hover { background: #f5f5f5; }

/* Utility */
.cursor-pointer { cursor: pointer; }
.rounded-custom { border-radius: var(--radius); }
.shadow-custom { box-shadow: var(--shadow); }
.lazy-img { opacity: 0; transition: opacity .4s ease; }
.lazy-img.loaded { opacity: 1; }

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem rgba(0,102,204,.15);
}

.filter-sidebar {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.filter-sidebar h6 { font-weight: 700; margin-top: 1rem; }
.filter-sidebar h6:first-child { margin-top: 0; }


/* Production hardening / responsive helpers */
html{scroll-behavior:smooth;}
img{max-width:100%;}
.table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch;}
@media (max-width:575.98px){.hero-slide{height:360px}.hero-slide h1{font-size:1.8rem}.hero-slide p{font-size:1rem}.search-bar-form{max-width:none}.admin-topbar{padding:.75rem 1rem}.container-fluid.p-4{padding:.75rem!important}.product-card .product-img-wrap{height:160px}.product-card .card-body{padding:.75rem}.filter-sidebar{padding:1rem}}
