﻿/* ============================================================
   Майстор Паркет - Design System
   Elegant white-first, warm amber accent, refined typography
   ============================================================ */

/* ── Design Tokens ───────────────────────────────────────── */
:root {
  --amber:        #d97706;
  --amber-dark:   #b45309;
  --amber-light:  #fef3c7;
  --amber-pale:   #fffbeb;
  --gray-900:     #111827;
  --gray-800:     #1f2937;
  --gray-700:     #374151;
  --gray-600:     #4b5563;
  --gray-500:     #6b7280;
  --gray-300:     #d1d5db;
  --gray-100:     #f3f4f6;
  --gray-50:      #f9fafb;
  --white:        #ffffff;
  --radius-sm:    0.5rem;
  --radius-md:    0.75rem;
  --radius-lg:    1rem;
  --radius-xl:    1.25rem;
  --shadow-xs:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.09), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.10), 0 3px 10px rgba(0,0,0,0.06);
  --transition:   0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background: var(--white);
  color: var(--gray-800);
}


/* ── Navigation ──────────────────────────────────────────── */
nav[role="navigation"] {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229,231,235,0.7);
}

/* Desktop nav links */
nav[role="navigation"] .hidden.md\:flex a {
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  padding: 0.375rem 0.75rem;
}

nav a.active {
  color: var(--amber) !important;
  background-color: var(--amber-pale) !important;
  border-radius: var(--radius-sm);
}

/* ── Hero / Banner Sections ──────────────────────────────── */
section[aria-label],
.page-hero {
  background: var(--white) !important;
}

section[aria-label] h1,
.page-hero h1 {
  letter-spacing: -0.03em;
  font-weight: 800;
}

/* Breadcrumb nav row */
nav[aria-label="Навигационна пътека"] {
  color: var(--gray-500);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

/* ── Buttons ────────────────────────────────────────────── */
a[class*="bg-amber-600"],
button[class*="bg-amber-600"] {
  position: relative;
  overflow: hidden;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

a[class*="bg-amber-600"]:hover,
button[class*="bg-amber-600"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(217,119,6,0.35);
}

a[class*="bg-amber-600"]:active,
button[class*="bg-amber-600"]:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ── Content Prose (article body) ───────────────────────── */
.content-prose {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--gray-600);
}

.content-prose h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 2.5rem;
  margin-bottom: 0.875rem;
  padding-bottom: 0.625rem;
  border-bottom: 2px solid var(--amber-light);
  line-height: 1.25;
  letter-spacing: -0.025em;
  /* Amber square accent */
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.content-prose h2::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  min-width: 8px;
  background: var(--amber);
  border-radius: 2px;
  transform: translateY(-1px);
}

.content-prose h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.content-prose h4 {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-top: 1.5rem;
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
}

.content-prose p {
  margin-bottom: 1.1rem;
  color: var(--gray-600);
  line-height: 1.85;
}

.content-prose ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.25rem;
}

.content-prose ul > li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--gray-600);
  line-height: 1.75;
}

.content-prose ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--amber);
  border-radius: 50%;
  flex-shrink: 0;
}

.content-prose ol {
  list-style: none;
  counter-reset: prose-counter;
  padding-left: 0;
  margin-bottom: 1.25rem;
}

.content-prose ol > li {
  counter-increment: prose-counter;
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.6rem;
  color: var(--gray-600);
  line-height: 1.75;
}

.content-prose ol > li::before {
  content: counter(prose-counter);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.4rem;
  height: 1.4rem;
  background: var(--amber-light);
  color: var(--amber-dark);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.content-prose a {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--transition);
}

.content-prose a:hover {
  color: var(--amber-dark);
}

.content-prose strong {
  color: var(--gray-900);
  font-weight: 600;
}

/* ── Content Prose - Tables ──────────────────────────────── */
.content-prose .not-prose table,
.not-prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(209,213,219,0.7);
}

.content-prose .not-prose table thead th,
.not-prose table thead th {
  background: #78350f;
  color: var(--white);
  font-weight: 600;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.content-prose .not-prose table td,
.not-prose table td {
  padding: 0.7rem 1rem;
  color: var(--gray-700);
  border-bottom: 1px solid rgba(243,244,246,0.9);
  vertical-align: top;
  line-height: 1.6;
}

.content-prose .not-prose table tbody tr:last-child td,
.not-prose table tbody tr:last-child td {
  border-bottom: none;
}

.content-prose .not-prose table tbody tr:nth-child(even) td,
.not-prose table tbody tr:nth-child(even) td {
  background: #fafafa;
}

.content-prose .not-prose table tbody tr:hover td,
.not-prose table tbody tr:hover td {
  background: var(--amber-pale);
  transition: background 0.12s ease;
}

/* ── Content Prose - FAQ (dl/dt/dd) ─────────────────────── */
.content-prose dl {
  margin-bottom: 1.5rem;
}

.content-prose dt {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 0.975rem;
  margin-top: 1.25rem;
  margin-bottom: 0.375rem;
  padding-left: 1rem;
  border-left: 3px solid var(--amber);
}

.content-prose dd {
  color: var(--gray-600);
  line-height: 1.8;
  padding-left: 1rem;
  margin-left: 0;
}

/* ── Content Prose - Amber Callout Boxes ─────────────────── */
.content-prose .not-prose > div[class*="bg-amber"],
.content-prose .not-prose div[class*="bg-amber-50"] {
  border-radius: var(--radius-md);
  border-left: 4px solid var(--amber);
}

/* ── Sidebar Aside ───────────────────────────────────────── */
aside .sticky {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(229,231,235,0.8) !important;
}

/* Tally iframe inside sidebar */
aside iframe {
  display: block;
  border: none;
}

/* ── Service / Info Cards ────────────────────────────────── */
a[class*="group"][class*="border"] {
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  will-change: transform;
}

a[class*="group"][class*="border"]:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  background: var(--white) !important;
}

/* Icon container inside cards */
a[class*="group"]:hover div[class*="bg-amber-50"] {
  background: var(--amber) !important;
}

a[class*="group"]:hover div[class*="bg-amber-50"] i {
  color: var(--white) !important;
}

/* ── Image Gallery Grid ──────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.625rem;
  margin: 1.5rem 0;
}

.gallery-grid img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  display: block;
}

.gallery-grid img:hover {
  transform: scale(1.04);
  box-shadow: var(--shadow-md);
}

/* ── Scroll to Top Button ────────────────────────────────── */
#scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--amber);
  color: var(--white);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, background var(--transition), transform var(--transition), box-shadow var(--transition);
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

#scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

#scroll-top:hover {
  background: var(--amber-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

@media (max-width: 767px) {
  #scroll-top { bottom: 5rem; }
}

/* ── Mobile Bottom Navigation ────────────────────────────── */
#mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(229,231,235,0.8);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.07);
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

#mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--gray-500);
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
  min-height: 48px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  -webkit-tap-highlight-color: rgba(217,119,6,0.12);
}

#mobile-bottom-nav a i {
  font-size: 1.1rem;
  line-height: 1;
  transition: transform var(--transition);
}

#mobile-bottom-nav a:hover i,
#mobile-bottom-nav a.active i {
  transform: translateY(-1px);
}

#mobile-bottom-nav a:hover,
#mobile-bottom-nav a.active {
  color: var(--amber);
  background-color: var(--amber-pale);
}

#mobile-bottom-nav a.call-btn {
  background: var(--amber);
  color: var(--white);
}

#mobile-bottom-nav a.call-btn:hover {
  background: var(--amber-dark);
  color: var(--white);
}

/* ── Focus / Accessibility ───────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Page Entry Animation ────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

section > div > h1,
section > div > div > h1 {
  animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

section > div > p,
section > div > div > p {
  animation: fadeUp 0.5s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

section > div > a,
section > div > div > a {
  animation: fadeUp 0.5s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── KPI Number Cards ────────────────────────────────────── */
/* Amber stat numbers stand out with subtle scale on hover */
[class*="text-3xl"][class*="font-bold"][class*="text-amber"] {
  transition: transform var(--transition);
  display: inline-block;
}

[class*="text-3xl"][class*="font-bold"]:hover {
  transform: scale(1.07);
}

/* ── Footer ─────────────────────────────────────────────── */
footer[role="contentinfo"] {
  border-top: 3px solid var(--amber);
}

/* Footer link grid section */
div[class*="bg-gray-100"][class*="border-t"] {
  background: var(--gray-50) !important;
}

/* ── Top bar ─────────────────────────────────────────────── */
div[class*="bg-gray-100"][class*="text-gray-700"][class*="py-2"] {
  border-bottom: 1px solid rgba(209,213,219,0.8);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* Amber CTA strip */
div[class*="bg-amber-50"][class*="border-y"] {
  position: relative;
  overflow: hidden;
}

div[class*="bg-amber-50"][class*="border-y"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(217,119,6,0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Responsive Typography ───────────────────────────────── */
@media (max-width: 640px) {
  .content-prose h2 { font-size: 1.2rem; }
  .content-prose h3 { font-size: 1.05rem; }
  .content-prose { font-size: 0.9375rem; }
  .content-prose h2::before { display: none; }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-grid img { height: 120px; }
}

/* ── Touch Targets ───────────────────────────────────────── */
@media (max-width: 767px) {
  nav a, button { min-height: 44px; }
  .hero-img { width: 100%; border-radius: var(--radius-md); }
  a[class*="group"][class*="border"]:hover { transform: none; box-shadow: none; }
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  nav, aside, #scroll-top, footer, #mobile-bottom-nav { display: none !important; }
  body { padding-bottom: 0 !important; color: #000 !important; }
  .content-prose { font-size: 11pt; line-height: 1.6; }
  .content-prose a { color: #000 !important; text-decoration: underline; }
  .content-prose .not-prose table { box-shadow: none; border: 1px solid #ccc; }
}

/* ════════════════════════════════════════════════════════════
   POLISH v2 - Elegance, Flow & Conversion
   ════════════════════════════════════════════════════════════ */

/* ── Logo fix - never stretch, always scale by height ─────── */
img[src*="log.png"] {
  width: auto !important;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

/* ── Tally sidebar - comfortable padding ──────────────────── */
/* The outer sticky div gets padding so the iframe breathes   */
aside .sticky {
  padding: 1.25rem 1.25rem 1rem !important;
  overflow: visible !important;      /* let the inner card own overflow */
  border-radius: var(--radius-xl) !important;
  background: var(--white);
}

aside .sticky > * {
  border-radius: var(--radius-md);
  overflow: hidden;
}

aside iframe {
  border-radius: var(--radius-md);
  box-shadow: none;
}

/* Sidebar form heading if present */
aside .sticky h3,
aside .sticky p {
  padding: 0 0.25rem;
}

/* ── Smooth scroll globally ────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

/* ── Section rhythm & flow ─────────────────────────────────── */
/* Features strip (4 icon badges below hero) - subtle tint    */
div[class*="border-b"][class*="py-8"] {
  background: linear-gradient(to bottom, #fff 0%, var(--gray-50) 100%);
}

/* Transition from hero to main: fade-in gradient from top */
main {
  background: linear-gradient(to bottom, var(--gray-50) 0%, var(--white) 6rem);
  border-top: 1px solid rgba(229,231,235,0.6);
}

/* Features strip icons - larger, more readable */
div[class*="border-b"][class*="py-8"] i {
  font-size: 1.5rem !important;
}

/* ── Hero banner polish ────────────────────────────────────── */
/* hero image */
.hero-img {
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.07);
  object-fit: cover;
}

/* Hero section - subtle bottom shadow to lift it from the strip */
section[aria-label] {
  box-shadow: 0 4px 0 0 rgba(217,119,6,0.07) inset, 0 -1px 0 0 rgba(229,231,235,0.7);
}

/* ── Conversion CTA - first .btn-primary in a hero pulses ──── */
@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 4px 16px rgba(217,119,6,0.25), 0 2px 6px rgba(217,119,6,0.14); }
  50%       { box-shadow: 0 6px 28px rgba(217,119,6,0.45), 0 3px 10px rgba(217,119,6,0.20); }
}

@media (prefers-reduced-motion: no-preference) {
  section[aria-label] a[class*="bg-amber"],
  section[aria-label] .btn-primary {
    animation: ctaGlow 2.8s ease-in-out infinite;
  }
  section[aria-label] a[class*="bg-amber"]:hover,
  section[aria-label] .btn-primary:hover {
    animation: none;
  }
}

/* ── Breadcrumb ─ refined separators ──────────────────────── */
nav[aria-label="Навигационна пътека"] li + li::before {
  content: '›';
  margin: 0 0.4em;
  color: var(--gray-300);
  font-size: 1rem;
  line-height: 1;
}

/* ── Content prose links - reinforce amber accent ──────────── */
.content-prose a:not([class]) {
  color: var(--amber-dark);
  text-underline-offset: 3px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  transition: color var(--transition), text-decoration-color var(--transition);
}

.content-prose a:not([class]):hover {
  color: var(--amber);
}

/* ── FAQ polish ─ smoother expand indicator ───────────────── */
.content-prose details[open] > summary {
  color: var(--amber-dark);
}

.content-prose details > summary::after {
  content: '+';
  float: right;
  font-weight: 700;
  color: var(--amber);
  transition: transform var(--transition);
}

.content-prose details[open] > summary::after {
  content: '-';
}

/* ── KPI / Stats cards polish ─────────────────────────────── */
div[class*="grid"][class*="gap"][class*="text-center"] > div {
  border-radius: var(--radius-lg);
  transition: transform var(--transition), box-shadow var(--transition);
  padding: 1.5rem 1rem;
  background: var(--white);
  box-shadow: var(--shadow-xs);
}

div[class*="grid"][class*="gap"][class*="text-center"] > div:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

/* ── Service page feature strip items ─────────────────────── */
div[class*="border-b"][class*="py-8"] div[class*="flex"][class*="gap"] > div {
  transition: transform var(--transition);
}

div[class*="border-b"][class*="py-8"] div[class*="flex"][class*="gap"] > div:hover {
  transform: translateY(-2px);
}

/* ── Footer separator - stronger amber accent ─────────────── */
footer {
  border-top: 3px solid var(--amber) !important;
}

/* ── Scroll-to-top button glow ─────────────────────────────── */
#scroll-top {
  box-shadow: 0 4px 14px rgba(217,119,6,0.30);
  transition: transform var(--transition), box-shadow var(--transition);
}

#scroll-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(217,119,6,0.45);
}

/* ── Trust strip / contact bar spacing ───────────────────── */
div[class*="bg-amber-50"][class*="border-y"] {
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
}

/* ── Table - cleaner reading lines ───────────────────────── */
.content-prose table tbody tr:hover {
  background: var(--amber-pale) !important;
  transition: background 0.12s ease;
}

/* ── Image in top bar - no extra vertical space ───────────── */
div[class*="bg-gray-100"] img[src*="log.png"] {
  vertical-align: middle;
}

/* ── Mobile touch: tighten CTA strip vertical rhythm ─────── */
@media (max-width: 640px) {
  aside .sticky {
    padding: 1rem 0.875rem 0.875rem !important;
    position: static !important;
  }

  div[class*="border-b"][class*="py-8"] i {
    font-size: 1.25rem !important;
  }

  section[aria-label] a[class*="bg-amber"],
  section[aria-label] .btn-primary {
    animation: none; /* no pulsing on small screens */
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .hero-img {
    border-radius: var(--radius-md);
    box-shadow: 0 8px 20px rgba(0,0,0,0.09);
  }
}
