/* ==========================================================================
   CCR MEDICAL S.R.L. - STILE PERSONALIZZATO
   Forniture Medicali Scientifiche ed Elettromedicali dal 1975
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --primary-navy: #0a1f38;
  --primary-blue: #0284c7;
  --primary-dark: #0369a1;
  --accent-teal: #0d9488;
  --accent-cyan: #06b6d4;
  --bg-soft: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-light: #e2e8f0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-main);
  background-color: #ffffff;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-heading {
  font-family: 'Outfit', sans-serif;
}

/* Header & Nav */
.header-topbar {
  background: #06182c;
  font-size: 0.8125rem;
}

.navbar-sticky {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
}

/* Gradients & Background 2K */
.hero-gradient {
  background: radial-gradient(130% 100% at 90% 10%, rgba(2, 132, 199, 0.12) 0%, rgba(6, 182, 212, 0.05) 45%, #ffffff 100%),
              linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
}

.hero-bg-wrapper {
  position: relative;
  overflow: hidden;
  background: url('../img/2K.png') no-repeat center right;
  background-size: cover;
  background-attachment: scroll;
}

/* Riflesso luminoso animato costante ogni 4..5 secondi */
@keyframes heroLightSweep {
  0% {
    transform: translateX(-160%) skewX(-25deg);
    opacity: 0;
  }
  12% {
    opacity: 0.95;
  }
  32% {
    transform: translateX(260%) skewX(-25deg);
    opacity: 0;
  }
  100% {
    transform: translateX(260%) skewX(-25deg);
    opacity: 0;
  }
}

.hero-reflection-sweep {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 15;
}

.hero-reflection-sweep::before {
  content: '';
  position: absolute;
  top: -30%;
  left: 0;
  width: 55%;
  height: 160%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 20%,
    rgba(255, 255, 255, 0.4) 48%,
    rgba(255, 255, 255, 0.95) 52%,
    rgba(255, 255, 255, 0.4) 56%,
    rgba(255, 255, 255, 0.05) 80%,
    transparent 100%
  );
  filter: blur(12px);
  animation: heroLightSweep 4.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.gradient-text {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-gradient {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0369a1;
}

/* Product Card */
.product-card {
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px -10px rgba(2, 132, 199, 0.15);
  border-color: #7dd3fc;
}

.product-card .img-wrapper {
  background: #f8fafc;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.product-card .img-wrapper img {
  transition: transform 0.4s ease;
  max-height: 190px;
  object-fit: contain;
}

.product-card:hover .img-wrapper img {
  transform: scale(1.05);
}

/* Medical Tags */
.badge-cnd {
  background: #eff6ff;
  color: #1d4ed8;
  font-family: monospace;
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #bfdbfe;
}

.badge-nsis {
  background: #f0fdf4;
  color: #15803d;
  font-family: monospace;
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #bbf7d0;
}

.badge-class {
  background: #fef3c7;
  color: #b45309;
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #fde68a;
}

/* Mega Menu Dropdown */
.dropdown-menu-mega {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  max-width: 1080px;
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.2);
  border: 1px solid #e2e8f0;
  padding: 1.5rem;
  z-index: 50;
}

.dropdown-parent:hover .dropdown-menu-mega {
  display: block;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
  transform: translateY(-1px);
}

/* Section Decorative */
.section-pattern {
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Quote / Testimonial Box */
.stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.25s ease;
}

.stat-card:hover {
  border-color: #38bdf8;
  box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.1);
}

/* Modal */
.modal-backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

/* Cookie Banner */
#cookie-banner {
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   DYNAMIC SEARCH OVERLAY (Stile AzziniSPA)
   ========================================================================== */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 25, 45, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 60px 20px 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.search-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.search-close-btn {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
  transform: rotate(90deg);
}

.search-container-box {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.search-input-field {
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid transparent;
  border-radius: 1.25rem;
  padding: 1.1rem 1.4rem 1.1rem 3.5rem;
  font-size: 1.15rem;
  color: #0f172a;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}

.search-input-field:focus {
  outline: none;
  border-color: #0284c7;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.25), 0 25px 50px -10px rgba(0, 0, 0, 0.5);
}

.search-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  color: #e0f2fe;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-tag-chip:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  transform: translateY(-2px);
}

.search-result-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.search-result-card:hover {
  background: #ffffff;
  transform: translateX(4px);
  border-color: #38bdf8;
  box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.2);
}

/* ==========================================================================
   PAGINA INTRO & PULSANTI A TEMA MEDICALE DINAMICI (Stile Manzi Estintori)
   ========================================================================== */
.intro-kenburns-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
  background-color: #06182c;
}

.intro-kenburns-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: url('../img/sede2.png') no-repeat center center;
  background-size: cover;
  animation: introKenBurns 20s infinite alternate ease-in-out;
  transform-origin: center center;
}

@keyframes introKenBurns {
  0% {
    transform: scale(1.0);
  }
  100% {
    transform: scale(1.08) translate(-1%, -1%);
  }
}

.intro-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(6, 24, 44, 0.35) 0%, rgba(6, 24, 44, 0.70) 100%),
              linear-gradient(180deg, rgba(6, 24, 44, 0.25) 0%, rgba(6, 24, 44, 0.65) 100%);
  z-index: 1;
}

/* Riflesso luminoso a tutto schermo per l'intro */
.intro-light-sweep {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.intro-light-sweep::after {
  content: '';
  position: absolute;
  top: -40%;
  left: 0;
  width: 55%;
  height: 180%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.03) 20%,
    rgba(255, 255, 255, 0.35) 48%,
    rgba(255, 255, 255, 0.8) 52%,
    rgba(255, 255, 255, 0.35) 56%,
    rgba(255, 255, 255, 0.03) 80%,
    transparent 100%
  );
  filter: blur(14px);
  animation: heroLightSweep 4.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Pulsanti Lingue Dinamici a Tema Medico (ECG Pulse / Vital Glow) */
.lang-med-btn {
  position: relative;
  overflow: hidden;
  background: rgba(15, 35, 60, 0.75);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(56, 189, 248, 0.3);
  border-radius: 1rem;
  padding: 14px 18px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(2, 132, 199, 0.15);
  text-decoration: none;
}

.lang-med-btn:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: #38bdf8;
  background: rgba(14, 45, 80, 0.9);
  box-shadow: 0 16px 30px -6px rgba(2, 132, 199, 0.4), 0 0 25px rgba(6, 182, 212, 0.35), inset 0 0 15px rgba(56, 189, 248, 0.25);
}

/* Linea ECG Battito Cardiaco animata nel pulsante */
.ecg-line-svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 24px;
  pointer-events: none;
  opacity: 0.35;
  transition: opacity 0.3s ease;
  animation: ecgTrack 3s linear infinite;
}

.lang-med-btn:hover .ecg-line-svg {
  opacity: 0.9;
  filter: drop-shadow(0 0 4px #06b6d4);
  animation-duration: 1.5s;
}

@keyframes ecgTrack {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Pulsing Heartbeat Dot */
.vital-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #06b6d4;
  box-shadow: 0 0 8px #06b6d4;
  animation: vitalPulse 1.4s ease-in-out infinite;
}

@keyframes vitalPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.4); opacity: 1; box-shadow: 0 0 14px #38bdf8; }
}

/* Toast Notification (Stile Azzini / Manzi) */
.toast-msg {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  padding: 14px 24px;
  border-radius: 9999px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(2, 132, 199, 0.3);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-msg.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
