/* style.css - Full consolidated styles for your e-commerce site */

/* ================================================ */
/* 1. Reset & Base Styles                           */
/* ================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacOSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f9f9f9;
}

/* ================================================ */
/* 2. Navbar (horizontal + hamburger mobile)        */
/* ================================================ */
.navbar {
  background: #222;
  color: white;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.9rem;
  font-weight: bold;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #4ade80;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.cart-link {
  position: relative;
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
}

#cart-count {
  background: #ef4444;
  color: white;
  border-radius: 50%;
  padding: 0.18rem 0.58rem;
  font-size: 0.78rem;
  position: absolute;
  top: -8px;
  right: -12px;
  min-width: 18px;
  text-align: center;
  font-weight: bold;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.hamburger span {
  width: 28px;
  height: 3px;
  background: white;
  transition: all 0.3s;
}

@media (max-width: 992px) {
  .hamburger { display: flex; }
  .nav-links, .nav-right { display: none; }

  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #222;
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .nav-right.active {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
}

/* ================================================ */
/* 3. Toast Notifications                           */
/* ================================================ */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  max-width: 380px;
}

.toast {
  background: #333;
  color: white;
  padding: 14px 20px;
  margin-bottom: 12px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.4s ease;
  font-size: 1rem;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: #22c55e; }
.toast.error   { background: #ef4444; }

/* ================================================ */
/* 4. Loading & Error States                        */
/* ================================================ */
.loading {
  text-align: center;
  padding: 5rem 1rem;
  font-size: 1.4rem;
  color: #666;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 28px;
  height: 28px;
  margin-left: 12px;
  border: 4px solid #3b82f6;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-message {
  color: #ef4444;
  text-align: center;
  padding: 3rem;
  font-size: 1.3rem;
}

/* ================================================ */
/* 5. Products Page & Cards                         */
/* ================================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
  padding: 1rem;
}

.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

.product-card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #f9fafb;
  padding: 1.2rem;
}

.product-card h3 {
  padding: 0 1.2rem;
  font-size: 1.25rem;
  margin: 0.8rem 0 0.4rem;
}

.product-card p {
  padding: 0 1.2rem 1rem;
  color: #16a34a;
  font-size: 1.35rem;
  font-weight: 700;
}

.add-to-cart {
  width: 100%;
  padding: 0.9rem;
  background: #3b82f6;
  color: white;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.add-to-cart:hover {
  background: #2563eb;
}

/* ================================================ */
/* 6. Auth Pages (Login / Register)                 */
/* ================================================ */
.auth-container {
  max-width: 440px;
  margin: 5rem auto;
  padding: 2.5rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-header h1 {
  font-size: 2.4rem;
  margin-bottom: 0.6rem;
}

.form-group {
  margin-bottom: 1.6rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 0.95rem 1.1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.login-btn, .register-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.login-btn    { background: #3b82f6; }
.register-btn { background: #22c55e; }

.login-btn:hover    { background: #2563eb; }
.register-btn:hover { background: #16a34a; }

/* ================================================ */
/* 7. Cart & Checkout                               */
/* ================================================ */
.cart-item, .summary-item {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
  gap: 1rem;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.quantity-btn {
  width: 36px;
  height: 36px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1.2rem;
  cursor: pointer;
}

.place-order-btn {
  width: 100%;
  padding: 1.2rem;
  background: #22c55e;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.3rem;
  font-weight: bold;
  cursor: pointer;
}

.place-order-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* ================================================ */
/* 8. Footer & Misc                                 */
/* ================================================ */
footer {
  background: #1f2937;
  color: white;
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
}

.footer-links a {
  color: #9ca3af;
  margin: 0 0.8rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  
  .cart-item, .summary-item {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1rem;
  }
}
.bottom-banners h3 {
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.bottom-banners a:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

/* Fixed Product Card Layout */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgb(255, 255, 255);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  padding-bottom: 10px;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

/* Make image consistent */
.product-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #f8fafc;
  padding: 10px;
}

/* Product Info - Fixed Height */
.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;

  align-items: center;
}

/* Force name to take fixed space */
.product-info h3 {
  min-height: 48px;           /* Important: fixes different name lengths */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 1.05rem;
  margin-bottom: 8px;
}

/* Price */
.product-info .price {
  font-size: 1.25rem;
  font-weight: bold;
  color: #28a741;
  font-size: 30px;
  margin: 8px 0;
}
.product-card:hover {
  transform: translateY(-12px) scale(1.04);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.product-card img {
  transition: transform 0.4s ease;
}

.product-card:hover img {
  transform: scale(1.1);
}

.short-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;       /* show max 3 lines */
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.payment-form {
  margin-top: 1.5rem;
  display: none;
}

.payment-form.active {
  display: block;
}
.outline-btn {
  padding: 0.8rem 1.8rem;
  border: 2px solid #00ffff;
  border-radius: 9999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.outline-btn:hover {
  background: #007bff;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,123,255,0.3);
}
/* ================================================
   Navbar base styles (your original look preserved)
================================================ */
.navbar {
  background: #222;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.logo {
  font-size: 1.9rem;
  font-weight: bold;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.5rem;
  margin: 0;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #a78bfa;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.cart-link {
  position: relative;
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
}

#cart-count {
  background: #ef4444;
  color: white;
  border-radius: 50%;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  position: absolute;
  top: -8px;
  right: -12px;
  min-width: 18px;
  text-align: center;
}

/* Hamburger button (hidden on desktop) */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.hamburger span {
  width: 28px;
  height: 3px;
  background: white;
  transition: all 0.3s;
}

/* Mobile menu (hamburger visible + links hidden) */
@media (max-width: 992px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #222;
    padding: 1.5rem;
    gap: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    align-items: center;
    margin-top: 1rem;
  }

  /* Hamburger animation */
  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
}
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.toast {
    padding: 14px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s ease;
    max-width: 100%;
    word-break: break-word;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}
/* Hero Carousel Arrows */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.carousel-arrow:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.left-arrow {
  left: 20px;
}

.right-arrow {
  right: 20px;
}

/* Optional: Make arrows bigger on hover */
.carousel-arrow:active {
  transform: translateY(-50%) scale(0.95);
}
.view-cart-btn {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 2px solid #3528a7;
  color: #ffffff;
  background:linear-gradient(60deg, #9578fb, #4837fe);
  border-radius: 8px;
  margin-bottom: 5px;
  font-size: medium;
  font-weight: 600;
  cursor: pointer;
}
.mini-cart {
  position: fixed;
  top: 0;
  right: -450px;
  width: 450px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  box-shadow: -15px 0 40px rgba(0,0,0,0.25);
  transition: right 0.5s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #eee;
}

.mini-cart.open {
  right: 0;
}

.mini-cart-header {
  padding: 1.5rem 1.8rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.close-btn {
  font-size: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
}

.mini-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mini-cart-item {
  display: flex;
  gap: 12px;
  background: white;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.mini-cart-item img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 8px;
}

.mini-cart-footer {
  padding: 1.5rem;
  background: #f8fafc;
  border-top: 1px solid #eee;
}

.checkout-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #3ae762, #079f28);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 12px;
  cursor: pointer;
  transition: 0.3s;
}

.continue-btn {
  width: 100%;
  padding: 16px;
  background: transparent;
  border: 2px solid #f98585;
  color: #ffffff;
  background-color: rgb(255, 84, 84);
  border-radius: 12px;
  font-size: medium;
  font-weight: 600;
  cursor: pointer;
}
/* Dark Mode Styles */
body.dark-mode {
  background: #0f172a;
  color: #e2e8f0;
}

body.dark-mode .navbar {
  background: #1e2937;
}

body.dark-mode .product-card {
  background: #1e2937;
  color: #e2e8f0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

body.dark-mode .cart-item,
body.dark-mode .mini-cart {
  background: #1e2937;
}

body.dark-mode .hero {
  background: linear-gradient(135deg, #1e3a8a, #0f172a);
}

/* Toggle Button Styling */
.theme-toggle-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  color: #f8fafc;
  transition: transform 0.3s;
}

.theme-toggle-btn:hover {
  transform: rotate(25deg);
}
.view-cart-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-cart-btn:hover {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.checkout-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkout-btn:hover {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.continue-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.continue-btn:hover {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
/* Magnetic Button - Premium Effect */
.magnetic-btn {
  position: relative;
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.1s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.magnetic-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  z-index: -1;
  transition: all 0.4s ease;
}

.magnetic-btn:hover::before {
  transform: scale(1.1);
}
.auth-gate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.85)), 
              url('https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?w=2000') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.8s ease;
}

.auth-gate-content {
  text-align: center;
  color: white;
  max-width: 520px;
  padding: 3rem 2rem;
  z-index: 2;
}

.brand-logo h1 {
  font-size: 5rem;
  font-weight: 900;
  letter-spacing: -2px;
  margin-bottom: 0.8rem;
  background: linear-gradient(90deg, #c4b5fd, #e0e7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-logo span {
  color: #e0e7ff;
}

.auth-gate-content h2 {
  font-size: 2.6rem;
  margin: 1rem 0 1.2rem;
  font-weight: 700;
}

.subtitle {
  font-size: 1.35rem;
  line-height: 1.7;
  opacity: 0.95;
  margin-bottom: 3rem;
}

.auth-buttons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 2.8rem;
  flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
  padding: 18px 42px;
  font-size: 1.3rem;
  font-weight: 600;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 200px;
}

.btn-primary {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: white;
  box-shadow: 0 10px 30px rgba(167, 139, 250, 0.45);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2.5px solid rgba(255,255,255,0.9);
}

.btn-primary:hover, .btn-secondary:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px rgba(0,0,0,0.25);
}

.skip-btn {
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 12px 24px;
  transition: all 0.3s;
}

.skip-btn:hover {
  color: white;
  transform: translateY(-3px);
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}
.search-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 20px auto;
}

#search-input {
  width: 100%;
  padding: 14px 20px;
  font-size: 1.1rem;
  border: 2px solid #e2e8f0;
  border-radius: 50px;
  outline: none;
}

#search-input:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.2);
}

.suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-top: 8px;
  max-height: 380px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  display: none;
  z-index: 1000;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: all 0.2s;
}

.suggestion-item:hover,
.suggestion-item.highlight {
  background: #f3e8ff;
}

.suggestion-item img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 8px;
}

.suggestion-info {
  flex: 1;
}

.suggestion-info strong {
  font-size: 1.05rem;
}

.highlight-text {
  background: yellow;
  padding: 2px 4px;
  border-radius: 3px;
}