:root {
  --primary-color: #26a69a;
  --primary-light: #e0f7fa;
  --primary-dark: #004d40;
  --text-color: #004d40;
  --footer-bg: #26a69a;
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --border-gray: #b2dfdb;
  --shadow-light: rgba(38, 166, 154, 0.07);
  --shadow-medium: rgba(38, 166, 154, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.header {
  background-color: var(--primary-light);
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  margin-left: 0;
  width: 100%;
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.logo-link {
  flex-shrink: 0;
  z-index: 1001;
}

.logo-link img {
  height: 40px;
  width: auto;
  display: block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  justify-content: flex-start;
  margin-left: 40px;
}

.nav-item {
  position: relative;
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  border-radius: 6px;
  font-size: 0.9rem;
}

.nav-item:hover {
  color: var(--primary-dark);
  background-color: rgba(38, 166, 154, 0.1);
}

.nav-item.has-dropdown::after {
  content: "▼";
  font-size: 0.7em;
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
  color: var(--primary-color);
}

.nav-item.has-dropdown.active::after {
  transform: rotate(180deg);
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--white);
  min-width: 280px;
  box-shadow: 0 8px 32px rgba(38, 166, 154, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-15px);
  transition: all 0.3s ease;
  z-index: 2000;
  border-radius: 12px;
  border: 1px solid var(--border-gray);
  padding: 0.5rem;
  backdrop-filter: blur(10px);
}

.nav-item:hover .dropdown,
.nav-item.active .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.dropdown-item:hover {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  transform: translateX(4px);
}

.dropdown-item.has-submenu::after {
  content: "▶";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7em;
  color: var(--primary-color);
}

.dropdown .submenu {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-15px);
  transition: all 0.3s ease;
  position: absolute;
  left: 100%;
  top: 0;
  min-width: 200px;
  z-index: 3000;
  background: var(--white);
  box-shadow: 0 8px 32px rgba(38, 166, 154, 0.2);
  border-radius: 12px;
  border: 1px solid var(--border-gray);
  padding: 0.5rem;
  backdrop-filter: blur(10px);
}

.dropdown-item.has-submenu:hover>.submenu,
.dropdown-item.has-submenu.active>.submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  z-index: 4000;
}

.dropdown>.submenu {
  left: 0;
  top: 100%;
  min-width: 220px;
  transform: translateY(-15px);
}

.header-search {
  display: flex;
  align-items: center;
  border-radius: 19px;
  box-shadow: none;
  padding: 0;
  max-width: 220px;
  width: auto;
  position: relative;
  overflow: visible;
  background: transparent;
  transition: background 0.2s;
}

.header-search.expanded {
  background: #fff;
}

.header-search input[type="text"] {
  height: 38px;
  border: none;
  background: transparent;
  padding: 0 14px;
  font-size: 1rem;
  outline: none;
  color: #222;
  width: 0;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
  border-radius: 19px 0 0 19px;
  position: relative;
  z-index: 1;
}

/* width, opacity e pointer-events serão controlados por GSAP */

.header-search button {
  background: #26A699;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 0;
  box-shadow: none;
  transition: background 0.18s, border-radius 0.3s;
  outline: none;
  padding: 0;
  z-index: 2;
  position: relative;
  left: 0;
}

.header-search.expanded button {
  border-radius: 0 19px 19px 0;
  background: #26A699;
  width: 44px;
  height: 38px;
  margin-left: 0;
}

.header-search button:hover,
.header-search button:focus {
  background: #1e857a;
}

.header-search button svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
}

.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.hero-banner {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 16px;
  box-shadow: 0 8px 32px var(--shadow-medium);
  margin-bottom: 2rem;
  text-align: center;
  padding: 2rem;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

.hero-banner-text {
  position: relative;
  z-index: 1;
}

.hero-banner-text h1 {
  color: var(--white);
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-banner-text p {
  color: var(--primary-light);
  font-size: 1.1rem;
  font-weight: 300;
  opacity: 0.9;
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.cards-container .card:first-child {
  border-width: 3px;
  border-style: solid;
  border-color: var(--border-gray);
}

.card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 4px 20px var(--shadow-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 3px solid var(--border-gray);
  position: relative;
}

.card:hover {
  box-shadow: 0 12px 40px var(--shadow-medium);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background-color: var(--primary-light);
  transition: transform 0.3s ease;
}

.card:hover .card-img {
  transform: scale(1.05);
}

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-content h2 {
  margin-bottom: 0.75rem;
  color: var(--primary-color);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.card-content p {
  color: var(--text-color);
  margin-bottom: 1.5rem;
  opacity: 0.8;
  line-height: 1.6;
  flex-grow: 1;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
}

.read-more-btn {
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 25px;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
  text-align: center;
  text-decoration: none;
}

.read-more-btn:hover {
  background: var(--primary-dark);
  color: var(--white);
  box-shadow: none;
  text-decoration: none;
}

footer {
  background-color: var(--footer-bg);
  color: var(--white);
  padding: 2.2rem 0 0 0;
  margin-top: 3rem;
  width: 100%;
  margin: 0;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  padding: 0 1.2rem 0 1.2rem;
}

.footer-details {
  padding: 0.9rem 0.9rem;
  margin: 0;
}

.footer-section {
  padding: 0.9rem 0.9rem;
  margin: 0;
}

.footer-section h2 {
  margin-bottom: 1rem;
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 600;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--white);
  text-decoration: none;
  transition: all 0.2s ease;
  opacity: 0.9;
  font-size: 0.9rem;
}

.footer-section a:hover {
  color: var(--primary-light);
  opacity: 1;
  transform: translateX(4px);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--white);
  text-decoration: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.tag:hover {
  background-color: #198976;
  color: var(--white);
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.nav-item:focus,
.dropdown-item:focus,
.read-more-btn:focus,
.header-search input:focus,
.header-search button:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

@media (hover: none) and (pointer: coarse) {

  .nav-item,
  .dropdown-item,
  .read-more-btn,
  .mobile-menu-toggle {
    min-height: 44px;
    min-width: 44px;
  }
}

.card-img {
  background: linear-gradient(90deg, var(--primary-light) 25%, rgba(255, 255, 255, 0.5) 50%, var(--primary-light) 75%);
  background-size: 200% 100%;
}

@media (display-mode: standalone) {
  .header {
    padding-top: calc(0.75rem + env(safe-area-inset-top));
  }
}

.icon-link-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  gap: 0.5em;
}

.icon-link-btn i {
  margin-left: 0.5em;
  margin-right: 0;
}

.icon-link-btn .fa-link {
  color: var(--primary-color);
  opacity: 1;
  transition: color 0.2s;
}

.icon-link-btn:hover .fa-link {
  color: var(--primary-dark);
}

.footer-copyright {
  width: 100%;
  background: #102b26;
  color: #e0f7f4;
  text-align: center;
  padding: 1rem 0 0.7rem 0;
  font-size: 0.92rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0.95;
  letter-spacing: 0.01em;
  box-sizing: border-box;
  margin-top: 2.5rem;
}

@media (min-width: 1200px) {
  .content {
    max-width: 1400px;
    padding: 2.5rem 2rem;
  }

  .hero-banner {
    min-height: 320px;
    padding: 3.5rem 2rem;
    font-size: 1.2rem;
  }

  .cards-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }

  .card-content {
    padding: 2.2rem 2rem;
  }

  .footer-content {
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    padding: 0 2.5rem;
  }

  .footer-section h2 {
    font-size: 1.25rem;
  }

  .footer-section a,
  .tag {
    font-size: 1.05rem;
  }
}

@media (min-width: 1600px) {
  .content {
    max-width: 1800px;
    padding: 3.5rem 4rem;
  }

  .hero-banner {
    min-height: 400px;
    font-size: 1.3rem;
  }

  .cards-container {
    gap: 3.5rem;
  }

  .footer-content {
    gap: 4rem;
    padding: 0 4rem;
  }
}

/* ===== MENU HAMBÚRGUER ===== */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  position: relative;
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background: var(--primary-color);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
  display: block;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== TOUCH E SCROLL MOBILE ===== */
html,
body {
  touch-action: manipulation;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
}

body {
  user-select: auto;
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
}

/* Permitir scroll suave em mobile */
@media (max-width: 768px) {
  html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  body {
    touch-action: manipulation;
    overflow-x: hidden;
    overflow-y: auto;
  }

  * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
  }

  /* Permitir scroll em elementos específicos */
  .nav-menu,
  .dropdown,
  .submenu {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
  }

  /* Melhorar experiência de touch */
  a,
  button,
  .clickable {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(38, 166, 154, 0.2);
    cursor: pointer;
  }

  /* Permitir scroll em containers */
  .cards-container,
  .footer-content,
  .hero-banner {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
  }

  /* Remover zoom em input em iOS */
  input,
  textarea,
  select {
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
  }
}

/* ===== RESPONSIVIDADE COMPLETA ===== */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
  .nav {
    max-width: 100%;
    padding: 0 1rem;
  }

  .nav-menu {
    gap: 0.5rem;
  }

  .nav-item {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }

  .cards-container {
    gap: 2rem;
    padding: 0 1rem;
  }

  .card {
    max-width: 100%;
  }

  .hero-banner {
    padding: 2rem 1rem;
  }

  .hero-banner-text h1 {
    font-size: 2.2rem;
  }
}

/* Tablets pequenos (600px - 768px) */
@media (max-width: 768px) {
  .header {
    padding: 1rem;
    position: relative;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .nav {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0;
  }

  .logo-link {
    flex-shrink: 0;
    max-width: 150px;
  }

  .logo-link img {
    max-width: 100%;
    height: auto;
  }

  .header-search {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .search-toggle {
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(38, 166, 154, 0.3);
  }

  .search-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(38, 166, 154, 0.4);
  }

  .search-toggle svg {
    width: 18px;
    height: 18px;
    fill: var(--white);
  }

  .mobile-menu-toggle {
    display: none !important;
  }


  .nav-menu {
    display: none !important;
  }



  .hero-banner {
    padding: 1.5rem 1rem;
    margin: 1rem;
  }

  .hero-banner-text h1 {
    font-size: 1.8rem;
  }

  .hero-banner-text p {
    font-size: 1rem;
  }

  .cards-container {
    flex-direction: column;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .card {
    max-width: 100%;
  }

  .card-content {
    padding: 1.5rem;
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 0 1rem;
  }

  .header-search {
    max-width: 100%;
    margin-top: 1rem;
  }
}

/* Menu mobile específico */
@media (max-width: 768px) {
  .nav-item.has-dropdown .dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 100%;
    background: var(--white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border: 1px solid var(--border-gray);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
  }

  .nav-item.has-dropdown.active .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-item.has-dropdown .dropdown-item {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-gray);
    display: block;
    width: 100%;
  }

  .nav-item.has-dropdown .dropdown-item:last-child {
    border-bottom: none;
  }

  .nav-item.has-dropdown .submenu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: rgba(38, 166, 154, 0.1);
    margin: 0.5rem 0 0 1rem;
    border-radius: 6px;
    padding: 0.5rem;
  }

  .nav-item.has-dropdown .dropdown-item.has-submenu::after {
    content: "▶";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    color: var(--primary-color);
  }
}

/* Telemóveis grandes (480px - 600px) */
@media (max-width: 600px) {
  .header {
    padding: 0.5rem;
  }

  .logo-link img {
    height: 40px;
  }

  .nav {
    padding: 0;
  }

  .nav-menu {
    gap: 0.3rem;
  }

  .nav-item {
    padding: 0.6rem;
    font-size: 0.85rem;
  }

  .hero-banner {
    padding: 1rem;
    margin: 0.5rem;
  }

  .hero-banner-text h1 {
    font-size: 1.5rem;
  }

  .hero-banner-text p {
    font-size: 0.9rem;
  }

  .cards-container {
    padding: 0 0.5rem;
    gap: 1rem;
  }

  .card-content {
    padding: 1rem;
  }

  .card-content h2 {
    font-size: 1.1rem;
  }

  .card-content p {
    font-size: 0.9rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 0.5rem;
  }

  .footer-section {
    padding: 0.5rem;
  }

  .footer-section h2 {
    font-size: 1rem;
  }

  .footer-section a,
  .tag {
    font-size: 0.85rem;
  }

  .header-search {
    max-width: 100%;
    margin-top: 0.5rem;
  }

  .header-search input[type="text"] {
    font-size: 0.9rem;
  }
}

/* Telemóveis pequenos (até 480px) */
@media (max-width: 480px) {
  .header {
    padding: 0.3rem;
  }

  .logo-link img {
    height: 35px;
  }

  .nav-item {
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  .hero-banner {
    padding: 0.8rem;
    margin: 0.3rem;
  }

  .hero-banner-text h1 {
    font-size: 1.3rem;
  }

  .hero-banner-text p {
    font-size: 0.85rem;
  }

  .cards-container {
    padding: 0 0.3rem;
    gap: 0.8rem;
  }

  .card-content {
    padding: 0.8rem;
  }

  .card-content h2 {
    font-size: 1rem;
  }

  .card-content p {
    font-size: 0.85rem;
  }

  .read-more-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .footer-content {
    padding: 0 0.3rem;
    gap: 1rem;
  }

  .footer-section {
    padding: 0.3rem;
  }

  .footer-section h2 {
    font-size: 0.95rem;
  }

  .footer-section a,
  .tag {
    font-size: 0.8rem;
  }

  .tag {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  .footer-copyright {
    font-size: 0.8rem;
    padding: 0.8rem 0 0.6rem 0;
  }
}

/* Telemóveis muito pequenos (até 360px) */
@media (max-width: 360px) {
  .header {
    padding: 0.75rem;
    min-height: 60px;
  }

  .nav {
    gap: 0.5rem;
  }

  .logo-link {
    max-width: 120px;
  }

  .logo-link img {
    max-width: 100%;
    height: auto;
  }

  .search-toggle {
    width: 36px;
    height: 36px;
  }

  .search-toggle svg {
    width: 16px;
    height: 16px;
  }


  .hero-banner-text h1 {
    font-size: 1.2rem;
  }

  .hero-banner-text p {
    font-size: 0.8rem;
  }

  .card-content h2 {
    font-size: 0.95rem;
  }

  .card-content p {
    font-size: 0.8rem;
  }

  .nav-item {
    font-size: 0.75rem;
    padding: 0.4rem;
  }

  .footer-section h2 {
    font-size: 0.9rem;
  }

  .footer-section a,
  .tag {
    font-size: 0.75rem;
  }
}

/* Orientação landscape em telemóveis */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-banner {
    padding: 1rem;
  }

  .hero-banner-text h1 {
    font-size: 1.5rem;
  }

  .nav {
    flex-direction: row;
    justify-content: space-between;
  }

  .nav-menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-item {
    width: auto;
    flex: 1;
    min-width: 0;
  }
}

/* Melhorias de acessibilidade para touch */
@media (hover: none) and (pointer: coarse) {

  .nav-item,
  .dropdown-item,
  .read-more-btn,
  .cookie-button {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .dropdown-item {
    padding: 0.8rem 1rem;
  }

  .read-more-btn {
    padding: 0.8rem 1.5rem;
  }
}

/* Otimizações para dispositivos de alta densidade */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
  .logo-link img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}










/* Adicionar ao final do index.css */

/* ===== CHATBOT ===== */
.chatbot-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-color);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(38, 166, 154, 0.4);
  transition: all 0.3s ease;
  z-index: 1001;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.chatbot-toggle:hover,
.chatbot-toggle:focus {
  background: var(--primary-dark);
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(38, 166, 154, 0.6);
  outline: none;
}

.chatbot-toggle svg {
  width: 28px;
  height: 28px;
  pointer-events: none;
}

.chatbot-window {
  position: fixed;
  bottom: 90px;
  left: 20px;
  width: min(420px, calc(100vw - 40px));
  height: min(600px, calc(100vh - 120px));
  max-height: 80vh;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1002;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-overflow-scrolling: touch;
  will-change: opacity, transform;
}

.chatbot-window.active {
  display: flex;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chatbot-header {
  background: var(--primary-color);
  color: white;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 16px 16px 0 0;
  flex-shrink: 0;
  min-height: 60px;
}

.chatbot-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  user-select: none;
}

.chatbot-close {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s;
  min-width: 36px;
  min-height: 36px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.chatbot-close:hover,
.chatbot-close:focus {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: 0;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(38, 166, 154, 0.3);
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(38, 166, 154, 0.5);
}

.chatbot-message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-message p {
  margin: 0;
  padding: 0.875rem 1.125rem;
  border-radius: 12px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  font-size: 0.95rem;
}

.bot-message {
  align-self: flex-start;
}

.bot-message p {
  background: white;
  color: var(--text-color);
  border: 1px solid var(--border-gray);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.user-message {
  align-self: flex-end;
}

.user-message p {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 1px 3px rgba(38, 166, 154, 0.3);
}

.chatbot-typing {
  align-self: flex-start;
  padding: 0.875rem 1.125rem;
  background: white;
  border: 1px solid var(--border-gray);
  border-radius: 12px;
  display: flex;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.chatbot-typing span {
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.chatbot-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.chatbot-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }

  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

.chatbot-input-form {
  display: flex;
  padding: 1rem;
  background: white;
  border-top: 1px solid var(--border-gray);
  gap: 0.625rem;
  flex-shrink: 0;
  align-items: center;
}

.chatbot-input-form input {
  flex: 1;
  padding: 0.875rem 1.125rem;
  border: 1px solid var(--border-gray);
  border-radius: 25px;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
  background: #f8f9fa;
  min-width: 0;
  font-family: inherit;
}

.chatbot-input-form input:focus {
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 3px rgba(38, 166, 154, 0.1);
}

.chatbot-input-form button {
  background: var(--primary-color);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.chatbot-input-form button:hover,
.chatbot-input-form button:focus {
  background: var(--primary-dark);
  transform: scale(1.05);
  outline: none;
  box-shadow: 0 2px 8px rgba(38, 166, 154, 0.3);
}

.chatbot-input-form button:active {
  transform: scale(0.98);
}

.chatbot-input-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .chatbot-window {
    width: min(400px, calc(100vw - 40px));
    height: min(580px, calc(100vh - 120px));
  }
}

/* Tablet pequeno (600px - 768px) */
@media (max-width: 768px) {
  .chatbot-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 110px);
    max-height: 85vh;
    bottom: 80px;
    left: 16px;
  }

  .chatbot-toggle {
    bottom: 16px;
    left: 16px;
    width: 56px;
    height: 56px;
  }

  .chatbot-header {
    padding: 0.875rem 1rem;
    min-height: 56px;
  }

  .chatbot-header h3 {
    font-size: 1.05rem;
  }

  .chatbot-messages {
    padding: 0.875rem;
    gap: 0.625rem;
  }

  .chatbot-message {
    max-width: 90%;
  }

  .chatbot-message p {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .chatbot-input-form {
    padding: 0.875rem;
    gap: 0.5rem;
  }

  .chatbot-input-form input {
    padding: 0.75rem 1rem;
    font-size: 16px;
  }
}

/* Mobile grande (480px - 600px) */
@media (max-width: 600px) {
  .chatbot-window {
    width: calc(100vw - 24px);
    height: calc(100vh - 100px);
    max-height: 88vh;
    bottom: 75px;
    left: 12px;
    border-radius: 12px;
  }

  .chatbot-toggle {
    bottom: 12px;
    left: 12px;
    width: 54px;
    height: 54px;
  }

  .chatbot-header {
    border-radius: 12px 12px 0 0;
    padding: 0.75rem 0.875rem;
    min-height: 52px;
  }

  .chatbot-header h3 {
    font-size: 1rem;
  }

  .chatbot-close {
    min-width: 32px;
    min-height: 32px;
    padding: 6px;
  }

  .chatbot-messages {
    padding: 0.75rem;
  }

  .chatbot-input-form button {
    width: 42px;
    height: 42px;
  }
}

/* Mobile pequeno (até 480px) */
@media (max-width: 480px) {
  .chatbot-window {
    width: calc(100vw - 16px);
    height: calc(100vh - 90px);
    max-height: 90vh;
    bottom: 70px;
    left: 8px;
  }

  .chatbot-toggle {
    bottom: 10px;
    left: 10px;
    width: 52px;
    height: 52px;
  }

  .chatbot-toggle svg {
    width: 24px;
    height: 24px;
  }

  .chatbot-header {
    padding: 0.625rem 0.75rem;
    min-height: 48px;
  }

  .chatbot-header h3 {
    font-size: 0.95rem;
  }

  .chatbot-messages {
    padding: 0.625rem;
    gap: 0.5rem;
  }

  .chatbot-message p {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
  }

  .chatbot-input-form {
    padding: 0.75rem;
  }

  .chatbot-input-form input {
    padding: 0.625rem 0.875rem;
  }

  .chatbot-input-form button {
    width: 40px;
    height: 40px;
  }
}

/* Mobile muito pequeno (até 360px) */
@media (max-width: 360px) {
  .chatbot-window {
    width: calc(100vw - 12px);
    height: calc(100vh - 80px);
    max-height: 92vh;
    bottom: 65px;
    left: 6px;
    border-radius: 10px;
  }

  .chatbot-toggle {
    bottom: 8px;
    left: 8px;
    width: 50px;
    height: 50px;
  }

  .chatbot-toggle svg {
    width: 22px;
    height: 22px;
  }

  .chatbot-header {
    border-radius: 10px 10px 0 0;
    padding: 0.5rem 0.625rem;
    min-height: 44px;
  }

  .chatbot-header h3 {
    font-size: 0.9rem;
  }

  .chatbot-close {
    min-width: 30px;
    min-height: 30px;
    padding: 5px;
  }

  .chatbot-close svg {
    width: 18px;
    height: 18px;
  }

  .chatbot-messages {
    padding: 0.5rem;
  }

  .chatbot-message {
    max-width: 92%;
  }

  .chatbot-message p {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 10px;
  }

  .chatbot-typing {
    padding: 0.5rem 0.75rem;
  }

  .chatbot-typing span {
    width: 7px;
    height: 7px;
  }

  .chatbot-input-form {
    padding: 0.625rem;
    gap: 0.375rem;
  }

  .chatbot-input-form input {
    padding: 0.5rem 0.75rem;
    font-size: 16px;
    border-radius: 20px;
  }

  .chatbot-input-form button {
    width: 38px;
    height: 38px;
  }

  .chatbot-input-form button svg {
    width: 18px;
    height: 18px;
  }
}

/* Landscape mode em mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .chatbot-window {
    height: calc(100vh - 70px);
    max-height: 95vh;
    bottom: 60px;
  }

  .chatbot-toggle {
    width: 48px;
    height: 48px;
  }

  .chatbot-header {
    padding: 0.5rem 0.75rem;
    min-height: 40px;
  }

  .chatbot-messages {
    padding: 0.5rem;
  }

  .chatbot-input-form {
    padding: 0.5rem;
  }
}

/* Ajustes para telas muito altas */
@media (min-height: 900px) {
  .chatbot-window {
    height: 650px;
  }
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {

  .chatbot-window,
  .chatbot-message,
  .chatbot-typing span {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
  .chatbot-window {
    background: #1a1a1a;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  }

  .chatbot-messages {
    background: #0f0f0f;
  }

  .bot-message p {
    background: #262626;
    color: #e0e0e0;
    border-color: #404040;
  }

  .chatbot-typing {
    background: #262626;
    border-color: #404040;
  }

  .chatbot-input-form {
    background: #1a1a1a;
    border-top-color: #404040;
  }

  .chatbot-input-form input {
    background: #262626;
    color: #e0e0e0;
    border-color: #404040;
  }

  .chatbot-input-form input:focus {
    background: #2a2a2a;
  }
}