/* === MAIN.CSS === */
/* assets/css/main.css */
/* НАЗНАЧЕНИЕ: Core styles for Braun Gartenbau landing page */
/* Палитра: теплая природная, без черного */
/* РАЗМЕР: ~480 строк */

/* === CSS VARIABLES === */
:root {
  /* Nature palette - warm, earthy, green */
  --green-primary: oklch(55% 0.18 155);
  --green-dark: oklch(42% 0.14 155);
  --green-hover: oklch(48% 0.16 155);
  --green-light: oklch(90% 0.06 155);
  --terracotta: oklch(60% 0.14 55);
  --terracotta-light: oklch(92% 0.04 55);
  --gold: oklch(75% 0.12 85);

  /* Backgrounds */
  --bg-primary: oklch(96% 0.01 90);
  --bg-secondary: oklch(94% 0.02 140);
  --bg-card: oklch(99% 0 0);
  --bg-card-hover: oklch(97% 0.01 140);

  /* Text - dark green instead of black */
  --text-primary: oklch(25% 0.04 155);
  --text-muted: oklch(45% 0.03 155);

  /* Borders */
  --border: oklch(88% 0.03 90);
  --border-focus: var(--green-primary);
  --border-color: var(--border);

  /* Shadows - warm tinted */
  --shadow-sm: 0 1px 3px oklch(25% 0.02 90 / 0.08);
  --shadow-md: 0 4px 16px oklch(25% 0.02 90 / 0.1);
  --shadow-lg: 0 8px 32px oklch(25% 0.02 90 / 0.12);
  --shadow-green: 0 4px 24px oklch(55% 0.18 155 / 0.2);

  /* Easings */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-base: 300ms var(--ease-out);
  --transition-slow: 500ms var(--ease-out);

  /* Typography */
  --font-display: 'Quicksand', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --header-h: 72px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 80px;
  --space-2xl: 120px;

  /* Aliases */
  --color-primary: var(--green-primary);
  --color-primary-hover: var(--green-hover);
  --color-primary-light: var(--green-light);
  --color-gold: var(--gold);
  --color-danger: oklch(55% 0.2 25);
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
  color: var(--text-primary);
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.2rem; }
p { color: var(--text-muted); line-height: 1.7; }

/* === CONTAINER === */
.gb-container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* === BUTTONS === */
.gb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  transition: background var(--transition-base), color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;

  &:active { transform: scale(0.97); }
}

.gb-btn--primary,
.gb-btn-primary {
  background: var(--green-primary);
  color: oklch(99% 0 0);

  &:hover {
    background: var(--green-hover);
    box-shadow: var(--shadow-green);
    transform: translateY(-2px);
  }
}

.gb-btn--outline,
.gb-btn-outline {
  background: transparent;
  color: var(--green-primary);
  border: 2px solid var(--green-primary);

  &:hover {
    background: var(--green-primary);
    color: oklch(99% 0 0);
    transform: translateY(-2px);
  }
}

.gb-btn-sm, .gb-btn--sm { padding: 10px 22px; font-size: 0.85rem; }
.gb-btn-lg, .gb-btn--lg { padding: 18px 44px; font-size: 1.05rem; }
.gb-btn-full, .gb-btn--full { width: 100%; justify-content: center; }

/* === HEADER === */
.gb-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: oklch(96% 0.01 90 / 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: transform var(--transition-base), background var(--transition-base), box-shadow var(--transition-base);

  &.gb-header--hidden { transform: translateY(-100%); }
  &.gb-header--scrolled {
    background: oklch(96% 0.01 90 / 0.95);
    box-shadow: var(--shadow-sm);
  }

  .gb-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
}

/* === LOGO === */
.gb-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.gb-logo-img {
  height: 52px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px oklch(0% 0 0 / 0.15));
  transition: opacity var(--transition-fast), filter var(--transition-fast);

  &:hover {
    opacity: 0.9;
    filter: drop-shadow(0 2px 6px oklch(0% 0 0 / 0.2));
  }
}

/* === NAV === */
.gb-nav {
  display: flex;
  align-items: center;
  gap: 4px;

  & a {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color var(--transition-fast), background var(--transition-fast);

    &:hover {
      color: var(--green-primary);
      background: var(--green-light);
    }
  }
}

/* === HEADER ACTIONS === */
.gb-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* === THEME TOGGLE - hidden, only light theme === */
.gb-theme-toggle { display: none; }

/* === LANG SWITCH === */
.gb-lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);

  &:hover {
    color: var(--green-primary);
    border-color: var(--green-primary);
    background: var(--green-light);
  }
}

/* === BURGER === */
.gb-burger {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);

  &:hover { background: var(--green-light); }

  span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform var(--transition-base), opacity var(--transition-base), width var(--transition-base);
    transform-origin: center;
  }

  &.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  &.active span:nth-child(2) { opacity: 0; width: 0; }
  &.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* === SECTION TITLE === */
.gb-section-title {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.gb-section-title h2 {
  margin-bottom: 12px;
}

.gb-section-title p {
  max-width: 560px;
  margin-inline: auto;
  font-size: 1.05rem;
}

.gb-section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--green-primary);
  border-radius: var(--radius-full);
  margin: 16px auto 0;
}

/* === FORMS === */
.gb-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gb-form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.gb-form-input,
.gb-form-textarea,
.gb-form-select {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;

  &::placeholder { color: var(--text-muted); opacity: 0.5; }

  &:hover { border-color: oklch(78% 0.06 155); }

  &:focus {
    border-color: var(--green-primary);
    box-shadow: 0 0 0 4px oklch(55% 0.18 155 / 0.1);
  }
}

.gb-form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* === COOKIE BANNER === */
.gb-cookie {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  width: min(680px, calc(100vw - 32px));
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-lg);
  transition: opacity var(--transition-base), transform var(--transition-base);

  &.gb-cookie--hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
  }
}

.gb-cookie-text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;

  & a {
    color: var(--green-primary);
    text-decoration: underline;
  }
}

.gb-cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* === SCROLL ANIMATIONS === */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
}

.animated {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }
  [data-animate] { opacity: 1; transform: none; }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  :root { --header-h: 60px; }

  .gb-nav { display: none; }
  .gb-burger { display: flex; }

  .gb-mobile-menu {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 850;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    padding: var(--space-md);
    gap: 4px;
    transform: translateX(100%);
    transition: transform var(--transition-base);

    &.open { transform: translateX(0); }
  }

  .gb-mobile-menu .gb-nav-link {
    font-size: 1.1rem;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
  }

  .gb-cookie {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .gb-cookie-actions { width: 100%; }

  .gb-container { padding-inline: 16px; }
}

/* === LOGO ICON + TEXT (text-based logo) === */
.gb-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 10px;
    background: var(--color-primary, #2d7a3a);
    color: #fff;
    border-radius: 8px;
    font-family: var(--font-display, 'Raleway', sans-serif);
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(45, 122, 58, 0.25);
}

.gb-logo-text {
    font-family: var(--font-display, 'Raleway', sans-serif);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary, #1a2520);
    letter-spacing: -0.01em;
    line-height: 1;
}

.gb-logo-light {
    font-weight: 400;
    color: var(--text-secondary, #4a5550);
}

@media (max-width: 600px) {
    .gb-logo-icon {
        width: 30px;
        height: 30px;
        font-size: 1rem;
        margin-right: 8px;
    }
    .gb-logo-text {
        font-size: 1rem;
    }
}

/* ========================================
   ACCESSIBILITY (WCAG 2.2 AA)
   ======================================== */

/* Skip-link - visible only on focus (keyboard) */
.gb-skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    z-index: 9999;
    padding: 12px 20px;
    background: var(--color-primary, #2d7a3a);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    transition: top 0.2s ease;
}

.gb-skip-link:focus {
    top: 0;
    outline: 3px solid #fff;
    outline-offset: -4px;
}

/* Screen reader only (visually hidden but accessible) */
.gb-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Visible focus ring (don't kill outline!) */
:focus-visible {
    outline: 3px solid var(--color-primary, #2d7a3a);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Honeypot anti-spam: hidden from humans + screen readers, but visible to bots */
.gb-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ========================================
   GDPR CONSENT CHECKBOX
   ======================================== */
.gb-form-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0 20px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-secondary, #4a5550);
}

.gb-form-consent input[type="checkbox"] {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin: 2px 0 0 0;
    accent-color: var(--color-primary, #2d7a3a);
    cursor: pointer;
}

.gb-form-consent label {
    cursor: pointer;
    user-select: none;
}

.gb-form-consent a {
    color: var(--color-primary, #2d7a3a);
    text-decoration: underline;
    font-weight: 500;
}

.gb-required {
    color: #d04444;
    font-weight: 700;
}

/* ========================================
   STICKY MOBILE CTA (WhatsApp + Phone)
   ======================================== */
.gb-sticky-cta {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 998;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.gb-sticky-btn {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 56px;
    min-height: 56px;
    padding: 0 18px 0 16px;
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gb-sticky-btn:hover, .gb-sticky-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.gb-sticky-btn--whatsapp { background: #25d366; }
.gb-sticky-btn--whatsapp:hover { background: #20bf5b; }

.gb-sticky-btn--phone { background: var(--color-primary, #2d7a3a); }
.gb-sticky-btn--phone:hover { background: #1f5828; }

.gb-sticky-btn svg { flex-shrink: 0; }

/* On desktop hide text, show only icon */
@media (min-width: 768px) {
    .gb-sticky-btn {
        min-width: 56px;
        width: 56px;
        padding: 0;
        justify-content: center;
    }
    .gb-sticky-text {
        display: none;
    }
    .gb-sticky-cta {
        right: 24px;
        bottom: 24px;
    }
}

/* ========================================
   PERFORMANCE: content-visibility
   ======================================== */
.gb-portfolio,
.gb-services,
.gb-process,
.gb-pricing,
.gb-about,
.gb-testimonials {
    content-visibility: auto;
    contain-intrinsic-size: 0 800px;
}

/* ========================================
   REDUCED MOTION (a11y - vestibular disorders)
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    [data-animate] { opacity: 1 !important; transform: none !important; }
}

/* ========================================
   TYPOGRAPHY FIX: h1 should match brand
   (was Quicksand - too playful for landscaping)
   ======================================== */
h1, .gb-hero-headline, .gb-section-title, .gb-legal-title {
    font-family: 'Raleway', 'DM Sans', sans-serif !important;
    letter-spacing: -0.015em;
}

/* Long German words - prevent overflow */
.gb-hero-headline,
.gb-cta-section h2,
.gb-section-title {
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
}

/* ========================================
   COOKIE BANNER - touch targets 44px (WCAG 2.5.5)
   ======================================== */
.gb-cookie-banner button,
[class*="cookie"] button,
.gb-cookie-accept,
.gb-cookie-decline {
    min-height: 44px !important;
    padding: 11px 24px !important;
    font-size: 0.95rem !important;
}

/* ========================================
   FORM FIELDS - touch targets 44px
   ======================================== */
.gb-form-group input,
.gb-form-group textarea,
.gb-contact-form input,
.gb-contact-form textarea {
    min-height: 48px;
    font-size: 16px; /* prevents iOS zoom on focus */
}

.gb-contact-form textarea {
    min-height: 120px;
}

/* Sticky CTA должен не мешать форме на mobile - bottom padding на body */
@media (max-width: 767px) {
    body {
        padding-bottom: 80px;
    }
}

/* ========================================
   STICKY CTA: hide when contact form is visible
   ======================================== */
body.contact-visible .gb-sticky-cta {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gb-sticky-cta {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Mobile: тонкий фоновый щит чтобы текст не сливался */
@media (max-width: 767px) {
    .gb-sticky-cta {
        bottom: 14px;
        right: 14px;
    }
    .gb-sticky-btn {
        font-size: 0.85rem;
        padding: 0 14px 0 12px;
        min-height: 48px;
        min-width: 48px;
    }
}
