/* Base Styles */
:root {
  /* Colors */
  --tzedek-green: rgb(34, 197, 94);
  --tzedek-green-dark: rgb(22, 163, 74);
  --tzedek-green-light: rgb(187, 247, 208);
  --tzedek-gold: rgb(234, 179, 8);
  --tzedek-gold-dark: rgb(202, 138, 4);
  --tzedek-gold-light: rgb(254, 240, 138);
  --white: #ffffff;
  --black: #000000;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* Border Radius */
  --radius-sm: 0.125rem;
  --radius: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: var(--gray-700);
  background-color: var(--white);
}

.hidden {
  display: none !important;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

button{
    border: none;
    outline: none;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* Buttons */
.btn-primary {
  display: inline-block;
  background-color: var(--tzedek-green);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s ease;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-primary:hover {
  background-color: var(--tzedek-green-dark);
}

.btn-secondary {
  display: inline-block;
  background-color: var(--tzedek-gold);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s ease;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-secondary:hover {
  background-color: var(--tzedek-gold-dark);
}

.btn-outline {
  display: inline-block;
  background-color: transparent;
  color: var(--gray-700);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  text-align: center;
}

.btn-outline:hover {
  border-color: var(--tzedek-green);
  color: var(--tzedek-green);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.full-width {
  width: 100%;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 10px;
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

.navbar-logo .logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--tzedek-green);
  text-decoration: none;
}

.navbar-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--gray-700);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--tzedek-green);
}

.navbar-auth {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-button {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-menu-button i{
  font-size: 20px;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  background-color: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 1rem 0;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.3s cubic-bezier(0.4,0,0.2,1);
  transform: translateY(-30px);
  opacity: 0;
  pointer-events: none;
}

.mobile-nav.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.mobile-nav.hidden {
  display: none !important;
}

.mobile-nav .nav-link {
  display: block;
  padding: 0.5rem 0;
}

.mobile-auth {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--gray-200);
}

@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .mobile-menu-button { display: block; }
  .mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #fff;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.5rem 1rem;
    box-shadow: 0 4px 24px 0 rgba(0,0,0,0.08);
  }
}
@media (min-width: 901px) {
  .mobile-menu-button { display: none; }
  .mobile-nav { display: none !important; }
}
.mobile-nav.hidden { display: none !important; }


/* Product Card Styles */
.product-card {
  position: relative;
}

.product-image {
  position: relative;
  overflow: hidden;
}

.add-to-cart-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 45px;
  height: 45px;
  background-color: var(--white);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 10;
  opacity: 0;
  transform: scale(0.8);
}

.product-card:hover .add-to-cart-icon {
  opacity: 1;
  transform: scale(1);
}

.add-to-cart-icon:hover {
  background-color: var(--tzedek-green);
  color: var(--white);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.add-to-cart-icon:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.add-to-cart-icon.added {
  background-color: var(--tzedek-green);
  color: var(--white);
}

.add-to-cart-icon i {
  font-size: 18px;
}

/* Homepage marketplace layout */
.marketplace .section-top {
  margin-bottom: 1.5rem;
}

.marketplace .section-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.marketplace .section-header {
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
}

.marketplace .search-container {
  max-width: 520px;
  width: 100%;
}

.marketplace .search-container input {
  background-color: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  padding: 0.85rem 1rem 0.85rem 42px;
}

.marketplace .products-grid {
  gap: 2.25rem;
}

.marketplace .product-card {
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.marketplace .product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.marketplace .product-image {
  height: 200px;
}

.marketplace .product-info {
  gap: 0.75rem;
}

.marketplace .product-category {
  font-weight: 600;
  margin-bottom: 0;
}

.marketplace .product-title {
  font-size: 1.05rem;
  line-height: 1.4;
  margin-bottom: 0;
}

.marketplace .product-description {
  margin-bottom: 0;
  line-height: 1.5;
}

.marketplace .product-price {
  font-size: 1.2rem;
}

@media (max-width: 900px) {
  .marketplace .section-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Cart Notification Styles */
.cart-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: var(--white);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.cart-notification-success {
  border-left: 4px solid var(--tzedek-green);
}

.cart-notification-error {
  border-left: 4px solid #ef4444;
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--gray-700);
}

.cart-notification-success .notification-content i {
  color: var(--tzedek-green);
  font-size: 20px;
}

.cart-notification-error .notification-content i {
  color: #ef4444;
  font-size: 20px;
}

.notification-content span {
  font-weight: 500;
}

/* Cart Count Badge */
.cart-count {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--tzedek-green);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  padding: 0 5px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .add-to-cart-icon {
    opacity: 1;
    transform: scale(1);
    width: 40px;
    height: 40px;
  }

  .add-to-cart-icon i {
    font-size: 16px;
  }

  .cart-notification {
    right: 10px;
    left: 10px;
    top: 10px;
  }
}
