@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --bg-main: #faf8f5; /* Warm premium cream */
  --bg-card: #ffffff;
  --bg-soft: #f2ede4; /* Soft sand background */
  --primary: #0f5132; /* Deep emerald herbal green */
  --primary-light: #e8f4ed;
  --primary-dark: #0a3521;
  --accent: #bd8e36; /* Warm herbal gold */
  --accent-light: #fbf6eb;
  --accent-dark: #966f25;
  --text-main: #27302c; /* Forest charcoal */
  --text-muted: #606d67;
  --border: #e2dacd;
  --border-focus: #0f5132;
  --ok: #0f5132;
  --out-of-stock: #b03a2e;
  --shadow-sm: 0 2px 8px rgba(15, 81, 50, 0.03);
  --shadow-md: 0 10px 30px rgba(15, 81, 50, 0.06);
  --shadow-lg: 0 20px 40px rgba(15, 81, 50, 0.1);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

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

/* Header/Topbar Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(16px, 5vw, 64px);
  background: rgba(250, 248, 245, 0.85); /* Blurred bg-main */
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: var(--transition);
}

.brand {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand::before {
  content: '🍃';
  font-size: 20px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 99px;
}

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

.nav a[href^="tel"] {
  background: var(--accent);
  color: #ffffff;
  border-radius: 99px;
  box-shadow: 0 4px 12px rgba(189, 142, 54, 0.2);
}

.nav a[href^="tel"]:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

/* Main Layout */
main {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
  padding: 64px 0 48px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 40px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  background: var(--accent-light);
  padding: 6px 14px;
  border-radius: 99px;
  margin-bottom: 16px;
}

h1 {
  font-family: var(--font-heading);
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--primary-dark);
  margin-bottom: 18px;
  letter-spacing: -1px;
}

.hero p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.7;
}

/* Contact Panel */
.contact-panel {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.contact-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.contact-panel p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 24px;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(15, 81, 50, 0.1);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 81, 50, 0.08);
}

.button.primary {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.button.primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 18px rgba(15, 81, 50, 0.2);
}

.button.accent {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.button.accent:hover {
  background: var(--accent-dark);
  box-shadow: 0 6px 18px rgba(189, 142, 54, 0.2);
}

/* Toolbar (Search & Filter) */
.toolbar {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.toolbar label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.toolbar input,
.toolbar select {
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  color: var(--text-main);
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.toolbar input:focus,
.toolbar select:focus {
  border-color: var(--border-focus);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 81, 50, 0.1);
}

.count-line {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-weight: 500;
}

.count-line span {
  color: var(--primary);
  font-weight: 700;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(15, 81, 50, 0.15);
}

.product-media {
  display: block;
  aspect-ratio: 1 / 1;
  background: #fdfdfd;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid rgba(226, 218, 205, 0.5);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 12px;
}

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

.image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
  background: var(--bg-soft);
  font-size: 14px;
  font-weight: 500;
}

.product-card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 20px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.category-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.stock-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.stock-badge.in-stock {
  color: var(--ok);
}

.stock-badge.out-of-stock {
  color: var(--out-of-stock);
}

.product-card h2 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  min-height: 48px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card h2 a:hover {
  color: var(--primary);
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(226, 218, 205, 0.4);
}

.price {
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
}

.price.contact {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.text-link {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.text-link::after {
  content: '→';
  transition: transform 0.2s ease;
}

.product-card:hover .text-link::after {
  transform: translateX(4px);
}

.product-card:hover .text-link {
  color: var(--accent);
}

/* Details Page Layout */
.detail-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  padding: 32px 0 64px;
  align-items: start;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
}

.back-link::before {
  content: '←';
}

.back-link:hover {
  color: var(--primary);
  transform: translateX(-4px);
}

/* Gallery Interactivity */
.gallery-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gallery-main {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.gallery-main img:hover {
  transform: scale(1.05);
}

.gallery-thumbs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px;
}

.gallery-thumb {
  width: 76px;
  height: 76px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  padding: 6px;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-thumb:hover {
  border-color: var(--accent);
}

.gallery-thumb.active {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(15, 81, 50, 0.2);
}

/* Details Info Sidebar */
.detail-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.detail-summary h1 {
  margin-bottom: 4px;
}

.detail-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid rgba(226, 218, 205, 0.4);
}

.chips span.stock {
  color: var(--primary);
  background: var(--primary-light);
  border-color: rgba(15, 81, 50, 0.1);
}

.chips span.out {
  color: var(--out-of-stock);
  background: #fdf2f2;
  border-color: rgba(176, 58, 46, 0.1);
}

.source-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: underline;
  margin-top: 8px;
}

.source-link:hover {
  color: var(--accent-dark);
}

/* Description Details */
.description {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.description h2,
.related h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.content {
  max-width: 800px;
  font-size: 15px;
  line-height: 1.8;
  color: #3e4c45;
}

.content p {
  margin-bottom: 16px;
}

.content ul, .content ol {
  margin-left: 20px;
  margin-bottom: 16px;
}

.content li {
  margin-bottom: 6px;
}

/* Related Products */
.related {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.related-item {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.related-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(15, 81, 50, 0.12);
}

.related-item img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  width: 100%;
  background: #fdfdfd;
  padding: 6px;
}

.related-item span {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}

.related-item:hover span {
  color: var(--primary);
}

/* Footer Section */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 48px clamp(16px, 5vw, 64px) 64px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  margin-top: 64px;
}

.footer strong {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-dark);
}

.footer span {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.6;
}

/* Empty State Styling */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  max-width: 320px;
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 40px 0;
  }
  
  .detail-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 680px) {
  .topbar {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    padding: 16px;
  }
  
  .brand {
    justify-content: center;
  }
  
  .nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav a {
    font-size: 13px;
    padding: 6px 12px;
  }
  
  .toolbar {
    grid-template-columns: 1fr;
  }
}
