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

:root {
  /* Warm bakery palette */
  --cream: #FFFDF9;
  --cream-dark: #F2EBE0;
  --gold: #D4A353;
  --gold-light: #F0D9A3;
  --gold-dark: #A67C2E;
  --berry: #A63D56;
  --berry-light: #D17A8F;
  --berry-pale: #FCEEF1;
  --brown: #4A332A;
  --brown-light: #8C7064;
  --text: #261A15;
  --text-light: #5E4D44;
  --text-muted: #94857D;
  --white: #FFFFFF;
  --shadow: rgba(74, 51, 42, 0.06);
  --shadow-md: rgba(74, 51, 42, 0.1);
  --shadow-lg: rgba(74, 51, 42, 0.15);

  /* Typography */
  --font-display: 'Libre Baskerville', Georgia, serif;
  --font-body: 'Karla', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Luxury accents */
  --ornament: var(--gold);
  --letter-spacing-wide: 0.12em;
  --letter-spacing-heading: 0.06em;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background-color: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--brown);
  letter-spacing: var(--letter-spacing-heading);
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 1.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: var(--letter-spacing-wide); }
h3 { font-size: 1.25rem; font-weight: 600; }

@media (max-width: 640px) {
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.375rem; }
}

a {
  color: var(--berry);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--gold-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}

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

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

.btn-outline {
  background: transparent;
  color: var(--brown);
  border: 1px solid var(--brown-light);
}

.btn-outline:hover {
  border-color: var(--berry);
  color: var(--berry);
}

.btn-outline.active {
  background: var(--brown);
  color: var(--white);
  border-color: var(--brown);
}

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-amazing {
  background: var(--gold-light);
  color: var(--brown);
}

.badge-good {
  background: var(--cream-dark);
  color: var(--text-light);
}

.badge-needs-work {
  background: var(--berry-pale);
  color: var(--berry);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
}

th, td {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--cream-dark);
}

th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--gold);
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px var(--shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  overflow: hidden;
  border: 1px solid var(--cream-dark);
  border-top: 2px solid var(--gold);
}

.card:hover {
  box-shadow: 0 8px 24px var(--shadow-md), 0 2px 6px var(--shadow);
  transform: translateY(-3px);
  border-color: var(--gold);
  border-top-color: var(--gold-dark);
}

/* Grids */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid-small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-md); }

/* Product Cards (new) */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--cream-dark);
  overflow: hidden;
  transition: all 0.2s ease;
}

.product-card:hover {
  border-color: var(--gold);
  box-shadow: 0 8px 24px var(--shadow);
  transform: translateY(-2px);
}

.product-image-container {
  aspect-ratio: 4/3;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  border-bottom: 1px solid var(--cream-dark);
}

.product-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-details {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: var(--space-xs);
}

.product-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.product-price {
  color: var(--gold-dark);
  font-weight: 700;
  font-size: 1.1rem;
}

.product-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: var(--space-sm);
}

.btn-block {
  display: flex;
  justify-content: center;
  width: 100%;
  text-align: center;
}

/* Compact Product Cards */
.grid-small .product-card .product-details,
.grid-small .product-card .product-image-container {
  padding: var(--space-sm);
}

.grid-small .product-card .product-image-container {
  aspect-ratio: 1/1;
  padding: var(--space-md);
}

.grid-small .product-card .product-image {
  max-width: 80%;
  max-height: 80%;
}

.grid-small .product-title {
  font-size: 0.9rem;
  line-height: 1.3;
}

.grid-small .product-price {
  font-size: 1rem;
}

.grid-small .product-meta {
  padding-top: var(--space-xs);
  font-size: 0.75rem;
}

/* Section */
.section {
  padding: var(--space-2xl) 0;
}

/* Collapsible */
details {
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-md) 0;
  background: var(--white);
}

details summary {
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  color: var(--brown);
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

details summary::before {
  content: '\25B6';
  font-size: 0.7em;
  transition: transform 0.2s;
}

details[open] summary::before {
  transform: rotate(90deg);
}

/* Checkbox toggle */
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: 0.875rem;
  user-select: none;
}

.toggle-label input[type="checkbox"] {
  accent-color: var(--berry);
  width: 18px;
  height: 18px;
}

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-sm { font-size: 0.875rem; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
