* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  color: #333;
  padding: 20px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar .logo a {
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

.navbar .nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
}

.navbar .nav-links li a {
  color: #666;
  font-size: 16px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.navbar .nav-links li a:hover,
.navbar .nav-links li a.active {
  color: #2196f3;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.sign-in-btn {
  color: #666;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.sign-in-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #2196f3;
}

.get-started-btn {
  background: #2196f3;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.get-started-btn:hover {
  background: #1976d2;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.cart-icon {
  position: relative;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  color: #666;
}

.cart-icon:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #2196f3;
}

.cart-icon svg {
  width: 24px;
  height: 24px;
}

.cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ff4444;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.hero {
  padding: 40px 20px;
  background-color: rgba(255, 255, 255, 0.95);
  text-align: center;
  margin: 20px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 40px;
}

.hero p {
  font-size: 18px;
  margin-bottom: 40px;
}

.cta-btn {
  background: #2196f3;
  padding: 15px 30px;
  color: white;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-block;
}

.cta-btn:hover {
  background: #1976d2;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(33, 150, 243, 0.3);
}

.featured-products {
  padding: 40px 20px;
  background-color: rgba(255, 255, 255, 0.95);
  text-align: center;
  margin: 20px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.featured-products h2 {
  font-size: 36px;
  margin-bottom: 20px;
}

.product-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  justify-items: center;
}

.review-item {
  background: #ffffff;
  border: 1px solid #eee;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  text-align: left;
  line-height: 1.3;
}
.review-item strong {
  color: #333;
}

/* Mobile menu */
@media (max-width: 992px) {
  .product-cards {
    grid-template-columns: repeat(2, 1fr); /* 2 per row on tablets */
  }

  .navbar .nav-links {
    gap: 20px;
  }

  .header-actions {
    gap: 10px;
  }

  .get-started-btn {
    padding: 8px 16px;
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .navbar .nav-links {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }

  .sign-in-btn {
    padding: 6px 12px;
    font-size: 14px;
  }

  .get-started-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}

@media (max-width: 600px) {
  .product-cards {
    grid-template-columns: 1fr; /* 1 per row on mobile */
  }
}
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #333;
  color: #fff;
  padding: 20px 30px;
  border-radius: 10px;
  font-size: 18px;
  display: none;
  z-index: 9999;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  animation: fadeInOut 3s ease forwards;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  10% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  90% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
}

.search-bar {
  margin-bottom: 20px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

#product-search {
  width: 300px;
  padding: 10px 12px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 16px;
}

#search-btn {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
}

#search-btn:hover {
  background: #f0f0f0;
}

.cart-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  color: #222;
  padding: 30px 24px;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.24);
  font-size: 18px;
  min-width: 320px;
  z-index: 99999;
  display: none;
}
.cart-menu h3 {
  margin-bottom: 20px;
  text-align: center;
}
#cart-items {
  margin-bottom: 18px;
}
#cart-items .cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
#cart-total {
  font-weight: bold;
  font-size: 20px;
  margin-bottom: 18px;
  text-align: right;
}
#close-cart-menu {
  display: block;
  margin: 0 auto;
}

.product-card {
  background: rgb(255, 255, 255);
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 250px;
  transition: all 0.2s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.product-card img {
  width: 100%;
  border-radius: 8px;
}

.product-card h3 {
  font-size: 18px;
  margin-top: 15px;
}

.product-card p {
  font-size: 16px;
  margin-top: 10px;
}

.buy-btn {
  background: #2196f3;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.buy-btn:hover {
  background: #1976d2;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

/* Review Section */
.reviews {
  background: rgba(255, 255, 255, 0.95);
  padding: 40px 20px;
  text-align: center;
  margin: 20px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.reviews h2 {
  font-size: 32px;
  margin-bottom: 10px;
}

.reviews p {
  margin-bottom: 20px;
  font-size: 18px;
  color: #555;
}

.review-form {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  text-align: left;
}

.review-form input,
.review-form textarea {
  padding: 14px 16px;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  font-size: 16px;
  margin-top: 5px;
  background: #f9fafb;
  transition: all 0.2s ease;
}

.review-form input:focus,
.review-form textarea:focus {
  outline: none;
  border-color: #2196f3;
  background: white;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.review-form button {
  background: #2196f3;
  padding: 16px;
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.review-form button:hover {
  background: #1976d2;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

footer {
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  padding: 30px 20px;
  text-align: center;
  margin: 20px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.social-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
}

.social-links li a {
  color: #666;
  font-size: 16px;
  transition: color 0.2s ease;
}

.social-links li a:hover {
  color: #2196f3;
}

/* Contact Page */
.contact {
  padding: 12px 20px;
  background-color: #fff;
  text-align: center;
}

.contact h2 {
  font-size: 36px;
  margin-bottom: 10px;
}

.contact p {
  margin-bottom: 30px;
  font-size: 18px;
  color: #555;
}

.contact-form {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
  align-items: stretch;
}

.contact-form label {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
  text-align: left;
  display: block;
}

.contact-form input,
.contact-form textarea {
  padding: 12px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 16px;
  margin-top: 2px;
}

.contact-form button {
  background-color: #ff9900;
  padding: 12px;
  border: none;
  border-radius: 5px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.contact-form button:hover {
  background-color: #e68a00;
}

/* Popup Styles */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #333;
  color: #fff;
  padding: 20px 30px;
  border-radius: 10px;
  font-size: 18px;
  display: none;
  z-index: 9999;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  animation: fadeInOut 3s ease forwards;
}

/* --- Contact and Review Form --- */
.contact-form,
.review-form {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
  align-items: stretch;
}

.contact-form label,
.review-form label {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
  text-align: left;
  display: block;
}

.contact-form input,
.contact-form textarea,
.review-form input,
.review-form textarea {
  padding: 12px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 16px;
  margin-top: 2px;
}

.contact-form button,
.review-form button {
  align-self: center;
  width: 80%;
  margin-top: 10px;
}

#reviews-list {
  margin-top: 20px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  background: #fafafa;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#reviews-list div {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.remove-item-btn {
  margin-left: 8px;
  background: #ff9900;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 4px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.remove-item-btn:hover {
  background: #e68a00;
}
.form-status {
  font-size: 0.9rem;
  margin-top: 4px;
  min-height: 1.2em;
}
.form-status.success {
  color: #0a7a28;
}
.form-status.error {
  color: #b00020;
}

/* Animation for popup */
@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  10% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  90% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
}
/* User Profile Styles - Global for all pages */
.user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2196f3, #1976d2);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.user-avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

/* User Dropdown Styles */
.user-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  overflow: hidden;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.dropdown-user-info strong {
  display: block;
  font-weight: 600;
  color: #1e293b;
  font-size: 15px;
  margin-bottom: 4px;
}

.dropdown-user-info span {
  color: #64748b;
  font-size: 13px;
}

.dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 20px;
  background: none;
  border: none;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.dropdown-item:hover {
  background: #f8fafc;
  color: #dc2626;
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  color: currentColor;
}

/* Legacy logout button styles for backward compatibility */
.logout-btn:not(.dropdown-item) {
  color: #64748b;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: 500;
  border: 1px solid rgba(100, 116, 139, 0.2);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.logout-btn:not(.dropdown-item):hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
  color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

/* Mobile responsive styles for user avatar */
@media (max-width: 768px) {
  .user-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .dropdown-menu {
    min-width: 200px;
    right: -10px;
  }
  
  .dropdown-header {
    padding: 12px 16px;
  }
  
  .dropdown-item {
    padding: 10px 16px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  
  .dropdown-menu {
    min-width: 180px;
    right: -20px;
  }
}
