/* ================================================
   هپی ملک — floatbar.css
   دکمه شناور تماس سریع + بنر کوکی GDPR
   ================================================ */

/* -------- FLOATING CONTACT BAR -------- */
#float-contact-bar {
  position: fixed;
  bottom: 28px;
  left: 40px;
  z-index: 9000;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 12px;
}

/* Toggle button */
#float-toggle {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #8DC63F, #6a9e2a);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(141, 198, 63, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

#float-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(141, 198, 63, 0.65);
}

#float-toggle:focus-visible {
  outline: 3px solid #8DC63F;
  outline-offset: 3px;
}

.float-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.float-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #f44336;
  color: #fff;
  font-size: 0.62rem;
  font-family: 'Vazirmatn', sans-serif;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  white-space: nowrap;
  animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.15); }
}

/* Hide badge when open */
#float-contact-bar.open .float-badge {
  display: none;
}

/* Action buttons container */
#float-actions {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#float-contact-bar.open #float-actions {
  pointer-events: all;
  opacity: 1;
  transform: translateY(0);
}

/* Individual action buttons */
.float-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px 11px 14px;
  border-radius: 40px;
  text-decoration: none;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 3px 14px rgba(0,0,0,0.18);
  transition: all 0.25s;
  transform: scale(0.92);
  direction: rtl;
}

#float-contact-bar.open .float-action {
  transform: scale(1);
}

.float-action:hover {
  transform: scale(1.05) translateX(-3px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.25);
}

.float-action i {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.float-action-whatsapp  { background: #25d366; }
.float-action-whatsapp:hover  { background: #1db954; }

.float-action-phone     { background: #4D4D4D; }
.float-action-phone:hover     { background: #333; }

.float-action-telegram  { background: #0088cc; }
.float-action-telegram:hover  { background: #006fa6; }

.float-action-consult   { background: #8DC63F; }
.float-action-consult:hover   { background: #6a9e2a; }

/* Staggered animation for each button */
#float-contact-bar.open .float-action:nth-child(1) { transition-delay: 0.00s; }
#float-contact-bar.open .float-action:nth-child(2) { transition-delay: 0.05s; }
#float-contact-bar.open .float-action:nth-child(3) { transition-delay: 0.10s; }
#float-contact-bar.open .float-action:nth-child(4) { transition-delay: 0.15s; }

/* Pulse animation on first visit hint */
#float-contact-bar.pulse #float-toggle {
  animation: float-pulse 0.7s ease-in-out 3;
}
@keyframes float-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(141,198,63,0.5); transform: scale(1); }
  50%       { box-shadow: 0 4px 40px rgba(141,198,63,0.85); transform: scale(1.12); }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  #float-contact-bar {
    bottom: 20px;
    left: 14px;
    right: auto;
  }
  #float-toggle {
    width: 48px;
    height: 48px;
    font-size: 1.15rem;
    box-shadow: 0 3px 14px rgba(141, 198, 63, 0.4);
  }
  .float-badge {
    font-size: 0.56rem;
    padding: 2px 5px;
    top: -4px;
    right: -4px;
  }
  /* action buttons فقط آیکون در موبایل */
  .float-action {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
    gap: 0;
  }
  .float-action span {
    display: none;
  }
}

@media (max-width: 480px) {
  #float-contact-bar {
    bottom: 16px;
    left: 10px;
  }
  #float-toggle {
    width: 44px;
    height: 44px;
    font-size: 1.05rem;
  }
  .float-action {
    width: 40px;
    height: 40px;
  }
}


/* -------- COOKIE CONSENT BANNER -------- */
#cookie-banner {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 10000;
  padding: 0 16px 16px;
  transform: translateY(110%);
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

#cookie-banner.show {
  transform: translateY(0);
  pointer-events: all;
}

#cookie-banner.hide {
  transform: translateY(110%);
  pointer-events: none;
}

.cookie-inner {
  max-width: 960px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 -2px 0 rgba(141,198,63,0.4), 0 8px 40px rgba(0,0,0,0.14);
  border: 1px solid #e8f5d0;
  direction: rtl;
  flex-wrap: wrap;
}

.cookie-icon {
  font-size: 2rem;
  color: #8DC63F;
  flex-shrink: 0;
  line-height: 1;
}

.cookie-text {
  flex: 1;
  min-width: 220px;
}

.cookie-title {
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.97rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
  line-height: 1.4;
}

.cookie-desc {
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.82rem;
  color: #666;
  line-height: 1.7;
  margin: 0;
}

.cookie-link {
  color: #8DC63F;
  text-decoration: underline;
  font-weight: 600;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 10px;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  border: 2px solid transparent;
  white-space: nowrap;
}

.cookie-btn-accept {
  background: #8DC63F;
  color: #fff;
  border-color: #8DC63F;
}
.cookie-btn-accept:hover {
  background: #6a9e2a;
  border-color: #6a9e2a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(141,198,63,0.35);
}

.cookie-btn-decline {
  background: transparent;
  color: #666;
  border-color: #ddd;
}
.cookie-btn-decline:hover {
  background: #f5f5f5;
  border-color: #bbb;
  color: #333;
}

@media (max-width: 600px) {
  .cookie-inner {
    padding: 16px;
    gap: 12px;
  }
  .cookie-icon { display: none; }
  .cookie-actions { width: 100%; justify-content: stretch; }
  .cookie-btn { flex: 1; justify-content: center; }
}


/* -------- PRINT STYLESHEET -------- */
@media print {
  /* Hide elements not needed in print */
  .site-header,
  .mobile-nav,
  #float-contact-bar,
  #cookie-banner,
  .back-to-top,
  #backToTop,
  .hero-section,
  .page-hero,
  .consult-hero,
  .breadcrumb,
  .sidebar,
  .sidebar-widget,
  .btn,
  .cta-box,
  .footer-social,
  .footer-links,
  .footer-links-col,
  nav,
  .hamburger,
  .section-cta,
  .faq-section,
  .guide-filter,
  .guides-categories,
  .quickstart-section,
  .network-section,
  .experiences-section,
  .investment-section,
  .construction-section,
  .cooperation-section,
  .contact-grid,
  .footer-brand .footer-social,
  .footer-bottom a,
  [class*="-cta"],
  [class*="cta-"] {
    display: none !important;
  }

  /* Reset layout for print */
  body {
    font-family: 'Vazirmatn', 'Tahoma', Arial, sans-serif !important;
    font-size: 11pt !important;
    color: #000 !important;
    background: #fff !important;
    direction: rtl;
    line-height: 1.7;
  }

  /* Page settings */
  @page {
    margin: 2cm 1.5cm;
    size: A4;
  }

  @page :first {
    margin-top: 1.5cm;
  }

  /* Logo / brand in print header */
  .site-header {
    display: block !important;
    position: static !important;
    background: #fff !important;
    box-shadow: none !important;
    border-bottom: 2px solid #8DC63F !important;
    padding: 12px 0 !important;
    margin-bottom: 20pt !important;
  }

  .site-header .main-nav,
  .site-header .hamburger,
  .site-header .nav-cta {
    display: none !important;
  }

  .site-header .logo-link {
    display: flex !important;
  }

  /* Headings */
  h1 { font-size: 20pt !important; color: #333 !important; page-break-after: avoid; }
  h2 { font-size: 16pt !important; color: #4D4D4D !important; page-break-after: avoid; }
  h3 { font-size: 13pt !important; color: #4D4D4D !important; page-break-after: avoid; }

  /* Content sections */
  .section, main, .main-content, .content-area {
    padding: 0 !important;
    margin: 0 0 16pt !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }

  /* Cards — collapse to block list */
  .content-card,
  .guide-card,
  .step-card,
  .feature-card,
  .stat-card {
    break-inside: avoid;
    border: 1px solid #ddd !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin-bottom: 10pt !important;
    padding: 10pt !important;
    background: #fff !important;
  }

  /* Tables */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 9.5pt !important;
  }
  th, td {
    border: 1px solid #ccc !important;
    padding: 6pt 8pt !important;
    text-align: right !important;
  }
  th { background: #f0f8e8 !important; font-weight: bold !important; }

  /* Images */
  img { max-width: 100% !important; page-break-inside: avoid; }

  /* Links */
  a { color: #000 !important; text-decoration: none !important; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #555;
  }
  a[href^="tel"]::after,
  a[href^="mailto"]::after,
  a[href^="#"]::after {
    content: none;
  }

  /* Footer for print */
  .site-footer {
    display: block !important;
    border-top: 1pt solid #8DC63F !important;
    margin-top: 20pt !important;
    padding-top: 8pt !important;
    font-size: 8pt !important;
    color: #666 !important;
  }

  .footer-bottom {
    display: block !important;
    text-align: center !important;
  }

  /* Page break helpers */
  .page-break-before { page-break-before: always; }
  .page-break-after  { page-break-after: always; }
  .no-break          { page-break-inside: avoid; }

  /* Construction steps — keep together */
  .step-card, .cost-table-wrap, .climate-card { break-inside: avoid; }

  /* Print-only content */
  .print-only { display: block !important; }

  /* Add print date */
  .site-footer .footer-bottom p::after {
    content: " | تاریخ چاپ: " attr(data-print-date);
  }
}

/* Hide print-only elements on screen */
.print-only { display: none; }
