
:root {
  --primary-color: #8B4513;
  --secondary-color: #D4AF37;
  --accent-color: #2F4F4F;
  --text-dark: #2C2C2C;
  --text-light: #666666;
  --bg-cream: #FDF8F3;
  --bg-white: #FFFFFF;
  --border-color: #D4C5B0;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-heavy: 0 8px 16px rgba(0, 0, 0, 0.15);
}

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

body {
  font-family: 'Lora', Georgia, serif;
  background-color: var(--bg-cream);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  color: var(--accent-color);
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

/* Buttons */
.btn {
  font-family: 'Source Sans Pro', Arial, sans-serif;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--primary-color);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

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

.btn-primary:hover {
  background-color: #6F3609;
  border-color: #6F3609;
}

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

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

.btn-large {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* Header */
.main-header {
  background-color: var(--bg-white);
  border-bottom: 3px solid var(--primary-color);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h1 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--primary-color);
}

.tagline {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.85rem;
  color: var(--text-light);
  font-style: italic;
  margin: 0;
}

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

.nav-link {
  font-family: 'Source Sans Pro', sans-serif;
  font-weight: 600;
  color: var(--text-dark);
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
  border-bottom-color: var(--secondary-color);
}

.user-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

#user-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#user-name {
  font-family: 'Source Sans Pro', sans-serif;
  font-weight: 600;
  color: var(--accent-color);
}

.cart-btn {
  position: relative;
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--bg-cream) 0%, #F5E6D3 100%);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 4rem;
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color));
}

.hero-content h2 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.hero-content p {
  max-width: 800px;
  margin: 0 auto 2rem;
  font-size: 1.2rem;
  color: var(--text-dark);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.product-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow);
}

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

.product-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
  background-color: #f5f5f5;
}

.product-info {
  padding: 1.5rem;
}

.product-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.product-description {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.product-price {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.product-category {
  font-size: 0.85rem;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 1rem;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.filters {
  display: flex;
  gap: 1rem;
}

#category-filter,
#search-input {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.9rem;
  background: var(--bg-white);
}

#search-input {
  min-width: 250px;
}

/* About & Contact Pages */
.about-content,
.contact-content {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3rem;
  box-shadow: var(--shadow);
}

.about-text ul {
  margin-left: 2rem;
  margin-bottom: 2rem;
}

.about-text li {
  margin-bottom: 0.5rem;
}

.contact-info {
  background: var(--bg-cream);
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.contact-info p {
  margin-bottom: 1rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: 'Lora', serif;
  font-size: 1rem;
}

.contact-form textarea {
  resize: vertical;
}

/* Footer */
.main-footer {
  background-color: var(--accent-color);
  color: var(--bg-cream);
  margin-top: auto;
}

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

.footer-section h4 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

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

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

.footer-section a {
  color: var(--bg-cream);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--secondary-color);
}

.footer-bottom {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.9rem;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-white);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-heavy);
}

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

.modal-header h2 {
  margin: 0;
  color: var(--primary-color);
}

.close-modal {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
}

.close-modal:hover {
  color: var(--primary-color);
}

.modal-body {
  padding: 1.5rem;
}

/* Cart */
.cart-items {
  padding: 1.5rem;
}

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

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

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

.cart-item-name {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

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

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-color);
  background: var(--bg-white);
  cursor: pointer;
  border-radius: 4px;
  font-size: 1.2rem;
}

.quantity-input {
  width: 50px;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.25rem;
}

.remove-item {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 0.9rem;
  margin-left: auto;
}

.remove-item:hover {
  color: #c00;
}

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

.cart-total {
  display: flex;
  justify-content: space-between;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

/* Checkout Form */
.checkout-form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-section {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
}

.form-section h3 {
  margin-bottom: 1rem;
  color: var(--accent-color);
  font-size: 1.2rem;
}

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

.checkout-form input {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 1rem;
  width: 100%;
}

.order-summary {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  background: var(--bg-cream);
}

.order-summary h3 {
  margin-bottom: 1rem;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border-color);
}

.checkout-total {
  display: flex;
  justify-content: space-between;
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--primary-color);
}

/* Auth Forms */
.auth-form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form input {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 1rem;
}

.auth-switch {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
}

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

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

/* Order Confirmation */
.order-confirmation {
  padding: 2rem;
  text-align: center;
}

.order-number {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--primary-color);
  margin: 1rem 0;
  font-weight: 700;
}

/* Loading */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .main-nav {
    gap: 1rem;
  }

  .hero {
    padding: 2rem;
  }

  .hero-content h2 {
    font-size: 2rem;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .filters {
    flex-direction: column;
  }

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

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

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