@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,700;1,400&display=swap');

:root {
  --bg-primary: #fdfbf7;
  --bg-surface: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --text-main: #2b2623;
  --text-muted: #6e6761;
  --accent-terracotta: #d96b43;
  --accent-terracotta-hover: #c45730;
  --accent-rose: #f4c2c2;
  --accent-sage: #88a087;
  --accent-gold: #e5a93b;
  --border-light: #ece6dd;
  --border-dark: #2d2a26;
  --shadow-sm: 0 4px 12px rgba(43, 38, 35, 0.05);
  --shadow-md: 0 8px 24px rgba(43, 38, 35, 0.08);
  --shadow-lg: 0 16px 40px rgba(43, 38, 35, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Outfit', sans-serif;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg-primary: #141210;
  --bg-surface: #1e1b18;
  --bg-glass: rgba(30, 27, 24, 0.85);
  --text-main: #f5f1ea;
  --text-muted: #aba39a;
  --border-light: #2c2823;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Glassmorphism Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-terracotta), var(--accent-gold));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  box-shadow: 0 4px 14px rgba(217, 107, 67, 0.3);
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.logo-text span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-terracotta);
  font-weight: 600;
}

/* Search Bar */
.search-box {
  flex: 1;
  max-width: 460px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.6rem;
  border-radius: 30px;
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--accent-terracotta);
  box-shadow: 0 0 0 4px rgba(217, 107, 67, 0.12);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-icon {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  font-size: 1.1rem;
}

.btn-icon:hover {
  border-color: var(--accent-terracotta);
  color: var(--accent-terracotta);
  transform: translateY(-2px);
}

.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-terracotta);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface);
}

.btn-primary {
  background: var(--accent-terracotta);
  color: #fff;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: 30px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(217, 107, 67, 0.25);
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--accent-terracotta-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 107, 67, 0.35);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  padding: 0.65rem 1.4rem;
  border-radius: 30px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-secondary:hover {
  border-color: var(--accent-terracotta);
  color: var(--accent-terracotta);
}

/* User Account Profile Pill */
.user-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 0.4rem 0.9rem 0.4rem 0.5rem;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.user-pill:hover {
  border-color: var(--accent-terracotta);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--accent-sage);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Hero Section */
.hero {
  max-width: 1300px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}

.hero-card {
  background: linear-gradient(135deg, rgba(217, 107, 67, 0.08) 0%, rgba(229, 169, 59, 0.08) 100%), var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 3rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(217, 107, 67, 0.12);
  color: var(--accent-terracotta);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 520px;
}

.hero-image-wrapper {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  max-height: 380px;
}

.hero-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Category & Filter Bar */
.filter-section {
  max-width: 1300px;
  margin: 2rem auto 1rem;
  padding: 0 1.5rem;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.pills-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pill-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 0.5rem 1.2rem;
  border-radius: 25px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.pill-btn:hover,
.pill-btn.active {
  background: var(--accent-terracotta);
  color: #fff;
  border-color: var(--accent-terracotta);
  box-shadow: 0 4px 12px rgba(217, 107, 67, 0.2);
}

/* Product Catalog Grid */
.catalog-section {
  max-width: 1300px;
  margin: 1.5rem auto 4rem;
  padding: 0 1.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.8rem;
}

/* Product Card */
.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(217, 107, 67, 0.3);
}

.card-image-wrap {
  position: relative;
  width: 100%;
  height: 230px;
  background: #f4f0eb;
  overflow: hidden;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .card-image-wrap img {
  transform: scale(1.06);
}

.badge-difficulty {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  color: var(--text-main);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.badge-difficulty.beginner { color: #2e7d32; }
.badge-difficulty.easy { color: #1565c0; }
.badge-difficulty.intermediate { color: #d84315; }

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category {
  font-size: 0.78rem;
  color: var(--accent-terracotta);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--accent-gold);
  margin-bottom: 0.8rem;
}

.card-rating span {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 0.2rem;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-light);
}

.price-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.price-current {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.price-original {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.btn-add-cart {
  background: var(--accent-terracotta);
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.1rem;
}

.btn-add-cart:hover {
  background: var(--accent-terracotta-hover);
  transform: scale(1.1);
}

/* Slide-over Shopping Cart Drawer */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cart-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.2);
}

.cart-drawer.active {
  transform: translateX(0);
}

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

.drawer-header h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-close:hover {
  color: var(--text-main);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

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

.cart-item-img {
  width: 75px;
  height: 75px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #f4f0eb;
}

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

.cart-item-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

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

.qty-controls {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-primary);
}

.qty-btn {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-main);
}

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

.qty-num {
  padding: 0 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-remove-item {
  background: none;
  border: none;
  color: #d32f2f;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: 0.8rem;
}

.drawer-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-primary);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.cart-summary-row.total {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--border-light);
  color: var(--text-main);
}

.shipping-bar {
  background: rgba(136, 160, 135, 0.15);
  color: var(--accent-sage);
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-align: center;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(5px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  position: relative;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

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

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-terracotta);
  box-shadow: 0 0 0 3px rgba(217, 107, 67, 0.12);
}

/* Admin Dashboard Table */
.admin-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.kpi-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
}

.admin-table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

table.admin-table th,
table.admin-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border-light);
}

table.admin-table th {
  background: var(--bg-primary);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

.status-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-badge.Pending { background: #fff3e0; color: #e65100; }
.status-badge.Processing { background: #e3f2fd; color: #1565c0; }
.status-badge.Shipped { background: #f3e5f5; color: #7b1fa2; }
.status-badge.Completed { background: #e8f5e9; color: #2e7d32; }
.status-badge.Cancelled { background: #ffebee; color: #c62828; }

/* Responsive adjustments */
@media (max-width: 868px) {
  .hero-card {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
  }
  .hero-title {
    font-size: 2.1rem;
  }
  .header-container {
    flex-wrap: wrap;
  }
  .search-box {
    order: 3;
    max-width: 100%;
  }
}
