/* Import Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

/* CSS Variables for Theme */
:root {
  --primary-color: #2563eb;
  --secondary-color: #7c3aed;
  --accent-color: #ef4444;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --bg-color: #ffffff;
  --surface-color: #f8fafc;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg-color: #111827;
  --surface-color: #1f2937;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --border-color: #374151;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-color);
  overflow-x: hidden;
  transition: var(--transition);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Styles */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .header {
  background: rgba(17, 24, 39, 0.95);
}

.navbar {
  padding: 1rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px 0 10px;
}

.nav-logo h2 {
  color: var(--primary-color);
  font-size: 1.8rem;
  font-weight: 700;
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  padding: 0.5rem 0;
}

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

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-container {
  position: relative;
}

.search-container input {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 25px;
  outline: none;
  transition: var(--transition);
  width: 250px;
  background: var(--bg-color);
  color: var(--text-primary);
}

.search-container input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1001;
  display: none;
}

.suggestion-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.suggestion-item:hover {
  background: var(--surface-color);
}

.suggestion-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

.theme-toggle,
.cart-icon,
.wishlist-icon {
  position: relative;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 50%;
  transition: var(--transition);
  color: var(--text-primary);
}

.theme-toggle:hover,
.cart-icon:hover,
.wishlist-icon:hover {
  background-color: var(--surface-color);
  transform: scale(1.1);
}

.cart-count,
.wishlist-count {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent-color);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

.user-menu {
  position: relative;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.user-avatar:hover {
  transform: scale(1.1);
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  min-width: 250px;
  z-index: 1001;
  display: none;
  padding: 1rem;
}

.user-info {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
}

.user-email {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.user-points {
  font-size: 0.875rem;
  color: var(--primary-color);
  font-weight: 500;
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-buttons button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary-color);
  background: transparent;
  color: var(--primary-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.auth-buttons button:first-child {
  background: var(--primary-color);
  color: white;
}

.auth-buttons button:hover {
  background: var(--primary-color);
  color: white;
}

.user-menu-items {
  display: flex;
  flex-direction: column;
}

.user-menu-items a {
  padding: 0.75rem 0;
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-menu-items a:hover {
  color: var(--primary-color);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 3px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  transition: 0.3s;
}

/* Hero Section */
.hero {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: 120px 20px 80px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.1)" points="0,1000 1000,0 1000,1000"/></svg>');
  background-size: cover;
}

.hero-content {
  flex: 1;
  max-width: 600px;
  z-index: 2;
  position: relative;
  animation: slideInLeft 1s ease-out;
}

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

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

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #fbbf24;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.8;
}

.cta-button {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cta-button:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

.hero-image {
  flex: 1;
  text-align: center;
  z-index: 2;
  position: relative;
  animation: slideInRight 1s ease-out;
}

.hero-image img {
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Flash Sale Section */
.flash-sale {
  background: linear-gradient(45deg, #ff6b6b, #feca57);
  color: white;
  padding: 2rem 0;
  position: relative;
  overflow: hidden;
}

.flash-sale::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 3s infinite;
}

.flash-sale-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.flash-sale-info h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.countdown {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.time-unit {
  text-align: center;
  background: rgba(255, 255, 255, 0.2);
  padding: 1rem;
  border-radius: var(--border-radius);
  min-width: 60px;
}

.time-unit span {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.time-unit label {
  font-size: 0.875rem;
  opacity: 0.9;
}

.flash-sale-btn {
  background: white;
  color: #ff6b6b;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
}

.flash-sale-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Products Section */
.products-section {
  padding: 80px 0;
  background: var(--surface-color);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
}

.view-btn {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-secondary);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.view-btn.active,
.view-btn:hover {
  background: var(--primary-color);
  color: white;
}

.filters-container {
  margin-bottom: 3rem;
}

.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-secondary);
  border-radius: 25px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.advanced-filters {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1.5rem;
  background: var(--bg-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.price-filter {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 200px;
}

.price-range {
  display: flex;
  gap: 1rem;
}

.price-range input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  outline: none;
}

.price-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
}

.price-display {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.sort-filter select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-color);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.products-grid.list-view {
  grid-template-columns: 1fr;
}

.product-card {
  background: var(--bg-color);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  border: 1px solid var(--border-color);
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.product-card.list-view {
  display: flex;
  align-items: center;
  padding: 1rem;
}

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

.product-card.list-view .product-image {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
  margin-right: 1rem;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 2;
}

.product-actions-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transition: var(--transition);
}

.product-card:hover .product-actions-overlay {
  opacity: 1;
}

.action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.product-info {
  padding: 1.5rem;
  flex: 1;
}

.product-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.product-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stars {
  display: flex;
  gap: 2px;
}

.star {
  color: #fbbf24;
  font-size: 0.875rem;
}

.star.empty {
  color: var(--border-color);
}

.rating-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.product-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.current-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-color);
}

.original-price {
  font-size: 1rem;
  color: var(--text-secondary);
  text-decoration: line-through;
}

.discount-percent {
  background: var(--accent-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.product-actions {
  display: flex;
  gap: 0.5rem;
}

.add-to-cart,
.view-details {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.add-to-cart {
  background: var(--primary-color);
  color: white;
}

.add-to-cart:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.view-details {
  background: var(--surface-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.view-details:hover {
  background: var(--border-color);
}

.load-more-container {
  text-align: center;
}

.load-more-btn {
  padding: 1rem 2rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.load-more-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
}

/* Compare Section */
.compare-section {
  padding: 80px 0;
  background: var(--bg-color);
}

.compare-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.compare-item {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

/* About Section */
.about-section {
  padding: 80px 0;
  background: var(--bg-color);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.about-text p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.features {
  display: grid;
  gap: 1.5rem;
}

.feature {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface-color);
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.feature i {
  font-size: 2rem;
  color: var(--primary-color);
  width: 60px;
  text-align: center;
}

.feature h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.feature p {
  color: var(--text-secondary);
  margin: 0;
}

/* Contact Section */
.contact-section {
  padding: 80px 0;
  background: var(--surface-color);
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 3rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.contact-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.contact-item i {
  font-size: 1.5rem;
  color: var(--primary-color);
  width: 40px;
  text-align: center;
}

.contact-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.contact-item p {
  color: var(--text-secondary);
  margin: 0;
}

.contact-form {
  background: var(--bg-color);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  outline: none;
  transition: var(--transition);
  font-family: inherit;
  background: var(--bg-color);
  color: var(--text-primary);
  font-size: 1rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.contact-form button {
  width: 100%;
  padding: 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
}

.contact-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.contact-item p {
  color: var(--text-secondary);
  margin: 0;
}

.contact-form {
  background: var(--bg-color);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  outline: none;
  transition: var(--transition);
  font-family: inherit;
  background: var(--bg-color);
  color: var(--text-primary);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.contact-form button {
  width: 100%;
  padding: 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.contact-form button:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
}

/* Footer */
.footer {
  background: var(--text-primary);
  color: white;
  padding: 3rem 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
  margin-bottom: 1rem;
  color: #f9fafb;
}

.footer-section p {
  color: #d1d5db;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #374151;
  color: white;
  border-radius: 50%;
  text-decoration: none;
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: #d1d5db;
  text-decoration: none;
  transition: var(--transition);
}

.footer-section ul li a:hover {
  color: var(--primary-color);
}

.footer-section ul li i {
  margin-right: 0.5rem;
  color: var(--primary-color);
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 1rem;
  text-align: center;
  color: #9ca3af;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-color);
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideInUp 0.3s ease;
  border: 1px solid var(--border-color);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  color: var(--text-primary);
  font-weight: 600;
}

.close-modal {
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-modal:hover {
  color: var(--accent-color);
  background: var(--surface-color);
}

/* Auth Modal */
.auth-modal-content {
  max-width: 400px;
}

.auth-form {
  padding: 2rem;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-primary);
  font-weight: 600;
}

.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-group input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  outline: none;
  transition: var(--transition);
  background: var(--bg-color);
  color: var(--text-primary);
  font-size: 1rem;
}

.form-group input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  z-index: 2;
  pointer-events: none;
}

/* Fix placeholder text alignment */
.form-group input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Ensure text doesn't overlap with icon */
.form-group input:not(:placeholder-shown) {
  padding-left: 3rem;
}

.auth-btn {
  width: 100%;
  padding: 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.auth-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.auth-links {
  text-align: center;
  margin-top: 1.5rem;
}

.auth-links a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* Cart Modal */
.cart-modal-content {
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.cart-items {
  flex: 1;
  max-height: 400px;
  overflow-y: auto;
  padding: 1rem;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

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

.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--border-radius);
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0; /* Allow text to wrap */
}

.cart-item-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.quantity-display {
  min-width: 30px;
  text-align: center;
  font-weight: 500;
  padding: 0 0.5rem;
}

.remove-item {
  color: var(--accent-color);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition);
}

.remove-item:hover {
  background: rgba(239, 68, 68, 0.1);
}

.cart-summary {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--surface-color);
}

.coupon-section {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.coupon-section input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  outline: none;
  background: var(--bg-color);
  color: var(--text-primary);
}

.coupon-section button {
  padding: 0.75rem 1.5rem;
  background: var(--success-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.coupon-section button:hover {
  background: #059669;
}

.cart-totals {
  margin-bottom: 1.5rem;
}

.total-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.discount-line {
  color: var(--success-color);
}

.final-total {
  font-size: 1.2rem;
  font-weight: 700;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.checkout-btn {
  width: 100%;
  padding: 1rem;
  background: var(--success-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.checkout-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}

.checkout-btn:disabled {
  background: var(--text-secondary);
  cursor: not-allowed;
  transform: none;
}

/* Wishlist Modal */
.wishlist-items {
  padding: 1rem;
  max-height: 500px;
  overflow-y: auto;
}

.wishlist-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.wishlist-item:hover {
  background: var(--surface-color);
}

.wishlist-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--border-radius);
}

.wishlist-item-info {
  flex: 1;
}

.wishlist-item-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.wishlist-item-price {
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.wishlist-item-actions {
  display: flex;
  gap: 0.5rem;
}

.wishlist-item-actions button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
}

.add-to-cart-from-wishlist {
  background: var(--primary-color);
  color: white;
}

.add-to-cart-from-wishlist:hover {
  background: #1d4ed8;
}

.remove-from-wishlist {
  background: var(--surface-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.remove-from-wishlist:hover {
  background: var(--accent-color);
  color: white;
}

/* Product Detail Modal - REDESIGNED với Typography tốt hơn */
.product-modal-content {
  max-width: 1100px;
  max-height: 95vh;
  width: 95%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-detail {
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

/* Product Detail Header - Compact hơn */
.product-detail-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--surface-color);
}

.product-breadcrumb {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.product-breadcrumb i {
  margin: 0 0.25rem;
  font-size: 0.7rem;
}

.product-sku-brand {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
}

.product-sku {
  color: var(--text-secondary);
}

.product-brand {
  color: var(--text-secondary);
}

/* Product Detail Main - Tối ưu spacing */
.product-detail-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 1.5rem;
  min-height: 400px;
}

/* Product Images - Compact hơn */
.product-detail-images {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.main-image-container {
  position: relative;
  width: 100%;
  height: 350px;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--surface-color);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.main-image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.main-image-container img:hover {
  transform: scale(1.05);
}

.wishlist-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow);
}

.wishlist-btn:hover,
.wishlist-btn.active {
  background: var(--accent-color);
  color: white;
  transform: scale(1.1);
}

.product-gallery {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.gallery-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--border-radius);
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  opacity: 0.7;
}

.gallery-thumb.active {
  border-color: var(--primary-color);
  opacity: 1;
  transform: scale(1.05);
}

.gallery-thumb:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* Product Info - Typography được tối ưu */
.product-detail-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  line-height: 1.3;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.product-rating-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rating-score {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.rating-count {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.product-stock {
  display: flex;
  align-items: center;
}

.stock-status {
  padding: 0.4rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stock-status.in-stock {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.stock-status.out-of-stock {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-color);
}

.product-price-section {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.price-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.current-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-color);
  margin: 0;
}

.original-price {
  font-size: 1.2rem;
  color: var(--text-secondary);
  text-decoration: line-through;
}

.discount-badge {
  background: var(--accent-color);
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.75rem;
}

.price-info {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.warranty-info,
.shipping-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.warranty-info i,
.shipping-info i {
  color: var(--success-color);
}

.product-description-short {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.product-description-short p {
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  font-size: 0.9rem;
}

.product-features {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.product-features h4 {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.features-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feature-tag {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: var(--surface-color);
  border-radius: 15px;
  font-size: 0.8rem;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.feature-tag i {
  color: var(--success-color);
  font-size: 0.7rem;
}

/* Product Options - Compact hơn */
.product-options-section {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.option-group {
  margin-bottom: 1rem;
}

.option-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.color-options,
.storage-options,
.memory-options,
.connectivity-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.color-option,
.storage-option,
.memory-option,
.connectivity-option {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-primary);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  min-width: 50px;
  text-align: center;
  font-size: 0.85rem;
}

.color-option.active,
.storage-option.active,
.memory-option.active,
.connectivity-option.active {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
  transform: translateY(-1px);
}

.color-option:hover,
.storage-option:hover,
.memory-option:hover,
.connectivity-option:hover {
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

/* Product Actions - Compact hơn */
.product-actions-section {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.quantity-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.quantity-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.quantity-selector {
  display: flex;
  align-items: center;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--bg-color);
}

.quantity-btn {
  width: 35px;
  height: 35px;
  border: none;
  background: var(--surface-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  font-size: 1rem;
}

.quantity-btn:hover {
  background: var(--primary-color);
  color: white;
}

.quantity-selector input {
  width: 50px;
  height: 35px;
  border: none;
  text-align: center;
  background: var(--bg-color);
  color: var(--text-primary);
  outline: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-add-cart,
.btn-buy-now {
  flex: 1;
  min-width: 150px;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-add-cart {
  background: var(--primary-color);
  color: white;
}

.btn-add-cart:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-buy-now {
  background: var(--accent-color);
  color: white;
}

.btn-buy-now:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-add-cart:disabled,
.btn-buy-now:disabled {
  background: var(--text-secondary);
  cursor: not-allowed;
  transform: none;
}

/* Product Services - Compact grid */
.product-services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  padding: 1rem 0;
}

.service-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.service-item i {
  font-size: 1.2rem;
  color: var(--primary-color);
  width: 24px;
  text-align: center;
}

.service-item strong {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.1rem;
  font-size: 0.85rem;
}

.service-item span {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* Product Tabs - Compact hơn */
.product-detail-tabs {
  border-top: 2px solid var(--border-color);
  margin-top: 1.5rem;
}

.tab-navigation {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-color);
  background: var(--surface-color);
  padding: 0 1.5rem;
}

.tab-btn {
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 3px solid transparent;
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: var(--bg-color);
}

.tab-btn:hover {
  color: var(--primary-color);
  background: var(--bg-color);
}

.tab-content-container {
  background: var(--bg-color);
}

.tab-content {
  display: none;
  padding: 1.5rem;
}

.tab-content.active {
  display: block;
}

/* Description Tab - Typography tối ưu */
.description-content h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.2rem;
}

.description-text {
  margin-bottom: 1.5rem;
}

.description-text p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.product-highlights {
  margin-bottom: 1.5rem;
}

.product-highlights h4 {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
}

.highlights-list {
  list-style: none;
  padding: 0;
}

.highlights-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.85rem;
}

.highlights-list li i {
  color: var(--success-color);
  font-size: 0.75rem;
}

.product-tags h4 {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.product-tag {
  padding: 0.4rem 0.8rem;
  background: var(--surface-color);
  color: var(--text-primary);
  border-radius: 15px;
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
}

/* Specifications Tab - Compact table */
.specifications-content h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.2rem;
}

.specs-table {
  display: grid;
  gap: 0.5rem;
}

.spec-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-color);
  border-radius: var(--border-radius);
  border-left: 3px solid var(--primary-color);
}

.spec-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.85rem;
}

.spec-value {
  color: var(--text-secondary);
  text-align: right;
  font-size: 0.85rem;
}

/* Reviews Tab - Compact layout */
.reviews-content {
  max-height: 500px;
  overflow-y: auto;
}

.reviews-summary {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--surface-color);
  border-radius: var(--border-radius);
}

.rating-overview {
  text-align: center;
  min-width: 120px;
}

.overall-rating {
  margin-bottom: 0.75rem;
}

.rating-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary-color);
  display: block;
}

.rating-stars {
  margin: 0.4rem 0;
}

.rating-text {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.rating-breakdown {
  flex: 1;
}

.rating-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.star-label {
  min-width: 40px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.rating-bar-fill {
  flex: 1;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.rating-bar-progress {
  height: 100%;
  background: #fbbf24;
  transition: width 0.3s ease;
}

.star-count {
  min-width: 25px;
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.reviews-list {
  margin-bottom: 1.5rem;
}

.review-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.reviewer-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.reviewer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.reviewer-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.review-date {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.review-rating {
  display: flex;
  gap: 1px;
}

.review-content {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.review-actions {
  display: flex;
  gap: 0.75rem;
}

.review-action {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.8rem;
}

.review-action:hover {
  color: var(--primary-color);
}

.no-reviews {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.no-reviews i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.no-reviews h4 {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-size: 1rem;
}

.add-review-btn {
  width: 100%;
  padding: 0.8rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.add-review-btn:hover {
  background: #1d4ed8;
}

.login-to-review {
  text-align: center;
  padding: 1rem;
  background: var(--surface-color);
  border-radius: var(--border-radius);
  margin-top: 0.75rem;
}

.login-link {
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: none;
}

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

/* Related Products - Compact grid */
.related-products-section {
  padding: 1.5rem;
  border-top: 2px solid var(--border-color);
  background: var(--surface-color);
}

.related-title {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.related-title i {
  color: var(--primary-color);
}

.related-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.related-product-card {
  background: var(--bg-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid var(--border-color);
}

.related-product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.related-product-image {
  position: relative;
  height: 150px;
  overflow: hidden;
}

.related-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.related-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent-color);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}

.related-product-info {
  padding: 0.75rem;
}

.related-product-name {
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-product-rating {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}

.related-product-rating span {
  color: var(--text-secondary);
}

.related-product-price {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.related-current-price {
  font-weight: 700;
  color: var(--accent-color);
  font-size: 0.95rem;
}

.related-original-price {
  color: var(--text-secondary);
  text-decoration: line-through;
  font-size: 0.8rem;
}

/* Checkout Modal */
.checkout-modal-content {
  max-width: 800px;
  max-height: 90vh;
}

.checkout-steps {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--surface-color);
}

.step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.step.active {
  color: var(--primary-color);
}

.step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: var(--transition);
}

.step.active .step-number {
  background: var(--primary-color);
  color: white;
}

.checkout-form {
  padding: 2rem;
}

.form-section {
  margin-bottom: 2rem;
}

.form-section h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  outline: none;
  transition: var(--transition);
  background: var(--bg-color);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.payment-methods {
  display: grid;
  gap: 1rem;
}

.payment-method {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.payment-method:hover,
.payment-method.selected {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.05);
}

.payment-method input[type="radio"] {
  width: auto;
}

.payment-icon {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.checkout-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.checkout-back,
.checkout-next {
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.checkout-back {
  background: var(--surface-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.checkout-back:hover {
  background: var(--border-color);
}

.checkout-next {
  background: var(--primary-color);
  color: white;
}

.checkout-next:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* Chat Support */
.chat-support {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1500;
}

.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  font-size: 1.5rem;
}

.chat-toggle:hover {
  transform: scale(1.1);
  background: #1d4ed8;
}

.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 400px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 1rem;
  background: var(--primary-color);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h4 {
  font-weight: 600;
}

.chat-header span {
  cursor: pointer;
  font-size: 1.5rem;
  transition: var(--transition);
}

.chat-header span:hover {
  opacity: 0.7;
}

.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 15px;
  line-height: 1.4;
}

.bot-message {
  background: var(--surface-color);
  color: var(--text-primary);
  align-self: flex-start;
}

.user-message {
  background: var(--primary-color);
  color: white;
  align-self: flex-end;
}

.chat-input {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.5rem;
}

.chat-input input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  outline: none;
  background: var(--bg-color);
  color: var(--text-primary);
}

.chat-input button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--primary-color);
  color: white;
  cursor: pointer;
  transition: var(--transition);
}

.chat-input button:hover {
  background: #1d4ed8;
}

/* Notifications */
.notifications {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  pointer-events: none;
}

.notification {
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  max-width: 350px;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  animation: slideInRight 0.3s ease;
  pointer-events: auto;
  word-wrap: break-word;
}

.notification.success {
  background: var(--success-color);
  color: white;
}

.notification.error {
  background: var(--accent-color);
  color: white;
}

.notification.warning {
  background: var(--warning-color);
  color: white;
}

.notification.info {
  background: var(--primary-color);
  color: white;
}

.notification-icon {
  font-size: 1.2rem;
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.notification-message {
  font-size: 0.875rem;
  opacity: 0.9;
}

.notification-close {
  cursor: pointer;
  opacity: 0.7;
  transition: var(--transition);
}

.notification-close:hover {
  opacity: 1;
}

/* Loading Spinner */
.loading {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 3000;
  justify-content: center;
  align-items: center;
}

[data-theme="dark"] .loading {
  background: rgba(17, 24, 39, 0.9);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--border-color);
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition);
  z-index: 1000;
  box-shadow: var(--shadow);
}

.back-to-top:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translate(-50%, -30%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Mobile Responsive cho Product Detail */
@media (max-width: 768px) {
  .product-modal-content {
    max-width: 95%;
    margin: 1rem;
    max-height: 95vh;
  }

  .product-detail-main {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
  }

  .main-image-container {
    height: 250px;
  }

  .product-title {
    font-size: 1.3rem;
  }

  .current-price {
    font-size: 1.5rem;
  }

  .product-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .action-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .quantity-section {
    justify-content: center;
  }

  .btn-add-cart,
  .btn-buy-now {
    min-width: auto;
  }

  .tab-navigation {
    padding: 0 1rem;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .tab-btn {
    padding: 0.8rem 1rem;
    white-space: nowrap;
    font-size: 0.8rem;
  }

  .tab-content {
    padding: 1rem;
  }

  .spec-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .spec-value {
    text-align: left;
    font-weight: 500;
  }

  .reviews-summary {
    flex-direction: column;
    gap: 0.75rem;
  }

  .related-products-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
  }

  .product-services {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .product-detail-main {
    padding: 0.75rem;
    gap: 1rem;
  }

  .main-image-container {
    height: 200px;
  }

  .gallery-thumb {
    width: 45px;
    height: 45px;
  }

  .product-title {
    font-size: 1.1rem;
  }

  .current-price {
    font-size: 1.3rem;
  }

  .color-options,
  .storage-options,
  .memory-options,
  .connectivity-options {
    gap: 0.4rem;
  }

  .color-option,
  .storage-option,
  .memory-option,
  .connectivity-option {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .tab-content {
    padding: 0.75rem;
  }

  .related-products-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .hero-stats {
    gap: 1rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .advanced-filters {
    flex-direction: column;
    align-items: center;
  }

  .checkout-steps {
    gap: 1rem;
  }

  .step-title {
    display: none;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--bg-color);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 2rem;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--border-color);
  }

  .nav-menu.active {
    left: 0;
  }

  .search-container input {
    width: 150px;
    font-size: 0.875rem;
  }

  .nav-icons {
    gap: 0.75rem;
  }

  .user-dropdown {
    right: -10px;
    min-width: 200px;
  }

  .modal-content {
    width: 95%;
    margin: 1rem;
    max-height: 90vh;
  }

  .auth-modal-content {
    max-width: 350px;
  }

  .form-group input {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .hero {
    flex-direction: column;
    text-align: center;
    padding: 100px 20px 60px;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-stats {
    justify-content: center;
  }

  .flash-sale-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .countdown {
    justify-content: center;
  }

  .section-header {
    flex-direction: column;
    gap: 1rem;
  }

  .about-content,
  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .checkout-actions {
    flex-direction: column;
  }

  .chat-window {
    width: 300px;
    height: 350px;
  }

  .modal-content {
    width: 95%;
    margin: 1rem;
  }

  .notifications {
    right: 10px;
    left: 10px;
  }

  .notification {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .nav-icons {
    gap: 0.5rem;
  }

  .search-container input {
    width: 120px;
    font-size: 0.875rem;
  }

  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero-stats {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }

  .stat {
    min-width: 80px;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .filter-buttons {
    gap: 0.5rem;
  }

  .flash-sale-content {
    padding: 1rem;
  }

  .countdown {
    gap: 0.5rem;
  }

  .time-unit {
    min-width: 45px;
    padding: 0.5rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .advanced-filters {
    padding: 1rem;
    gap: 1rem;
  }

  .price-filter {
    min-width: 100%;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .product-actions {
    flex-direction: column;
  }

  .flash-sale-info h2 {
    font-size: 1.5rem;
  }

  .time-unit {
    min-width: 50px;
    padding: 0.75rem;
  }

  .time-unit span {
    font-size: 1.2rem;
  }

  .chat-support {
    bottom: 1rem;
    right: 1rem;
  }

  .chat-toggle {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .chat-window {
    width: calc(100vw - 2rem);
    right: -1rem;
  }

  .back-to-top {
    bottom: 1rem;
    left: 1rem;
    width: 45px;
    height: 45px;
  }
}

/* Print Styles */
@media print {
  .header,
  .chat-support,
  .back-to-top,
  .modal,
  .notifications {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .hero {
    background: white !important;
    color: black !important;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  }

  .product-card {
    border: 2px solid var(--border-color);
  }

  .button,
  .btn {
    border: 2px solid currentColor;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero::before {
    animation: none;
  }

  .flash-sale::before {
    animation: none;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}
.hidden {
  display: none !important;
}
.visible {
  display: block !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Selection */
::selection {
  background: rgba(37, 99, 235, 0.2);
  color: var(--text-primary);
}

/* Focus Styles */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}