/* Global Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f8f9fa;
  color: #333;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { width: 100%; display: block; }
button { cursor: pointer; border: none; font: inherit; }

/* Container */
.container {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
}

/* Header */
.header {
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-bar {
  background: #f0f0f0;
  padding: 0.5rem 0;
  font-size: 0.875rem;
}
.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-bar-phone {
  font-weight: 600;
  color: #333;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}
.logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: #333;
}
.nav-links {
  display: flex;
  gap: 1.5rem;
}
.nav-links a {
  color: #333;
  font-weight: 500;
  transition: color 0.2s ease;
}
.nav-links a:hover {
  color: #007bff;
}
.user-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.search-box {
  position: relative;
}
.search-input {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 20px;
  width: 200px;
  transition: width 0.3s ease;
}
.search-input:focus {
  width: 250px;
  outline: none;
  border-color: #007bff;
}
.cart-icon {
  position: relative;
  font-size: 1.25rem;
}
.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 1.25rem;
  height: 1.25rem;
  background: #ff6b6b;
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
}

/* Page */
.page {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}
.section-title {
  text-align: center;
  margin-bottom: 2rem;
}
.section-title h2 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 0.5rem;
}
.section-title p {
  color: #666;
}

/* Product Button */
.product-btn {
  background: #007bff;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: block;
  text-align: center;
  margin-top: 1rem;
}
.product-btn:hover {
  background: #0056b3;
  transform: translateY(-2px);
}

/* Footer */
.footer {
  background: #333;
  color: white;
  padding: 3rem 0;
  margin-top: 2rem;
}
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-section h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-links a {
  color: #ccc;
  transition: color 0.2s ease;
}
.footer-links a:hover {
  color: white;
}
.footer-bottom {
  border-top: 1px solid #555;
  padding-top: 2rem;
  text-align: center;
  color: #ccc;
  font-size: 0.875rem;
}

/* User Center */
.user-nav-link.active {
  background: #007bff;
  color: white !important;
}

.user-nav-link:hover {
  background: #f0f0f0;
}

.user-tab {
  display: none;
}

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

/* Responsive */
@media (max-width: 768px) {
  .top-bar-content {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  .nav {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  .user-actions {
    width: 100%;
    justify-content: center;
  }
  .search-input {
    width: 150px;
  }
  .search-input:focus {
    width: 200px;
  }
}

/* Promotions */
.promotions {
  background: #f8f9fa;
  padding: 1rem 0;
  border-bottom: 1px solid #e0e0e0;
}
.promo-banner {
  background: #007bff;
  color: white;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 1rem;
}
.promo-banner h3 {
  margin-bottom: 0.5rem;
}
.promo-banner p {
  margin-bottom: 1rem;
}
.promo-btn {
  background: white;
  color: #007bff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.promo-btn:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  background: #f0f8ff;
  padding: 3rem 0;
  text-align: center;
}
.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #333;
}
.hero p {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Categories */
.categories {
  padding: 3rem 0;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}
.category-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}
.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}
.category-image {
  height: 200px;
  overflow: hidden;
}
.category-image img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.category-card:hover .category-image img {
  transform: scale(1.05);
}
.category-content {
  padding: 1.5rem;
}
.category-content h3 {
  margin-bottom: 0.5rem;
  color: #333;
}
.category-content p {
  color: #666;
  margin-bottom: 1rem;
}
.category-link {
  color: #007bff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.category-link:hover {
  text-decoration: underline;
}

/* Featured Products */
.featured-products {
  padding: 3rem 0;
  background: #f8f9fa;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.product-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}
.product-image {
  height: 220px;
  overflow: hidden;
}
.product-image img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.product-card:hover .product-image img {
  transform: scale(1.05);
}
.product-content {
  padding: 1.5rem;
}
.product-content h3 {
  margin-bottom: 0.5rem;
  color: #333;
  font-size: 1.125rem;
}
.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #333;
  margin: 0.5rem 0;
}

/* Testimonials */
.testimonials {
  padding: 3rem 0;
}
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}
.testimonial-card {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.testimonial-content {
  margin-bottom: 1rem;
  font-style: italic;
  color: #666;
}
.testimonial-author {
  font-weight: 600;
  color: #333;
}

/* Newsletter */
.newsletter {
  background: #007bff;
  color: white;
  padding: 3rem 0;
  text-align: center;
}
.newsletter h2 {
  margin-bottom: 1rem;
}
.newsletter p {
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.newsletter-form {
  display: flex;
  justify-content: center;
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
}
.newsletter-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
}
.newsletter-btn {
  background: #333;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.newsletter-btn:hover {
  background: #555;
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  .newsletter-form {
    flex-direction: column;
    align-items: center;
  }
  .newsletter-input {
    width: 100%;
  }
}

/* Form Styles */
.form-container {
  max-width: 400px;
  margin: 0 auto;
}
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}
.form-group input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}
.form-footer {
  margin-top: 1rem;
  text-align: center;
}
.form-footer a {
  color: #007bff;
  font-weight: 500;
}
.form-footer a:hover {
  text-decoration: underline;
}

/* Cart Styles */
.cart-container {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #e0e0e0;
}
.cart-item:last-child {
  border-bottom: none;
}
.cart-item-info h4 {
  margin-bottom: 0.25rem;
  color: #333;
}
.cart-item-info p {
  color: #666;
  font-size: 0.875rem;
}
.cart-item-price {
  font-weight: 600;
  color: #333;
}
.cart-total {
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}
.cart-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.cart-actions .product-btn {
  flex: 1;
  min-width: 150px;
}
.cart-actions .checkout-btn {
  background: #28a745;
}
.cart-actions .checkout-btn:hover {
  background: #218838;
}

/* Checkout Styles */
.checkout-container {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.checkout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}
.checkout-section {
  margin-bottom: 2rem;
}
.checkout-section h3 {
  margin-bottom: 1.5rem;
  color: #333;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.form-row .form-group {
  margin-bottom: 0;
}
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  background: white;
}
.form-group select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}
.order-summary {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
}
.order-summary h3 {
  margin-bottom: 1.5rem;
  color: #333;
}
.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e0e0e0;
}
.order-item:last-child {
  border-bottom: none;
}
.order-item-info h4 {
  font-size: 0.875rem;
  color: #333;
  margin-bottom: 0.25rem;
}
.order-item-info p {
  font-size: 0.75rem;
  color: #666;
}
.order-item-price {
  font-weight: 600;
  color: #333;
}
.order-details {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}
.order-detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.order-detail-row.total {
  font-weight: 600;
  margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* User Center Styles */
.user-center-container {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 2rem;
}
.user-sidebar {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.user-sidebar h3 {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
  color: #333;
}
.user-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.user-nav-link {
  padding: 0.75rem;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s ease;
  display: block;
}
.user-nav-link:hover {
  background: #f0f0f0;
}
.user-nav-link.active {
  background: #007bff;
  color: white !important;
}
.user-content {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.user-tab {
  display: none;
}
.user-tab.active {
  display: block;
}
.user-tab h3 {
  margin-bottom: 1.5rem;
  color: #333;
}
.user-profile-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
}
.user-profile-card h4 {
  margin-bottom: 1rem;
  color: #333;
}
.user-profile-details {
  margin-bottom: 1rem;
}
.user-profile-details p {
  margin-bottom: 0.5rem;
}
.user-profile-details strong {
  font-weight: 600;
  color: #333;
}
.empty-state {
  text-align: center;
  padding: 3rem;
}
.order-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.order-header-info h4 {
  margin-bottom: 0.25rem;
  color: #333;
}
.order-header-info p {
  font-size: 0.875rem;
  color: #666;
}
.order-header-price {
  font-weight: 600;
  color: #333;
}
.order-items {
  margin-bottom: 1rem;
}
.order-items h5 {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: #333;
}
.order-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.order-item:last-child {
  border-bottom: none;
}
.order-details {
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
  font-size: 0.875rem;
}
.order-detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}
.order-detail-row.total {
  font-weight: 600;
  margin-top: 0.5rem;
}
.payment-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.payment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.payment-header-info h4 {
  margin-bottom: 0.25rem;
  color: #333;
}
.payment-header-info p {
  font-size: 0.875rem;
  color: #666;
}
.payment-header-status {
  font-weight: 600;
}
.payment-header-status.success {
  color: #28a745;
}
.payment-header-status.failed {
  color: #dc3545;
}
.payment-details {
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
  font-size: 0.875rem;
}
.payment-detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
  .user-center-container {
    grid-template-columns: 1fr;
  }
  .user-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .user-nav-link {
    flex: 1;
    min-width: 120px;
    text-align: center;
  }
}

/* User Info Dropdown */
.user-info {
  margin-left: 1rem;
  position: relative;
}
.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  padding: 1rem;
  min-width: 200px;
  z-index: 1000;
}
.user-dropdown.show {
  display: block;
}
.dropdown-user-info {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}
.dropdown-link {
  display: block;
  padding: 0.5rem 0;
  color: #333;
  text-decoration: none;
  transition: color 0.2s ease;
}
.dropdown-link:hover {
  color: #007bff;
}
.dropdown-link.logout {
  color: #666;
  margin-top: 0.5rem;
}
.dropdown-link.logout:hover {
  color: #dc3545;
}
