/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --secondary: #f97316;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --background: #ffffff;
  --foreground: #0f172a;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --border: #e2e8f0;
  --card-background: #ffffff;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --card-hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
}

/* App container */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navigation */
.navigation {
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.nav-logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

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

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

.cart-icon {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
}

.hero-content {
  max-width: 1400px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease-out;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2rem;
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.hero-cta {
  display: inline-block;
  background: white;
  color: var(--primary);
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

/* Featured Products Carousel */
.section {
  max-width: 1400px;
  margin: 4rem auto;
  padding: 0 2rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--foreground);
}

.carousel-container {
  position: relative;
  overflow: hidden;
}

.carousel {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.3s ease;
}

.carousel-card {
  min-width: calc(33.333% - 1rem);
  background: var(--card-background);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all 0.3s;
  cursor: pointer;
}

.carousel-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-hover-shadow);
}

.carousel-card-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.carousel-card-content {
  padding: 1.5rem;
}

.carousel-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.carousel-card-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.carousel-card-original-price {
  font-size: 1rem;
  text-decoration: line-through;
  color: var(--muted-foreground);
  margin-left: 0.5rem;
}

.carousel-badge {
  display: inline-block;
  background: var(--danger);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.carousel-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

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

.carousel-btn:hover {
  background: var(--primary-dark);
}

.carousel-btn:disabled {
  background: var(--muted-foreground);
  cursor: not-allowed;
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.category-card {
  background: var(--muted);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.category-card:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-4px);
}

.category-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.category-name {
  font-size: 1.25rem;
  font-weight: 600;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.product-card {
  background: var(--card-background);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all 0.3s;
  cursor: pointer;
}

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

.product-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  position: relative;
}

.product-content {
  padding: 1.5rem;
}

.product-category {
  display: inline-block;
  background: var(--muted);
  color: var(--muted-foreground);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.product-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.product-rating-value {
  font-weight: 600;
  color: var(--warning);
}

.product-rating-count {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.product-original-price {
  font-size: 1rem;
  text-decoration: line-through;
  color: var(--muted-foreground);
  margin-left: 0.5rem;
}

.add-to-cart-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.add-to-cart-btn:hover {
  background: var(--primary-dark);
}

/* Trust Section */
.trust-section {
  background: var(--muted);
  padding: 3rem 2rem;
  margin: 4rem 0;
}

.trust-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.trust-icon {
  font-size: 2.5rem;
}

.trust-text h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.trust-text p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

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

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.footer-section a {
  display: block;
  color: #94a3b8;
  text-decoration: none;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: color 0.2s;
}

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

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 2rem;
  text-align: center;
  color: #94a3b8;
}

.payment-methods-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #334155;
}

.payment-method-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border: 1px solid #334155;
  transition: all 0.3s;
}

.payment-method-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.payment-icon {
  font-size: 1.5rem;
}

.payment-name {
  font-weight: 600;
  font-size: 1rem;
  color: white;
}

/* Page visibility */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* Product Detail Page */
.product-detail {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.product-detail-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.product-detail-image {
  width: 100%;
  height: 500px;
  object-fit: cover;
  border-radius: 12px;
}

.product-detail-info h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

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

.product-detail-price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.product-detail-original-price {
  font-size: 1.5rem;
  text-decoration: line-through;
  color: var(--muted-foreground);
  margin-left: 1rem;
}

.product-detail-description {
  font-size: 1.1rem;
  color: var(--muted-foreground);
  margin: 2rem 0;
  line-height: 1.8;
}

.product-detail-features {
  margin-bottom: 2rem;
}

.product-detail-features h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.product-detail-features ul {
  list-style: none;
}

.product-detail-features li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.product-detail-features li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

.product-detail-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.product-detail-actions button {
  flex: 1;
  padding: 1rem 2rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--muted);
  color: var(--foreground);
}

.btn-secondary:hover {
  background: var(--border);
}

/* Cart Page */
.cart-page {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.cart-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}

.cart-items {
  background: var(--card-background);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
}

.cart-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

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

.cart-item-image {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item-details {
  flex: 1;
}

.cart-item-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.cart-item-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.quantity-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  background: var(--muted);
}

.cart-summary {
  background: var(--card-background);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  position: sticky;
  top: 100px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.summary-row.total {
  font-size: 1.5rem;
  font-weight: 700;
  border-bottom: none;
  padding-top: 1.5rem;
  margin-top: 1rem;
}

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

.btn-checkout:hover {
  background: #16a34a;
  transform: translateY(-2px);
}

/* Checkout Page */
.checkout-page {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.checkout-form {
  background: var(--card-background);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
}

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

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

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

/* Payment Page */
.payment-page {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.payment-card {
  background: var(--card-background);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.payment-card:hover,
.payment-card.selected {
  border-color: var(--primary);
  box-shadow: var(--card-hover-shadow);
}

.payment-card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.payment-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.payment-card p {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Success Page */
.success-page {
  max-width: 800px;
  margin: 4rem auto;
  padding: 0 2rem;
  text-align: center;
}

.success-icon {
  font-size: 5rem;
  color: var(--success);
  margin-bottom: 2rem;
}

.success-page h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.success-page p {
  font-size: 1.1rem;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
}

/* Legal Pages */
.legal-page {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.legal-page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.legal-page h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.legal-page p {
  margin-bottom: 1rem;
  line-height: 1.8;
  color: var(--muted-foreground);
}

.legal-page ul {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.legal-page li {
  margin-bottom: 0.5rem;
  line-height: 1.8;
  color: var(--muted-foreground);
}

/* Responsive */
@media (max-width: 1024px) {
  .product-detail-container {
    grid-template-columns: 1fr;
  }

  .cart-container {
    grid-template-columns: 1fr;
  }

  .carousel-card {
    min-width: calc(50% - 1rem);
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .carousel-card {
    min-width: calc(100% - 1rem);
  }

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

  .payment-methods {
    grid-template-columns: 1fr;
  }

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

  .payment-methods-footer {
    flex-direction: column;
    gap: 1rem;
  }

  .payment-method-item {
    width: 100%;
    justify-content: center;
  }
}

/* Back button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--muted);
  color: var(--foreground);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1.5rem;
}

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

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--muted-foreground);
  margin-bottom: 2rem;
}
