/*!
 * Bootstrap 5.3.2 (https://getbootstrap.com/)
 */

:root {
  --bs-blue: #0d6efd;
  --bs-indigo: #6610f2;
  --bs-purple: #6f42c1;
  --bs-pink: #d63384;
  --bs-red: #dc3545;
  --bs-orange: #fd7e14;
  --bs-yellow: #ffc107;
  --bs-green: #198754;
  --bs-teal: #20c997;
  --bs-cyan: #0dcaf0;
  --bs-white: #fff;
  --bs-gray: #6c757d;
  --bs-gray-dark: #343a40;
  --bs-primary: #0d6efd;
  --bs-secondary: #6c757d;
  --bs-success: #198754;
  --bs-info: #0dcaf0;
  --bs-warning: #ffc107;
  --bs-danger: #dc3545;
  --bs-light: #f8f9fa;
  --bs-dark: #212529;
}

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

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
}

main {
  flex: 1;
}

a {
  text-decoration: none;
  color: var(--bs-primary);
}

a:hover {
  color: #0a58ca;
}

/* Navbar */
.navbar {
  background: #2c3e50 !important;
  padding: 0.5rem 1rem;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: white !important;
}

@media (max-width: 575.98px) {
  .navbar-brand { font-size: 1.1rem; }
}

.nav-link {
  color: rgba(255,255,255,0.85) !important;
  padding: 0.5rem 1rem !important;
}

.nav-link:hover {
  color: white !important;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

/* Cart Dropdown */
.cart-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 350px;
  background: white;
  border-radius: 0.375rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s;
  z-index: 1001;
}

.cart-icon:hover .cart-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cart-item {
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-footer {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 0 0 0.375rem 0.375rem;
}

/* Cards */
.card {
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.card-img-top {
  height: 180px;
  object-fit: contain;
  padding: 15px;
}

.card-body {
  padding: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.text-success {
  color: #198754 !important;
}

.text-muted {
  color: #6c757d !important;
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-primary {
  background: #3498db;
  border-color: #3498db;
}

.btn-primary:hover {
  background: #2980b9;
  border-color: #2980b9;
}

.btn-success {
  background: #27ae60;
  border-color: #27ae60;
}

.btn-success:hover {
  background: #219a52;
  border-color: #219a52;
}

/* Quick Add */
.quick-add-section {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.quick-add-controls {
  display: none;
  align-items: center;
  gap: 4px;
}

.quick-add-controls.active {
  display: flex;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #dee2e6;
  background: #f8f9fa;
  cursor: pointer;
  border-radius: 0.375rem;
  font-size: 1.1rem;
}

.qty-btn:hover {
  background: #e9ecef;
}

.qty-input {
  width: 50px;
  height: 32px;
  text-align: center;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
}

/* Landing Hero */
.landing-hero {
  height: 100vh;
  background: linear-gradient(rgba(44, 62, 80, 0.85), rgba(44, 62, 80, 0.85));
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  text-align: center;
  color: white;
  animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.3rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

/* Features */
.feature-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #3498db, #2ecc71);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.75rem;
}

/* About Stats */
.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #3498db;
}

/* CTA */
.cta-section {
  background: linear-gradient(135deg, #2c3e50, #3498db);
  padding: 5rem 0;
  color: white;
}

/* Footer */
.footer {
  background: #2c3e50;
  color: white;
  padding: 2rem 0;
  margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .cart-dropdown {
    width: 300px;
    right: -50px;
  }
}

/* No Image */
.no-image-placeholder {
  height: 180px;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 0.875rem;
}

/* Forms */
.form-control {
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
}

.form-control:focus {
  box-shadow: none;
  border-color: #3498db;
}

/* Tables */
.table {
  background: white;
  border-radius: 0.5rem;
}

.table th {
  background: #f8f9fa;
  font-weight: 600;
}

/* Badges */
.badge {
  padding: 0.35em 0.65em;
  font-weight: 500;
}

/* Alert */
.alert-success {
  background: #d1e7dd;
  border: none;
  color: #0f5132;
}

/* Cart Toast */
.cart-toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #198754;
  color: white;
  text-align: center;
  padding: 12px;
  z-index: 9999;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  pointer-events: none;
  font-weight: 500;
}

.cart-toast.show {
  transform: translateY(0);
}

@keyframes cartBounce {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(0.9); }
  75% { transform: scale(1.1); }
}

.cart-icon.bounce .nav-link svg {
  animation: cartBounce 0.5s ease;
}

/* Article link with image preview */
.article-link {
  position: relative;
  color: var(--bs-primary);
  text-decoration: none;
}

.article-link:hover {
  text-decoration: underline;
}

.article-preview {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  pointer-events: none;
}

.article-preview img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

.article-preview::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff;
}

.article-link:hover .article-preview {
  display: block;
}

/* No image fallback for preview */
.article-preview .no-img {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  color: #adb5bd;
  border-radius: 4px;
  font-size: 0.75rem;
}