/* Modern UI layer for the existing Web Builder markup
   (keeps your current HTML structure, but upgrades spacing, typography, and responsiveness) */

:root{
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --brand: #0080ff;
  --brand-2: #0073e6;
  --surface: #f8fafc;
  --border: rgba(15, 23, 42, 0.10);
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.10);
  --radius: 18px;
  --container: 1180px;
}

*,
*::before,
*::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  font-family: "Open Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: none; }

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

/* generic container behavior */
#Header, #Welcome, #Gallery, #Cards, #Catogories, #Equipment, #Whatsapp{
  max-width: var(--container);
  margin-inline: auto;
}

/* Top WhatsApp bar */
#wb_Whatsapp{
  background: linear-gradient(90deg, var(--brand), #00a3ff);
}
#wb_Text1{
  margin: 10px 0 !important;
  padding: 0 10px !important;
  font-size: 15px !important;
}
#wb_IconFont1{ margin: 8px 0 !important; }
#IconFont1{ width: 44px !important; height: 44px !important; }
#IconFont1 i{ font-size: 40px !important; line-height: 44px !important; }

/* Header */
#wb_Header{
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.06);
}
#Header{
  padding: 10px 16px !important;
}
#Header > .row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 24px !important;
}
#Header > .row > .col-1,
#Header > .row > .col-2{
  float:none !important;
  width:auto !important;
  padding: 0 !important;
}
#wb_Image1{ max-width: 280px; }
#Image1{ height:auto; width:100%; }

/* Menu polishing */
.ThemeableMenu1 .navbar-nav > li > a{
  border-radius: 12px;
}
@media (min-width: 1024px){
  .ThemeableMenu1 .navbar-nav > li > a{ padding: 12px 14px; }
}
@media (max-width: 1024px){
  .ThemeableMenu1 .navbar-nav{ border-top: 1px solid var(--border); }
  .ThemeableMenu1 .navbar-toggle{ border-radius: 12px; }
}

/* HERO */
#wb_Welcome{
  position: relative;
  min-height: 72vh;
  display:block !important;
}
#wb_Welcome::before{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(70% 60% at 20% 20%, rgba(255,255,255,0.92), rgba(255,255,255,0.65) 55%, rgba(255,255,255,0.15));
  pointer-events:none;
}
#Welcome{
  position:relative;
  padding: 64px 16px 56px !important;
}
#Welcome > .row{
  display:flex;
  align-items:center;
  gap: 26px;
}
#Welcome > .row > .col-1,
#Welcome > .row > .col-3{
  display:none;
}
#Welcome > .row > .col-2{
  float:none !important;
  width:100% !important;
  max-width: 680px;
}
#wb_Text3{ margin: 0 0 10px 0 !important; }
#wb_Text4{ margin: 0 0 10px 0 !important; }
#wb_Text5{ margin: 0 0 18px 0 !important; }
#wb_Text3 span{ font-size: clamp(18px, 2.2vw, 26px) !important; color: var(--text) !important; }
#wb_Text4 span{ font-size: clamp(26px, 3vw, 40px) !important; color: #dc143c !important; }
#wb_Text5 span{ font-size: 16px !important; color: var(--muted) !important; }

#Button1{
  width: auto !important;
  height: auto !important;
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 14px 18px !important;
  border-radius: 999px;
  font-size: 16px !important;
  line-height: 1 !important;
  background: var(--brand) !important;
  box-shadow: var(--shadow);
  min-height: 48px;
}
#Button1:hover{ background: var(--brand-2) !important; }

/* Intro / Info section */
#wb_Info{ background: var(--surface) !important; }
#Info{
  max-width: var(--container);
  margin-inline:auto;
  padding: 44px 16px !important;
  gap: 0;
}
#Info > .col-1{ display:none; }
#Info > .col-2{
  flex-basis: 100% !important;
  max-width: 100% !important;
}
#wb_Text7{ margin: 0 0 10px 0 !important; }
#wb_Text8{ margin: 0 !important; }
#wb_Text7 span{ font-size: 20px !important; font-weight: 700 !important; font-family: "Open Sans" !important; }
#wb_Text8 span{ font-size: 16px !important; font-family: "Open Sans" !important; color: var(--muted) !important; }

/* Gallery */
#wb_Gallery{ background: var(--bg) !important; }
#Gallery{ padding: 18px 0 0 !important; }
#Subject{
  display:block !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 16px 42px !important;
}
#Subject .thumbnails{
  display:grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 24px !important;
}
#Subject .thumbnail{
  float:none !important;
  width: auto !important;
}
#Subject .thumbnail img{
  border-radius: var(--radius) !important;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.08);
  transform: translateZ(0);
}
@media (max-width: 740px){
  #Subject .thumbnails{ grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 520px){
  #Subject .thumbnails{ grid-template-columns: 1fr; }
}

/* Cards section (services/brands etc.) */
#wb_Cards{ background: var(--surface) !important; }
#Cards{
  padding: 56px 16px !important;
}
#Cards > .row{
  display:grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px;
  margin: 0 !important;
}
#Cards > .row > .col-1,
#Cards > .row > .col-4{ display:none; }
#Cards > .row > .col-2,
#Cards > .row > .col-3{
  float:none !important;
  width:auto !important;
  padding: 0 !important;
}
#wb_Card1, #wb_Card2, #wb_Card3, #wb_Card4{
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: var(--shadow);
  background: #fff;
}
@media (max-width: 740px){
  #Cards > .row{ grid-template-columns: 1fr; }
}

/* Practice split section */
#wb_Practice{ background: linear-gradient(180deg, #0b4d92, #0b6bd1) !important; }
#Practice{
  max-width: var(--container);
  margin-inline:auto;
  padding: 0 !important;
}
#Practice > .col-1, #Practice > .col-2{
  padding: 0 !important;
}
#Practice > .col-2{
  padding: 44px 16px !important;
  color: white;
}
@media (max-width: 740px){
  #Practice > .col-1{ min-height: 260px; }
}

/* Categories */
#wb_Catogories{
  background: transparent !important;
  max-width: var(--container) !important;
}
#Catogories{
  padding: 56px 16px !important;
}
#Catogories > .row{
  display:grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 !important;
}
#Catogories > .row > .col-1,
#Catogories > .row > .col-2{
  float:none !important;
  width:auto !important;
  padding: 0 !important;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.06);
  padding: 22px 18px !important;
}
@media (max-width: 740px){
  #Catogories > .row{ grid-template-columns: 1fr; }
}

/* Equipment hero */
#wb_Equipment{
  position: relative;
  display:block !important;
}
#Equipment-overlay{
  opacity: 0.80 !important;
  background: radial-gradient(80% 80% at 20% 20%, rgba(0,128,255,0.90), rgba(0,64,160,0.90)) !important;
}
#Equipment{
  position:relative;
  padding: 72px 16px !important;
}
#Equipment h1, #Equipment h2, #Equipment h3,
#Equipment span, #Equipment p, #Equipment div{
  color:#fff !important;
}

/* Forms / inputs (if present) */
input, select, textarea{
  font: inherit;
}
input[type="text"], input[type="email"], input[type="tel"], textarea{
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
}
button, input[type="submit"], .btn{
  cursor:pointer;
  border:0;
  border-radius: 999px;
  padding: 12px 16px;
}

/* Better focus */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible{
  outline: 3px solid rgba(0,128,255,0.35);
  outline-offset: 3px;
}

/* Small-screen header stacking */
@media (max-width: 720px){
  #Header > .row{ align-items:flex-start; }
  #wb_Image1{ max-width: 240px; }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ transition: none !important; }
}


/* WhatsApp icon fallback (works even if Font Awesome font files are missing) */
#IconFont1{ display:flex !important; align-items:center; justify-content:center; }
#IconFont1 .wa-icon{ width: 40px; height: 40px; fill: #ffffff; display:block; }


/* === FOLLOW US SVG ICONS (FontAwesome-independent) === */

#IconFont11, #IconFont13, #IconFont14 { color: #CECECE; }
#IconFont11 svg, #IconFont13 svg, #IconFont14 svg {
  width: 47px;
  height: 47px;
  display: block;
  fill: currentColor;
}
#wb_IconFont11:hover #IconFont11,
#wb_IconFont13:hover #IconFont13,
#wb_IconFont14:hover #IconFont14 { color: #FFFFFF; }


/* ===== Gallery thumbnails -> modern cards with CTA under each image ===== */
#Subject{
  display:block !important;
  width:100% !important;
  height:auto !important;
}

#Subject .thumbnails{
  display:grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 22px !important;
  margin: 0 !important;
  padding: 0 !important;
}

@media (max-width: 960px){
  #Subject .thumbnails{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 640px){
  #Subject .thumbnails{
    grid-template-columns: 1fr !important;
  }
}

#Subject .thumbnail{
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 18px !important;
  display:flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-radius: var(--radius) !important;
  background: #fff !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow) !important;
  min-height: 340px;
  overflow: hidden;
}

#Subject .thumbnail > a{
  width:100%;
  display:block;
}

#Subject .thumbnail img{
  width:100% !important;
  height: 230px !important;
  object-fit: contain !important;
  border-radius: 14px !important;
  background: var(--surface);
  padding: 10px;
}

#Subject .thumbnail figcaption{
  width:100%;
  margin-top: 14px;
}

#Subject .thumbnail .thumb-cta{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.10);
}

#Subject .thumbnail .thumb-cta:hover{
  background: var(--brand-2);
}

/* remove legacy float clearing that can break the grid */
#Subject .thumbnails .thumbnail:nth-child(3n+1){
  clear: none !important;
}

/* ===== Fix: button text + desktop 3-column alignment ===== */
/* WB sets #Subject font-size:0; ensure readable text inside cards */
#Subject .thumbnail{ font-size: 16px !important; line-height: 1.3; }
#Subject .thumbnail .thumb-cta{ font-size: 16px !important; line-height: 1.2; }

/* Keep 3 columns on typical desktop widths (including 1024px) */
#Gallery{ max-width: var(--container) !important; margin-inline: auto !important; }
#Subject{ max-width: var(--container) !important; margin-inline: auto !important; }

/* override earlier breakpoints */
@media (max-width: 840px){
  #Subject .thumbnails{ grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 560px){
  #Subject .thumbnails{ grid-template-columns: 1fr !important; }
}

/* Reduce excessive blank space after gallery */
#wb_Gallery{ padding-bottom: 40px !important; }


/* === v8 FIXES === */

/* WebBuilder adds clearfix pseudo-elements to .thumbnails.
   When we switch to CSS Grid, those pseudo-elements become grid items
   and create "empty cells" -> looks like a 2nd row. Disable them. */
#Subject .thumbnails::before,
#Subject .thumbnails::after{
  content: none !important;
  display: none !important;
}

/* Ensure no legacy float/clear interferes */
#Subject .thumbnail{
  float: none !important;
  clear: none !important;
  margin: 0 !important;
}

/* Keep 3-in-a-row on desktop */
#Subject .thumbnails{
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* Cards section: 2 cards centered and same container width as gallery */
#Cards{
  max-width: 1200px !important;
  margin: 0 auto !important;
}
#Cards > .row{
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  justify-content: center !important;
}
@media (max-width: 740px){
  #Cards > .row{ grid-template-columns: 1fr !important; }
}
/* ===== FIX LOWER TEXT CARDS (2 IN ONE ROW) ===== */

/* центрираме секцията */
#wb_Cards,
#Cards {
    width: 100% !important;
}

#Cards > .row {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: stretch !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    gap: 30px !important;
}

/* двете карти да делят мястото */
#Cards > .row > .col-2,
#Cards > .row > .col-3 {
    float: none !important;
    width: 50% !important;
    max-width: 50% !important;
    flex: 0 0 50% !important;
}

/* махаме излишния WebBuilder spacing */
#Cards > .row > div {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* таблет */
@media (max-width: 900px) {
    #Cards > .row {
        flex-wrap: wrap !important;
    }
    #Cards > .row > .col-2,
    #Cards > .row > .col-3 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
}
/* FIX: CATEGORIES (Имплантология / Естетични реставрации) */
#Catogories > .row{
  display:flex !important;
  flex-wrap:nowrap !important;
  justify-content:center !important;
  align-items:stretch !important;
  gap:30px !important;
  margin-left:0 !important;
  margin-right:0 !important;
}
#Catogories > .row > .col-1,
#Catogories > .row > .col-2{
  float:none !important;
  width:auto !important;
  flex:1 1 0 !important;
  max-width:none !important;
}
@media (max-width: 900px){
  #Catogories > .row{ flex-wrap:wrap !important; }
  #Catogories > .row > .col-1,
  #Catogories > .row > .col-2{
    flex:0 0 100% !important;
    width:100% !important;
  }
}