/* ============================================
   Holzmanufaktur – Styles
   ============================================ */

:root {
  --beige: #F5F0E8;
  --beige-dunkel: #EBE5DC;
  --braun: #4A3728;
  --braun-hell: #6B5344;
  --gelb: #C4A035;
  --gelb-dezent: #B8952E;
  --weiss: #FAFAF8;
  --schatten: rgba(74, 55, 40, 0.08);
  --schatten-soft: rgba(74, 55, 40, 0.06);
  --font-headline: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 5rem;
  --transition: 0.4s ease;
  --radius-sm: 6px;
  --radius-md: 10px;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--braun);
  background-color: var(--beige);
  line-height: 1.6;
  overflow-x: hidden;
}

@media (max-width: 767px) {
  html, body {
    height: 100%;
    overflow: hidden;
  }
}

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

a {
  color: var(--braun-hell);
  text-decoration: none;
}

/* Page Wrapper & Mobile Snap Scroll */
.page-wrapper {
  position: relative;
  min-height: 100vh;
}

@media (max-width: 767px) {
  .page-wrapper {
    scroll-snap-type: y mandatory;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100vh;
    -webkit-overflow-scrolling: touch;
  }

  .snap-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    min-height: 100vh;
  }

  .header.snap-section {
    min-height: auto;
    padding: var(--spacing-md) 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .products-section {
    display: contents;
  }

  .products-container {
    display: contents;
  }
}

/* Parallax Background */
.parallax-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-image: url('../assets/textures/wood-texture.svg');
  background-repeat: repeat;
  background-size: 400px 400px;
  opacity: 0.07;
  pointer-events: none;
}

/* Header */
.header {
  padding: var(--spacing-md) var(--spacing-lg);
  text-align: center;
  border-bottom: 1px solid var(--schatten-soft);
  background: rgba(255, 255, 255, 0.5);
}

.logo {
  font-family: var(--font-headline);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  color: var(--braun);
  margin: 0;
  letter-spacing: 0.08em;
}

/* Sections */
.section {
  padding: var(--spacing-xl) var(--spacing-lg);
  max-width: 900px;
  margin: 0 auto;
}

.section-headline {
  font-family: var(--font-headline);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  color: var(--braun);
  text-align: center;
  margin: 0 0 var(--spacing-md);
  letter-spacing: 0.02em;
}

/* Intro */
.intro {
  padding-top: var(--spacing-xl);
  padding-bottom: var(--spacing-xl);
}

.intro-content {
  text-align: center;
}

.intro-headline {
  font-family: var(--font-headline);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  color: var(--braun);
  margin: 0 0 var(--spacing-sm);
  letter-spacing: 0.02em;
}

.intro-text {
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--braun-hell);
  max-width: 600px;
  margin: 0 auto var(--spacing-lg);
}

.intro-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-md);
}

.feature {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 0.95rem;
  color: var(--braun-hell);
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--schatten-soft);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 12px var(--schatten-soft);
}

.feature .material-icons {
  font-size: 1.5rem;
  color: var(--braun);
}

/* Section Divider */
.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--schatten-soft), transparent);
  margin: 0 var(--spacing-xl);
}

@media (max-width: 767px) {
  .section-divider {
    display: none;
  }
}

/* Products Section */
.products-section {
  position: relative;
  padding: var(--spacing-xl) 0;
}

@media (max-width: 767px) {
  .products-section > .section-headline {
    display: none;
  }

  .product-card[data-index="0"] .product-info::before {
    content: 'Unsere Produkte';
    display: block;
    font-family: var(--font-headline);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--braun-hell);
    margin-bottom: var(--spacing-sm);
  }
}

.products-section > .section-headline {
  padding: 0 var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.products-container {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Desktop: Grid Layout */
@media (min-width: 768px) {
  .products-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
    padding: var(--spacing-lg);
    max-width: 1200px;
    margin: 0 auto;
    scroll-snap-type: none;
    overflow: visible;
    height: auto;
  }

  .product-card {
    scroll-snap-align: none;
    scroll-snap-stop: auto;
    min-height: auto;
  }
}

/* Products Container – Fallback / Empty / Error */
.products-fallback,
.products-empty,
.products-error {
  padding: var(--spacing-lg);
  text-align: center;
  color: var(--braun-hell);
}

.products-error {
  color: var(--braun);
}

/* Product Card */
.product-card {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

@media (min-width: 768px) {
  .product-card {
    min-height: auto;
    margin-bottom: 0;
    padding: var(--spacing-lg);
    margin: 0;
    background: var(--weiss);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 24px var(--schatten), 0 1px 3px var(--schatten-soft);
    border: 1px solid rgba(74, 55, 40, 0.06);
    overflow: hidden;
  }
}

@media (max-width: 767px) {
  .product-card {
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.4);
  }
}

/* Product Image – Hover Zoom */
.product-image {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  flex: 0 0 auto;
  aspect-ratio: 4 / 3;
  background: var(--beige-dunkel);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
  .product-image {
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-image:hover img {
  transform: scale(1.08);
}

/* Holzart Badge – bei Hover sichtbar */
.wood-badge {
  position: absolute;
  bottom: var(--spacing-sm);
  right: var(--spacing-sm);
  padding: 0.35em 0.75em;
  font-size: 0.8rem;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  background: rgba(74, 55, 40, 0.85);
  color: var(--weiss);
  border-radius: 2px;
  opacity: 0;
  transition: opacity var(--transition);
}

.product-image:hover .wood-badge,
.product-image:focus-within .wood-badge {
  opacity: 1;
}

/* Touch: Badge bei Fokus/Tap sichtbar (Mobile) */
@media (hover: none) {
  .wood-badge {
    opacity: 1;
  }
}

/* Product Info */
.product-info {
  position: relative;
  padding: var(--spacing-md) 0;
  flex: 1 1 auto;
}

@media (min-width: 768px) {
  .product-info {
    padding: var(--spacing-md) 0 0;
  }
}

.product-name {
  font-family: var(--font-headline);
  font-size: 1.35rem;
  font-variant: small-caps;
  font-weight: 600;
  color: var(--braun);
  margin: 0 0 var(--spacing-xs);
  letter-spacing: 0.08em;
}

.product-description {
  font-size: 0.95rem;
  color: var(--braun-hell);
  margin: 0 0 var(--spacing-sm);
}

.product-price {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--gelb);
}

/* Mail-Link auf Produktkarte */
.product-mail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-top: var(--spacing-sm);
  color: var(--braun-hell);
  background: rgba(74, 55, 40, 0.06);
  border: 1px solid rgba(74, 55, 40, 0.15);
  border-radius: 50%;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.product-mail-link:hover {
  color: var(--gelb);
  background: rgba(196, 160, 53, 0.15);
  border-color: var(--gelb-dezent);
}

.product-mail-link .material-icons {
  font-size: 1.25rem;
}

/* Lazy Load Fade-In */
[data-product-image].lazy-loaded {
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Progress Dots – Mobile */
.progress-dots {
  position: fixed;
  top: 50%;
  right: var(--spacing-sm);
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

@media (min-width: 768px) {
  .progress-dots {
    display: none;
  }
}

.progress-dot {
  cursor: pointer;
  border: none;
  padding: 0;
  background: transparent;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--braun-hell);
  opacity: 0.4;
  transition: opacity var(--transition);
}

.progress-dot.active {
  opacity: 1;
  background: var(--gelb);
}

.progress-dot:focus {
  outline: 2px solid var(--gelb);
  outline-offset: 2px;
}

/* Contact Section */
.contact {
  padding: var(--spacing-xl) var(--spacing-lg);
}

.contact-content {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  padding: var(--spacing-lg);
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  border: 1px solid var(--schatten-soft);
}

.contact-text {
  font-size: 1.05rem;
  color: var(--braun-hell);
  margin: 0 0 var(--spacing-lg);
  line-height: 1.75;
}

/* CTA Button */
.cta-button {
  display: inline-block;
  padding: 0.9em 2em;
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--braun);
  background: var(--gelb);
  border: 1px solid var(--gelb-dezent);
  border-radius: var(--radius-sm);
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
  box-shadow: 0 2px 8px rgba(196, 160, 53, 0.25);
}

.cta-button:hover {
  background: var(--gelb-dezent);
  color: var(--braun);
  border-color: var(--braun-hell);
  transform: translateY(-1px);
}

.cta-button:focus {
  outline: 2px solid var(--braun-hell);
  outline-offset: 2px;
}

/* Touch / Pinch-Zoom Support */
.product-image img {
  touch-action: manipulation;
}

@media (hover: none) {
  .product-image {
    touch-action: pinch-zoom;
  }
}
