* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background:#f9f9f9;
  color:#1a1a1a;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.topnav {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  padding: 1rem 2.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 78px;                    /* Fixed height for perfect vertical alignment */
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Logo - Left Side */
.homepage {
  font-size: 2.45rem;
  font-weight: 800;
  color: white;
  text-decoration: none;
  letter-spacing: -1.5px;
  transition: all 0.3s ease;
}

.homepage:hover {
  color: #ffeb3b;
  transform: scale(1.06);
}

/* Username */
.username {
  font-size: 1.48rem;
  font-weight: 600;
  color: red;
  margin: 0;
  padding: 0 12px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.15);
  white-space: nowrap;
}

/* Right Side - Much better alignment */
.topnav-right {
  display: flex;
  align-items: center;
  gap: 24px;                       /* Beautiful spacing between items */
}

.logout, 
.change-password, 
.login-btn {
  padding: 0.55rem 1.4rem;         /* Smaller padding */
  border-radius: 9999px;
  font-size: 0.98rem;              /* Smaller font */
  font-weight: 700;
  color: white;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255,255,255,0.35);
  transition: all 0.3s ease;
  height: 42px;                    /* Smaller height */
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.logout:hover, 
.change-password:hover, 
.login-btn:hover {
  background: rgba(255, 255, 255, 0.38);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.25);
  color: #ffeb3b;
}

/* Hero / Home page */
.hero {
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:2rem;
  text-align:center;
}
.hero-img {
  max-width:90%;
  max-height:60vh;
  object-fit:contain;
  border-radius:16px;
  box-shadow:0 12px 40px rgba(0,0,0,0.15);
  margin-bottom:2.5rem;
}
.category-tiles {
  margin-top:2rem;
  display:flex;
  flex-wrap:wrap;
  gap:1.5rem;
  justify-content:center;
  margin-bottom:2rem;
}
.tile {
  background:#ffffff;
  color:#1e40af;
  font-size:1.4rem;
  font-weight:600;
  padding:1.2rem 2.5rem;
  border-radius:12px;
  text-decoration:none;
  box-shadow:0 6px 18px rgba(0,0,0,0.1);
  transition:all 0.25s;
}
.tile:hover {
  transform:translateY(-6px);
  box-shadow:0 12px 30px rgba(0,0,0,0.15);
  background:#eff6ff;
}

/* ───────────────────────────────────────────────
   Category & Product listing – improved 2026 style
─────────────────────────────────────────────── */

/* Breadcrumb – make it readable on light bg */
.path {
  padding: 1rem 2rem;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
  font-size: 1.05rem;
  line-height: 1.5;
}

.path a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.path a:hover,
.path a:focus {
  text-decoration: underline;
  color: #1d4ed8;
}

/* Main content wrapper */
.mainpage {
  padding: 0 1.5rem 4rem;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* Product grid – responsive, clean */
.product-list {
  list-style: none;
  padding: 0;
  margin: 2rem auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));   /* ← key change */
  gap: 1.5rem 1.25rem;                                           /* comfortable spacing */
  max-width: 1300px;                                             /* ← optional: prevent too wide on ultra-wide */
}
.product-list .product-item {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.07);
  overflow: hidden;
  transition: all 0.28s ease;
  display: flex;                    /* ← important */
  flex-direction: column;           /* ← important */
  height: 100%;                     /* ← makes cards same height in row */
  min-height: 380px;                /* optional: minimum nice height */
}

.product-list .product-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.14);
}

/* The clickable area takes available space but doesn't push button */
.product-link {
  display: flex;
  flex-direction: column;
  flex: 1;                          /* ← grows to fill space */
  text-decoration: none;
  color: inherit;
}

/* Image + texts wrapper (optional but helps centering) */
.product-link > * {
  text-align: center;
}

.thumbnail {
  width: 100%;
  height: 220px;
  object-fit: contain;
  padding: 1.25rem 1rem 0.75rem;
  background: #f9fafb;
}

/* Name & price */
.product-name {
  font-size: 1.12rem;
  font-weight: 600;
  color: #1e40af;
  margin: 0.5rem 1rem 0.4rem;
  line-height: 1.35;
}

.product-price {
  font-size: 1.38rem;
  font-weight: 700;
  color: #e11d48;
  margin: 0 1rem 1rem;
}
.product-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

@media (max-width: 900px) {
  .product-detail-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.product-image-wrapper {
  background: #f9fafb;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.product-full-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.product-image-wrapper:hover .product-full-image {
  transform: scale(1.04);
}

.no-image-placeholder {
  color: #9ca3af;
  font-size: 1.1rem;
  text-align: center;
  padding: 4rem 1rem;
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.product-title {
  font-size: 2.1rem;
  font-weight: 700;
  color: #1e40af;
  margin: 0;
  line-height: 1.2;
}

.product-price {
  font-size: 2.25rem;
  font-weight: 800;
  color: #dc2626;
  margin: 0.5rem 0;
}

.product-description {
  font-size: 1.08rem;
  line-height: 1.7;
  color: #374151;
  border-left: 4px solid #e5e7eb;
  padding-left: 1.25rem;
}

.no-description {
  color: #9ca3af;
  font-style: italic;
}

.add-to-cart-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.add-to-cart-section label {
  font-weight: 600;
  color: #374151;
  font-size: 1.1rem;
  min-width: 80px;
}

.qty-input {
  width: 80px;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1.1rem;
  text-align: center;
}

.add-to-cart-btn {
  background: #dc2626;
  color: white;
  border: none;
  padding: 0.95rem 2.2rem;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  flex: 1;
  margin-top: auto;
  align-self: center;
  width:85%;
  max-width: 200px;
}

.add-to-cart-btn:hover {
  background: #b91c1c;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(185, 28, 28, 0.25);
}

.add-to-cart-btn:active {
  transform: translateY(0);
}

/* Mini Cart Wrapper */
.mini-cart-wrapper {
  position: relative;
}

/* Cart Icon in top bar */
.cart-icon {
  cursor: pointer;
  padding: 0.6rem 1.2rem;
  background: rgba(255,255,255,0.2);
  border-radius: 50px;
  color: white;
}

.cart-icon:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Count badge */
.cart-count {
  background: #dc2626;
  color: white;
  font-size: 0.78rem;
  font-weight: bold;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  min-width: 20px;
  text-align: center;
}

/* Dropdown – hidden by default */
.mini-cart {
  position: absolute;
  top: 100%;
  right: 0;
  width: 340px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  margin-top: 8px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.22s;
}

/* Show when hovering wrapper or inside mini-cart itself */
.mini-cart-wrapper:hover .mini-cart,
.mini-cart-wrapper:focus-within .mini-cart,
.mini-cart:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Header */
.mini-cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  color: #1e40af;
}

.close-cart {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
}

.close-cart:hover {
  color: #dc2626;
}

/* Cart items list */
.cart-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Left: product info */
.cart-item-info {
  flex: 1;
  min-width: 0; /* prevent overflow */
}

/* Right: controls (qty + remove) */
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  justify-content: flex-end; 
}

.cart-item-name {
  font-weight: 600;
  color: #111827;
}

.cart-item-price {
  color: #6b7280;
  font-size: 0.95rem;
}

.qty-input {
  width: 60px;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  text-align: center;
}

.remove-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 1.4rem;
  cursor: pointer;
}

.remove-btn:hover {
  color: #b91c1c;
}

/* Total */
.cart-total {
  padding: 1rem 1.25rem;
  text-align: right;
  font-weight: 700;
  font-size: 1.1rem;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #111827;
}

#cart-total {
  color: #dc2626;           /* make total red to stand out */
  font-size: 1.25rem;
}

/* Checkout */
.checkout-btn {
  width: 100%;
  padding: 1rem;
  background: #dc2626;
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0 0 12px 12px;
}

.checkout-btn:hover {
  background: #b91c1c;
}

/* ───────────────────────────────────────────────
   Mobile adjustments
─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .mainpage {
    padding: 0 1rem 3rem;
  }

  .product-list {
    gap: 1.25rem;
  }

  .product-list img.thumbnail {
    height: 200px;
    padding: 1rem 0.75rem 0.5rem;
  }

  .product-name {
    font-size: 1.08rem;
  }

  .product-price {
    font-size: 1.35rem;
  }
}

/* Footer */
footer {
  margin-top:auto;
  background:#1e293b;
  color:#cbd5e1;
  text-align:center;
  padding:1.8rem;
  font-size:0.95rem;
}

/* Mobile */
@media (max-width: 768px) {
  .topnav { padding:1rem; }
  .hero-img { max-height:50vh; }
  .tile { font-size:1.2rem; padding:1rem 2rem; }
}

.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #2563eb;
  color: white;
}

.mini-cart-wrapper {
  position: relative;
}

.cart-icon {
  padding: 0.55rem 1.4rem;         /* Smaller padding */
  border-radius: 9999px;
  font-size: 0.98rem;              /* Smaller font */
  font-weight: 700;
  color: white;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255,255,255,0.35);
  transition: all 0.3s ease;
  height: 42px;                    /* Smaller height */
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}


