/* Global site styles (extracted from templates, mobile-first friendly) */

:root {
  --primary-green: #2d5a27;
  --light-green: #4a7c3a;
  --dark-green: #1a3a1a;
  --accent-yellow: #f4c430;
  --dark-yellow: #d4a020;
  --text-dark: #2c3e50;
  --bg-light: #f8f9fa;

  /* Override Bootstrap blue colors with green */
  --bs-primary: var(--primary-green);
  --bs-primary-rgb: 45, 90, 39;
  --bs-info: var(--primary-green);
  --bs-info-rgb: 45, 90, 39;
  --bs-link-color: var(--primary-green);
  --bs-link-hover-color: var(--dark-green);
  --bs-focus-ring-color: rgba(45, 90, 39, 0.25);
}

/* Make headings consistent across pages (template overrides may still apply locally) */
h1, h2, h3, h4, h5, h6 {
  color: #333 !important;
}

/* Keep muted text readable (project previously overrode this in multiple places) */
.text-muted {
  color: #333 !important;
}

/* Accessible focus rings (keyboard) */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(45, 90, 39, 0.45);
  outline-offset: 2px;
}

/* Avoid hover animations on touch devices */
@media (hover: none) and (pointer: coarse) {
  .card:hover,
  .clickable-card:hover {
    transform: none !important;
    filter: none !important;
  }

  .navbar .navbar-nav .nav-link:hover i {
    transform: none !important;
    opacity: 1 !important;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------
   CTA normalization (mobile-first) — no UX flow changes
------------------------------------------------------------ */

/* Helper class to opt-in CTA sizing where needed */
.btn-cta {
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
}

/* Ensure large buttons are comfortable to tap on mobile */
@media (max-width: 768px) {
  .btn.btn-lg:not(.btn-link) {
    min-height: 48px;
  }

  /* Make primary CTAs full width in hero/CTA sections on small screens */
  .hero-section .btn.btn-lg {
    width: 100%;
    max-width: 420px;
  }
}

/* ------------------------------------------------------------
   Callback request widget ("Свяжитесь со мной")
------------------------------------------------------------ */

.callback-widget-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  padding: 0;
  line-height: 1;
  background: var(--primary-green);
  color: #fff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  z-index: 1061; /* stay above cookie banner */
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.callback-widget-button:hover {
  transform: scale(1.12);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

.callback-widget-panel {
  position: fixed;
  right: 18px;
  bottom: 86px; /* sits above the button */
  width: clamp(320px, 33vw, 520px);  /* ~ 1/3 screen on desktop */
  height: auto; /* fit content (no extra space, no scroll) */
  max-width: calc(100vw - 36px);
  max-height: calc(100vh - 160px); /* keep below navbar + some spacing */
  background: #ffffff; /* opaque white */
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  z-index: 1056;
  overflow: hidden;
  display: none;
}

.callback-widget-panel.is-open {
  display: block;
}

.callback-widget-header {
  padding: 14px 16px;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.callback-widget-title {
  font-weight: 600;
  color: #000;
  font-size: 1.1rem; /* keep chat-widget sized while matching site header style */
  line-height: 1.2;
}

.callback-widget-body {
  padding: 14px;
  height: auto;
  overflow: visible;
}

/* Avoid any Bootstrap blue focus rings inside the widget (use green palette) */
.callback-widget-panel .btn:focus,
.callback-widget-panel .btn:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 0.2rem rgba(45, 90, 39, 0.25) !important;
}

.callback-widget-panel .btn-primary:active,
.callback-widget-panel .btn-primary:focus,
.callback-widget-panel .btn-primary:focus-visible {
  background-color: var(--dark-green) !important;
  border-color: var(--dark-green) !important;
}

.callback-widget-panel .form-select:focus,
.callback-widget-panel .form-control:focus,
.callback-widget-panel .form-check-input:focus {
  border-color: var(--primary-green) !important;
  box-shadow: 0 0 0 0.2rem rgba(45, 90, 39, 0.25) !important;
  outline: none !important;
}

/* Make selected option highlight green-ish where supported */
.callback-widget-panel select option:checked,
.callback-widget-panel select option:focus {
  background-color: rgba(45, 90, 39, 0.25) !important;
}

.callback-widget-overlay {
  display: none;
}

/* Fullscreen mode only for touch devices (chat-like on desktop even in narrow windows/zoom) */
@media (hover: none) and (pointer: coarse) and (max-width: 768px) {
  .callback-widget-overlay {
    position: fixed;
    inset: 0;
    top: 56px; /* below fixed navbar */
    background: rgba(0, 0, 0, 0.55);
    z-index: 1054;
  }

  .callback-widget-overlay.is-open {
    display: block;
  }

  .callback-widget-panel {
    right: 0;
    bottom: 0;
    top: 56px;
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    overflow: auto;
  }

  .callback-widget-button {
    right: 12px;
    bottom: 12px;
  }
}



