/* =========================
   Global / Base
   ========================= */
html {
  scrollbar-gutter: stable;
  overflow-y: scroll;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f0f2f5;
  color: #333;
}

/* Основен цвят като CSS променлива */
:root {
  --bs-primary-rgb: 44, 62, 80; /* #2c3e50 */
}

.text-primary {
  --bs-text-opacity: 1;
  color: rgba(var(--bs-primary-rgb), var(--bs-text-opacity)) !important;
  font-weight: 700;
}

/* =========================
   Navbar / Top header
   ========================= */
.navbar {
  position: relative;
  min-height: 70px;
  overflow-anchor: none;
}

.navbar-collapse {
  transition: none !important;
}

@media (max-width: 768px) {
  .top-bar {
    flex-direction: column;
    gap: 5px;
    text-align: center;
    justify-content: center;
  }
  .top-bar > * {
    width: 100%;
    display: flex;
    justify-content: center;   /* център за левия и десния блок */
    align-items: center;
    gap: .75rem;
  }
}

/* Центрирано меню по подразбиране (работи и на мобилно, и на десктоп) */
.navbar-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.navbar-nav .nav-item {
  font-weight: normal;
}

.navbar-nav .nav-link {
  display: flex;
  align-items: center;
  height: 100%;
  padding-top: 12px;
  padding-bottom: 12px;
  color: #555;
  transition: background-color 0.3s ease, color 0.2s ease;
}

.navbar-nav .nav-link:hover {
  color: #fff;
  border-radius: 20px;
  background-color: #8e99f3;
}

/* Dropdowns */
.dropdown-menu {
  transition: all 0.3s ease;
}

/* Hover open на десктоп */
@media (min-width: 992px) {
  .navbar .dropdown:hover .dropdown-menu {
    display: block !important;
    margin-top: 0;
    visibility: visible;
    opacity: 1;
  }
}

/* Мобилни настройки за менюто */
@media (max-width: 991px) {
  .navbar .dropdown-menu {
    position: static;
    float: none;
    width: 100%;
    margin-top: 0;
    background-color: #fff;
    box-shadow: none;
  }
  .navbar .dropdown.show .dropdown-menu {
    display: block;
  }
  /* По-добра четимост – всеки линк на отделен ред */
  .navbar-nav .nav-item {
    width: 100%;
    text-align: center;
  }
}

/* НЕ крием мобилния бранд */
.navbar-brand.d-lg-none { /* оставено нарочно празно – да не се override-ва */
}

/* Плавна промяна при shrink */
.transition-navbar {
  transition: padding 0.3s ease-in-out, background-color 0.3s ease-in-out;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.navbar.navbar-shrink {
  padding-top: 0.3rem !important;
  padding-bottom: 0.3rem !important;
  background-color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Горен информационен ред (Top bar) – ако се ползва класът .top-bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  min-height: 42px;
  background-color: #ffdd99;
  color: #000;
  font-weight: 600;
  font-size: 0.9rem;
  flex-wrap: wrap;
  line-height: normal;
}
.top-bar a { text-decoration: underline; color: inherit; }
.top-bar a.social-icon {
  transition: transform 0.3s ease, color 0.3s ease;
  display: inline-block; color: #000;
}
.top-bar a.social-icon:hover {
  transform: scale(1.2);
  color: #0d6efd;
}
@media (max-width: 576px) {
  .top-bar { flex-direction: column; gap: 5px; text-align: center; align-items: center; }
}

/* Централен текстов блок под логото (ако е показан) */
.header-center-fixed small {
  background: linear-gradient(to right, #dee4f0, #ffffff);
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  display: inline-block;
}

/* =========================
   Hero / Carousel
   ========================= */
#mainCarousel {
  max-height: 650px;
  overflow: hidden;
}
#mainCarousel .carousel-item img {
  object-fit: cover;
  height: 650px;
  width: 100%;
}

.carousel-caption {
  background: rgba(0, 0, 0, 0.5);
  padding: 20px;
  border-radius: 10px;
  max-width: 90%;
  margin: auto;
  color: #fff;
}

/* Текстът, позициониран върху изображението */
.text-shadow { text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7); }

/* Mobile carousel tweaks */
@media (max-width: 768px) {
  #mainCarousel { max-height: 220px; }
  #mainCarousel .carousel-item img { height: 220px; object-fit: cover; }

  /* Центрирано и с безопасна ширина */
  #mainCarousel .position-absolute { max-width: 90vw; }
  .carousel .position-absolute p { font-size: 0.9rem; }

  .carousel-caption {
    padding: 6px 12px;
    font-size: 0.9rem;
    bottom: 10px;
    background-color: rgba(0, 0, 0, 0.45);
    border-radius: 8px;
    max-width: 90%;
    margin: auto;
    text-align: center;
  }
  .carousel-caption h5 {
    font-size: 1rem; font-weight: 600; margin-bottom: 4px;
  }
  .carousel-caption p { font-size: 0.85rem; margin-bottom: 0; }
}

/* =========================
   Headings / Hero section blocks
   ========================= */
header { background: linear-gradient(90deg, #0052d4, #4364f7, #6fb1fc); color: white; }
header h1 { font-size: 2.5rem; }
header p  { font-size: 1.1rem; margin-top: 10px; }

@media (max-width: 768px) {
  header h1 { font-size: 2rem; }
}

.heading-underline {
  position: relative;
  display: inline-block;
  padding-bottom: 0.3rem;
  margin-bottom: 1.2rem;
}
.heading-underline::after {
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 50px; height: 1px;
  background-color: #ccc;
}

/* =========================
   Cards / Services
   ========================= */
.card {
  border: none;
  border-radius: 10px;
  transition: 0.3s ease;
  background-color: #fff;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.07);
}
.card-title a {
  color: #0052d4;
  font-weight: 600;
  font-size: 1.1rem;
}
.card-text { font-size: 0.95rem; color: #444; }

/* Service cards */
.service-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 10px;
  background: #fff;
}
.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
}

/* Hover helper */
.hover-shadow {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-shadow:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Fade-in animation */
.fade-in { animation: fadeIn 0.6s ease-in; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Slogan animation */
.animated-slogan {
  font-size: 1rem;
  font-weight: 600;
  color: #1e3c72;
  animation: fadeInUp 1.5s ease-in-out;
}
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* =========================
   Buttons / CTA
   ========================= */
section.bg-light h2 {
  color: rgba(var(--bs-primary-rgb), 1);
  font-weight: 700;
}
.btn-primary {
  background-color: #0052d4;
  border-color: #0052d4;
}
.btn-primary:hover {
  background-color: #003da8;
  border-color: #003da8;
}
.btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s ease;
}

/* Mobile font sizing */
@media (max-width: 768px) {
  .card-title { font-size: 1rem; }
  .card-text  { font-size: 0.9rem; }
  .btn-lg     { font-size: 1rem; padding: 12px 25px; }
  .container  { padding-left: 15px; padding-right: 15px; }

  /* Центриране на централния хедър блок, ако е показан */
  .header-center-fixed { display: block; text-align: center; margin-top: 10px; }
  .header-center-fixed h1 { font-size: 1.25rem; color: #2c3e50; }
  .header-center-fixed small { font-size: 0.85rem; line-height: 1.4; }

  .top-header { display: block; }
}
@media (max-width: 480px) {
  .card-title { font-size: 0.95rem; }
  .card-text  { font-size: 0.85rem; }
  header p    { font-size: 1rem; }
}

/* =========================
   Modal / Popup
   ========================= */
.modal-content { animation: popupFadeIn 0.6s ease-in-out; }
@keyframes popupFadeIn {
  0%   { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}
.pulse-ring { animation: pulse 2s infinite; }
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  70% { transform: scale(1.1); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* =========================
   Blog layout helpers
   ========================= */
.blog-date { margin-bottom: 1.5rem; }
.blog-card .card-title { margin-top: 2.5rem; }

/* =========================
   Footer
   ========================= */
footer p { opacity: 0.85; }
footer .border-top {
  border-color: rgba(255, 255, 255, 0.1) !important;
  font-size: 0.9rem;
  color: #ccc;
}

/* =========================
   WhatsApp Sticky Button
   ========================= */
.whatsapp-sticky {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background-color: #25D366;
  color: white;
  font-size: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
  font-family: "Font Awesome 6 Free";
  line-height: 0;
  text-decoration: none;
}
.whatsapp-sticky:hover {
  transform: scale(1.1);
  text-decoration: none;
  color: white;
}


@media (max-width: 768px) {
  .top-header .container { justify-content: center !important; }
  .top-header .container > .d-flex:first-child { /* блокът с логото */
    width: 100%;
    justify-content: center !important;
  }
  .top-header .container > .text-end { /* блокът с имейл/тел. */
    width: 100%;
    text-align: center !important;
    justify-content: center !important;
  }
}


#searchSuggestions .list-group-item { cursor: pointer; }
#searchSuggestions .highlight { font-weight: 600; }

/* ====== БЛОГ КАРТИ – ХОРИЗОНТАЛНИ ====== */
#blogCards .card{
  border:0;
  border-radius:16px;
  overflow:hidden;
  transition:transform .2s ease, box-shadow .2s ease;
}
#blogCards .card:hover{
  transform:translateY(-4px);
  box-shadow:0 8px 18px rgba(0,0,0,.08);
}

/* вътрешен ред – снимка вляво, текст вдясно */
#blogCards .card .d-flex{
  gap:16px;                 /* разстояние между снимката и текста */
  align-items:flex-start;
}

/* СНИМКА – фиксирани размери + cover (като на втората снимка) */
.blog-thumb{
  width:260px;
  height:170px;       /* малко по-висока */
  object-fit:cover;
  display:block;
  border-radius:12px;
}



/* Текстова част */
#blogCards .card-body{ padding:1.1rem 1.25rem 1.4rem; }
#blogCards .card-title{ margin-bottom:.5rem; font-weight:700; font-size:1.05rem; color:#1a1a1a; }
#blogCards .text-muted.small{ font-size:.85rem; color:#6c757d!important; }
#blogCards .card-text{
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical;
  overflow:hidden; min-height:3.8em; color:#475467; font-size:.95rem;
}
#blogCards .btn{ border-radius:10px; padding:.45rem .9rem; font-size:.9rem; }

/* Колони и отстояния */
#blogCards > [class^="col-"]{ padding-bottom:1rem; }

/* Респонсив – на телефони снимката става над текста и е пълна ширина */
@media (max-width: 767.98px){
  .blog-thumb{
    width:100%;
    height:200px;           /* по-висока за мобилно; пипни при нужда */
    flex:0 0 auto;
  }
  #blogCards .card .d-flex{
    flex-direction:column;
    gap:12px;
  }
}
