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

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

.container {
  min-height: 100vh;
  background-color: var(--background-primary);
}

/* Header Styles */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: rgba(247, 243, 233, 0.95);
  backdrop-filter: blur(10px);
  padding: 20px 40px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.store-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
  text-decoration: none;
}

.store-title:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.header-social {
  display: flex;
  align-items: center;
  gap: 12px;
}

.instagram-link {
  display: inline-block;
  font-size: 24px;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.cart-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  cursor: pointer;
  transition: opacity 0.2s ease;
  text-decoration: none;
}

.cart-indicator:hover {
  opacity: 0.7;
  color: var(--primary-color);
  text-decoration: none;
}

.cart-icon {
  width: 24px;
  height: 24px;
}

.main-content {
  padding-top: 100px;
  min-height: 100vh;
  padding-left: 40px;
  padding-right: 40px;
  padding-bottom: 40px;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  padding: 20px 0;
}

.product-card {
  background: var(--background-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

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

.product-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.product-info {
  padding: 20px;
}

.product-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.product-description {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.product-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0 0 12px 0;
}

.product-stock {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 16px 0;
}

.product-stock.low {
  color: var(--warning-color);
  font-weight: 600;
}

.product-stock.out {
  color: var(--error-color);
  font-weight: 600;
}

/* Loading States */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-container p {
  color: var(--text-secondary);
  font-size: 16px;
  margin: 0;
}

/* Error States */
.error-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  padding: 20px;
}

.error-message {
  text-align: center;
  max-width: 500px;
}

.error-message h2 {
  color: var(--error-color);
  margin: 0 0 10px 0;
  font-size: 24px;
}

.error-message p {
  color: var(--text-secondary);
  margin: 0 0 20px 0;
  font-size: 16px;
  line-height: 1.5;
}

/* Empty States */
.empty-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  padding: 20px;
}

.empty-container h2 {
  color: var(--text-primary);
  margin: 0 0 10px 0;
  font-size: 24px;
}

.empty-container p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 16px;
}

/* Cart Overlay */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-medium);
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
}

.cart-sidebar {
  width: 600px;
  max-width: 90vw;
  background: var(--background-primary);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.cart-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--background-secondary);
}

.cart-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--text-primary);
}

.cart-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-items {
  margin-bottom: 20px;
}

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

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

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

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

.cart-item-details h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: var(--text-primary);
}

.cart-item-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 12px 0;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quantity-controls span {
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cart-item-total {
  text-align: right;
}

.cart-item-total p {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 10px 0;
}

.cart-total {
  border-top: 2px solid var(--primary-color);
  padding-top: 15px;
  margin-top: 20px;
  text-align: right;
}

.cart-total h3 {
  font-size: 24px;
  color: var(--primary-color);
  margin: 0;
}

.empty-cart {
  text-align: center;
  color: var(--text-secondary);
  font-size: 18px;
  padding: 40px 20px;
}

/* Form Styles */
.checkout-section {
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
  margin-top: 20px;
}

.checkout-section h3 {
  color: var(--text-primary);
  margin: 0 0 20px 0;
  font-size: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 14px;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
  .header {
    padding: 15px 20px;
  }
  
  .header-left {
    gap: 12px;
  }
  
  .store-title {
    font-size: 18px;
    letter-spacing: 2px;
  }
  
  .main-content {
    padding-top: 80px;
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
  }
  
  .cart-sidebar {
    width: 100vw;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .header-social {
    display: none;
  }
  
  .product-grid {
    grid-template-columns: 1fr;
  }
}