/* Reset and Base Styles */
:root {
  --primary-color: #0078d7;
  --secondary-color: #0053a1;
  --text-color: #333;
  --bg-color: #fff;
  --accent-color: #f4f4f4;
  --header-bg: #333;
  --header-text: #fff;
  --error-color: #dc3545;
  --success-color: #28a745;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  z-index: 1001;
}

.skip-link:focus {
  top: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Header and Navigation */
header {
  background-color: var(--header-bg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem;
}

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

.navbar nav {
  display: flex;
  gap: 2rem;
}

.navbar a {
  color: var(--header-text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar a:hover,
.navbar a:focus {
  color: var(--accent-color);
}

.logo img {
  width: 120px;
  height: auto;
}

/* Cart Badge */
.cart-link {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -12px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 12px;
  display: none;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--accent-color) 0%, #fff 100%);
  padding: 4rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
}

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

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
  color: var(--text-color);
  line-height: 1.2;
}

.hero p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin-bottom: 2rem;
  color: #666;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

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

.btn.secondary {
  background-color: var(--accent-color);
  color: var(--text-color);
}

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

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Product Showcase */
.product-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.product-image {
  text-align: center;
}

.product-image img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-config {
  padding: 2rem;
  background: var(--accent-color);
  border-radius: 12px;
}

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

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

.form-group select,
.form-group input[type="text"],
.form-group input[type="email"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help-text {
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.25rem;
}

/* Cart Styles */
.cart-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 3fr 1fr auto;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid #ddd;
  align-items: center;
}

.cart-summary {
  background: var(--accent-color);
  padding: 2rem;
  border-radius: 12px;
  margin-top: 2rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.summary-row.total {
  border-top: 2px solid #ddd;
  margin-top: 1rem;
  padding-top: 1rem;
  font-weight: 600;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--error-color);
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0.25rem 0.5rem;
}

/* Checkout Styles */
.checkout-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.checkout-form {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.form-section h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

/* Documentation Styles */
.docs-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.docs-sidebar {
  position: sticky;
  top: 5rem;
  height: fit-content;
  padding: 1rem;
  background: var(--accent-color);
  border-radius: 12px;
}

.docs-nav ul {
  list-style: none;
}

.docs-nav a {
  display: block;
  padding: 0.5rem;
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.docs-main {
  min-width: 0;
}

.docs-main section {
  margin-bottom: 3rem;
}

.docs-main h1 {
  margin-bottom: 2rem;
}

.docs-main h2 {
  margin: 2rem 0 1rem;
}

.docs-main h3 {
  margin: 1.5rem 0 0.75rem;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 2rem;
  border-radius: 8px;
  color: white;
  animation: slideIn 0.3s ease-out;
  z-index: 1000;
}

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

.toast.error {
  background-color: var(--error-color);
}

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

/* Loading States */
.loading {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #ddd;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 0.5rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
  }
  
  .navbar nav {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  .product-container,
  .checkout-container {
    grid-template-columns: 1fr;
  }
  
  .docs-container {
    grid-template-columns: 1fr;
  }
  
  .docs-sidebar {
    position: static;
    margin-bottom: 2rem;
  }
  
  .cart-item {
    grid-template-columns: 1fr auto;
  }
  
  .cart-item .item-price {
    grid-column: 1;
  }
}
