/* ==================== CSS VARIABLES ==================== */
:root {
  --primary-color: #0077cc;
  --primary-dark: #005fa3;
  --primary-light: #e3f2fd;
  --secondary-color: #003366;
  --accent-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --text-dark: #003366;
  --text-medium: #444f5a;
  --text-light: #666;
  --bg-primary: #ffffff;
  --bg-secondary: #f0f4f8;
  --bg-tertiary: #f9fbfd;
  --border-color: #d6e2f0;
  --border-light: #e9ecef;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 119, 204, 0.06);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.25);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: all 0.25s ease;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ==================== RESET & BASE ==================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background: var(--bg-secondary);
  color: var(--text-dark);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 14px;
}

/* ==================== OVERLAY ==================== */
#overlay-bg {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998; /* CAMBIATO da 999 a 9998 */
  backdrop-filter: blur(2px);
  pointer-events: auto; /* AGGIUNTO per garantire i click */
}

/* ==================== MAIN LAYOUT ==================== */
.main-content {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  gap: 20px;
  flex-wrap: wrap;
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: 400px;
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 90vh;
  overflow-y: auto;
  position: sticky;
  top: 20px;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

/* ==================== BRANDING ==================== */
.branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.branding .logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-light);
  transition: var(--transition);
}

.branding .logo:hover {
  transform: scale(1.05);
  border-color: var(--primary-color);
}

.branding .studio-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--secondary-color);
  text-align: center;
  line-height: 1.4;
}

.branding .studio-site {
  font-size: 14px;
  color: var(--text-light);
  text-align: center;
}

.branding .photos {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.branding .photos img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--primary-color);
  transition: var(--transition);
}

.branding .photos img:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.branding .photos .more {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid var(--primary-color);
}

.branding .photos .more:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

/* ==================== PROMO SECTION ==================== */
.promo {
  background: linear-gradient(135deg, var(--primary-light), #bbdefb);
  border-left: 4px solid var(--primary-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.promo::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: var(--primary-color);
  opacity: 0.1;
  border-radius: 50%;
  transform: translate(20px, -20px);
}

.promo h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.promo .scadenza {
  font-size: 13px;
  font-style: italic;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.promo .descrizione {
  font-size: 14px;
  color: var(--text-dark);
  line-height: 1.5;
  margin-bottom: 0;
}

.promo .prezzo {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-color);
  margin-top: 8px;
  margin-bottom: 0;
}

/* ==================== INFO BUTTONS ==================== */
.info-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}

.info-buttons button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius-md);
  background: #f1f5f9;
  color: var(--text-dark);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  text-align: left;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.info-buttons button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.info-buttons button:hover::before {
  left: 100%;
}

.info-buttons button:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.info-buttons button i {
  font-size: 18px;
  color: var(--primary-color);
  min-width: 20px;
  transition: var(--transition);
}

.info-buttons button:hover i {
  transform: scale(1.1);
}

/* ==================== CHAT WINDOW ==================== */
.chat-window {
  flex: 1;
  min-width: 360px;
  max-width: 460px;
  height: 90vh;
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: sticky;
  top: 20px;
  z-index: 10; /* AGGIUNTO per controllare lo stacking */
}


.chat-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  padding: 16px 18px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.chat-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.chat-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  padding: 4px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-tertiary);
  scroll-behavior: smooth;
}

.chat-body::-webkit-scrollbar {
  width: 6px;
}

.chat-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.chat-input {
  padding: 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 10px;
  background: var(--bg-primary);
}

.chat-input input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  outline: none;
  font-size: 14px;
  transition: var(--transition);
  background: var(--bg-tertiary);
}

.chat-input input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--bg-primary);
}

.chat-input button {
  background: var(--primary-color);
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.chat-input button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ==================== CHAT MESSAGES ==================== */
.message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: messageSlide 0.3s ease-out;
  position: relative;
}

@keyframes messageSlide {
  from { 
    opacity: 0; 
    transform: translateY(10px) scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

.message.bot {
  background: white;
  color: var(--text-dark);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.message.user {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  box-shadow: var(--shadow-sm);
}

/* ==================== TYPING INDICATOR ==================== */
.typing-indicator {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 8px 0;
}

.typing-bubble {
  background: white;
  padding: 12px 16px;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  display: flex;
  gap: 4px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.typing-bubble .dot {
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-bubble .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-bubble .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* ==================== CHAT OPTION BUTTONS ==================== */
.chat-option-btn {
  padding: 10px 16px;
  background: var(--bg-primary);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  margin: 4px;
  display: inline-block;
}

.chat-option-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.chat-option-btn:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  border-color: #ccc;
}

/* ==================== POPUP BASE ==================== */
.info-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-primary);
  padding: 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 9999; /* CAMBIATO da 1001 a 9999 */
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  animation: popupShow 0.3s ease-out;
  pointer-events: auto; /* AGGIUNTO per garantire l'interazione */
}

@keyframes popupShow {
  from { 
    opacity: 0; 
    transform: translate(-50%, -60%) scale(0.9); 
  }
  to { 
    opacity: 1; 
    transform: translate(-50%, -50%) scale(1); 
  }
}

.info-popup::-webkit-scrollbar {
  width: 6px;
}

.info-popup::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.info-popup::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.info-popup h3 {
  margin: 0 0 24px 0;
  color: var(--secondary-color);
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.close-btn {
  margin-top: 24px;
  background: var(--primary-color);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.close-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ==================== POPUP GALLERY ==================== */
.gallery-popup {
  width: 90vw;
  max-width: 600px;
}

.gallery-main img {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.gallery-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  overflow-x: auto;
  justify-content: center;
  padding: 4px;
}

.gallery-thumbnails img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
}

.gallery-thumbnails img:hover {
  transform: scale(1.05);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

/* ==================== POPUP INFO STUDIO ==================== */
#popup-info-studio {
  width: 90vw;
  max-width: 640px;
}

.info-studio-grid {
  display: grid;
  gap: 20px;
  text-align: left;
}

.info-block {
  background: #f8fafe;
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border-left: 4px solid var(--primary-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.info-block:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.info-block .icon {
  font-size: 24px;
  color: var(--primary-color);
  flex-shrink: 0;
  margin-top: 2px;
}

.info-block .text strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 6px;
}

.info-block .text p {
  font-size: 14px;
  color: var(--text-medium);
  line-height: 1.6;
  margin: 0;
}

/* ==================== POPUP SPECIALIZZAZIONI ==================== */
#popup-specializzazioni {
  width: 90vw;
  max-width: 700px;
}

.specialties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  text-align: center;
}

.specialty {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.specialty:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.specialty .icon {
  font-size: 32px;
  color: var(--primary-color);
  margin-bottom: 12px;
  transition: var(--transition);
}

.specialty:hover .icon {
  transform: scale(1.1);
}

.specialty .text strong {
  font-size: 16px;
  color: var(--secondary-color);
  margin-bottom: 8px;
  font-weight: 600;
  display: block;
}

.specialty .text p {
  font-size: 13px;
  color: var(--text-medium);
  line-height: 1.5;
  margin: 0;
}

.specialty .text small {
  font-size: 12px;
  color: var(--primary-color);
  font-weight: 600;
  margin-top: 8px;
  display: block;
}

/* ==================== POPUP ORARI ==================== */
#popup-orari {
  width: 90vw;
  max-width: 700px;
}

/* ==================== TAB SYSTEM ==================== */
.tab-container {
  margin-bottom: 24px;
}

.tab-buttons {
  display: flex;
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 6px;
  margin-bottom: 20px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  gap: 4px;
}

.tab-button {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-button.active {
  background: var(--bg-primary);
  color: var(--primary-color);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 119, 204, 0.15);
}

.tab-button:hover:not(.active) {
  color: var(--primary-color);
  background: rgba(0, 119, 204, 0.05);
}

.tab-content {
  display: none;
  min-height: 300px;
  max-height: 400px;
  overflow-y: auto;
}

.tab-content.active {
  display: block;
  animation: tabFade 0.3s ease-in-out;
}

@keyframes tabFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== SCHEDULE GRID ==================== */
.schedule-normal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.schedule-item {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition);
}

.schedule-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.schedule-item .icon {
  font-size: 24px;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.schedule-item .text strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 4px;
  display: block;
}

.schedule-item .text p {
  font-size: 14px;
  color: var(--text-medium);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.schedule-item.closed {
  background: #ffebee;
  border-color: var(--danger-color);
}

.schedule-item.closed .icon {
  color: var(--danger-color);
}

.schedule-item.closed .text strong,
.schedule-item.closed .text p {
  color: var(--danger-color);
}

.schedule-item.special {
  background: #fff3cd;
  border-left: 4px solid var(--warning-color);
  flex-direction: row;
  text-align: left;
  padding: 14px 18px;
}

.schedule-item.special .icon {
  font-size: 20px;
  color: #b8860b;
  margin-bottom: 0;
  margin-right: 12px;
}

.schedule-item.special .text {
  flex: 1;
}

.schedule-item.special .text strong {
  font-size: 14px;
  color: #856404;
}

.schedule-item.special .text p {
  font-size: 13px;
  color: #856404;
  justify-content: flex-start;
}

/* ==================== CALENDARIO ==================== */
.calendar-container {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 8px;
}

.calendar-nav {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
  color: var(--primary-color);
}

.calendar-nav:hover {
  background: var(--primary-light);
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.calendar-month-year {
  font-size: 18px;
  font-weight: 600;
  color: var(--secondary-color);
  text-align: center;
  flex: 1;
  margin: 0 16px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.calendar-weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  padding: 8px 4px;
  background: #f8f9fa;
  border-radius: 6px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: default;
  transition: var(--transition);
  position: relative;
  min-height: 40px;
}

.calendar-day.current-month {
  color: var(--text-dark);
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
}

.calendar-day.other-month {
  color: #adb5bd;
  background: #f8f9fa;
}

.calendar-day.today {
  background: var(--primary-light);
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
}

.calendar-day.closed {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef5350;
  font-weight: 600;
}

.calendar-day.closed::after {
  content: "×";
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 12px;
  color: #c62828;
  font-weight: bold;
}

.calendar-day.vacation {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ff9800;
  font-weight: 600;
}

.calendar-day.vacation::after {
  content: "🏖️";
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 10px;
}

.calendar-day.holiday {
  background: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #ba68c8;
  font-weight: 600;
}

.calendar-day.holiday::after {
  content: "🎉";
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 10px;
}

/* Tooltip */
.calendar-day[data-tooltip] {
  position: relative;
}

.calendar-day[data-tooltip]:hover::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--secondary-color);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 10001; /* AUMENTATO per stare sopra i popup */
  box-shadow: var(--shadow-md);
}

.calendar-day[data-tooltip]:hover::after {
  content: "";
  position: absolute;
  bottom: 105%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--secondary-color);
  z-index: 10001; /* AUMENTATO per stare sopra i popup */
}

/* Legenda calendario */
.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
  padding: 12px;
  background: #f8f9fa;
  border-radius: var(--radius-sm);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-light);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.legend-color.closed {
  background: #ffebee;
  border-color: #ef5350;
}

.legend-color.vacation {
  background: #fff3e0;
  border-color: #ff9800;
}

.legend-color.holiday {
  background: #f3e5f5;
  border-color: #ba68c8;
}

/* ==================== POPUP SUPPORTO ==================== */
#popup-supporto {
  width: 90vw;
  max-width: 600px;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.support-item {
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: var(--transition);
  text-align: center;
}

.support-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.support-item .icon {
  font-size: 26px;
  color: var(--primary-color);
  margin-bottom: 12px;
  transition: var(--transition);
}

.support-item:hover .icon {
  transform: scale(1.1);
}

.support-item .text strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 6px;
  display: block;
}

.support-item .text p {
  font-size: 14px;
  color: var(--text-medium);
  margin: 0;
}

.support-item .text a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.support-item .text a:hover {
  text-decoration: underline;
  color: var(--primary-dark);
}

.support-item .text small {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  display: block;
}

/* ==================== POPUP LOCATION ==================== */
#popup-location {
  width: 90vw;
  max-width: 600px;
}

#popup-location p {
  font-size: 14px;
  color: var(--text-dark);
  margin: 6px 0;
  font-weight: 500;
}

#popup-location iframe {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin-top: 14px;
  border: 0;
  width: 100%;
  height: 200px;
}

.gmb-button {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background: var(--accent-color);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.gmb-button:hover {
  background: #218838;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ==================== FOOTER ==================== */
.footer-info {
  width: 100%;
  background: var(--bg-primary);
  color: var(--primary-color);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 24px 20px;
  gap: 24px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  min-height: 140px;
  margin-top: auto;
}

.footer-left,
.footer-center,
.footer-right {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.footer-left img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  transition: var(--transition);
}

.footer-left img:hover {
  transform: scale(1.05);
}

.footer-left .social-icons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.footer-left .social-icons a {
  color: var(--primary-color);
  font-size: 20px;
  transition: var(--transition);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-light);
}

.footer-left .social-icons a:hover {
  transform: scale(1.2);
  background: var(--primary-color);
  color: white;
}

.footer-center {
  color: var(--text-dark);
  font-weight: 600;
  line-height: 1.6;
}

.footer-right {
  color: var(--text-dark);
}

.footer-right img {
  height: 50px;
  margin-bottom: 8px;
  transition: var(--transition);
}

.footer-right img:hover {
  transform: scale(1.05);
}

.footer-right p {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.footer-info a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.footer-info a:hover {
  text-decoration: underline;
  color: var(--primary-dark);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .main-content {
    padding: 16px;
    gap: 16px;
  }
  
  .sidebar {
    width: 380px;
  }
  
  .chat-window {
    max-width: 420px;
  }
}

@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
    padding: 12px;
  }
  
  .sidebar {
    width: 100%;
    margin-bottom: 16px;
    position: static;
    max-height: none;
  }
  
  .chat-window {
    height: 500px;
    min-width: unset;
    max-width: unset;
    position: static;
  }
  
  .message {
    max-width: 95%;
  }
  
  .footer-info {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
  }
  
  .footer-right img {
    margin-bottom: 12px;
  }
  
  /* Popup responsive */
  .info-popup {
    width: 95% !important;
    max-width: none !important;
    padding: 20px !important;
    margin: 20px;
    max-height: 85vh;
  }
  
  .specialties-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  
  .schedule-normal-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  
  .support-grid {
    grid-template-columns: 1fr !important;
  }
  
  .schedule-item.special {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .schedule-item.special .icon {
    margin-right: 0;
    margin-bottom: 8px;
  }
  
  .tab-content {
    min-height: 250px;
    max-height: 350px;
  }
  
  .tab-button {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .info-block {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .info-block .icon {
    margin-bottom: 8px;
  }
  
  /* Calendario mobile */
  .calendar-container {
    padding: 16px;
  }
  
  .calendar-header {
    margin-bottom: 16px;
  }
  
  .calendar-nav {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .calendar-month-year {
    font-size: 16px;
    margin: 0 12px;
  }
  
  .calendar-day {
    min-height: 36px;
    font-size: 13px;
  }
  
  .calendar-weekday {
    font-size: 11px;
    padding: 6px 2px;
  }
  
  .calendar-legend {
    gap: 12px;
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 8px;
  }
  
  .sidebar {
    padding: 16px;
    gap: 12px;
  }
  
  .branding .photos img,
  .branding .photos .more {
    width: 40px;
    height: 40px;
  }
  
  .chat-window {
    height: 450px;
  }
  
  .info-popup {
    padding: 16px !important;
    margin: 10px;
  }
  
  .calendar-day {
    min-height: 32px;
    font-size: 12px;
  }
  
  .calendar-day.closed::after,
  .calendar-day.vacation::after,
  .calendar-day.holiday::after {
    font-size: 8px;
    top: 0;
    right: 1px;
  }
  
  .calendar-month-year {
    font-size: 15px;
  }
  
  .specialty {
    padding: 16px;
  }
  
  .specialty .icon {
    font-size: 28px;
  }
}

@media (max-width: 360px) {
  .calendar-day {
    min-height: 28px;
    font-size: 11px;
  }
  
  .calendar-nav {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  .calendar-month-year {
    font-size: 14px;
    margin: 0 8px;
  }
}
/* ==================== LOAD MORE BUTTON ==================== */
.load-more-btn {
  align-self: center;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #e3f2fd 100%);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  margin: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  min-width: 180px;
}

.load-more-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.load-more-btn:hover::before {
  left: 100%;
}

.load-more-btn:hover {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-dark);
}

.load-more-btn:disabled {
  background: #f8f9fa;
  color: #adb5bd;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  border-color: #dee2e6;
  box-shadow: none;
}

.load-more-btn:disabled::before {
  display: none;
}

.load-more-btn i {
  font-size: 14px;
  transition: var(--transition);
}

.load-more-btn:hover:not(:disabled) i {
  transform: scale(1.1);
}

/* Animazione di caricamento per il pulsante */
.load-more-btn.loading {
  pointer-events: none;
  background: linear-gradient(135deg, var(--primary-light) 0%, #e3f2fd 100%);
  color: var(--primary-color);
}

.load-more-btn.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==================== RESPONSIVE LOAD MORE ==================== */
@media (max-width: 768px) {
  .load-more-btn {
    padding: 8px 16px;
    font-size: 12px;
    min-width: 160px;
    margin: 6px 0;
  }
  
  .load-more-btn i {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .load-more-btn {
    padding: 8px 14px;
    font-size: 11px;
    min-width: 140px;
    gap: 6px;
  }
  
  .load-more-btn i {
    font-size: 11px;
  }
}

/* ==================== RESPONSIVE CHAT FIXES ==================== */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
    padding: 12px;
    gap: 12px; /* Ridotto gap */
  }
  
  .sidebar {
    width: 100%;
    margin-bottom: 16px;
    position: static;
    max-height: none;
    order: 2; /* AGGIUNTO: Mette la chat prima della sidebar */
  }
  
  .chat-window {
    height: 70vh; /* CAMBIATO da 500px a 70vh per essere più responsive */
    min-width: unset;
    max-width: unset;
    width: 100%; /* AGGIUNTO: Assicura che occupi tutta la larghezza */
    position: static;
    order: 1; /* AGGIUNTO: Mette la chat sopra la sidebar */
    margin-bottom: 16px; /* AGGIUNTO: Spazio sotto la chat */
  }
  
  /* FIX CHAT BODY MOBILE */
  .chat-body {
    padding: 12px; /* Ridotto padding */
    gap: 8px; /* Ridotto gap tra messaggi */
    min-height: calc(70vh - 140px); /* AGGIUNTO: Calcola altezza corretta */
  }
  
  /* FIX CHAT INPUT MOBILE */
  .chat-input {
    padding: 12px; /* Ridotto padding */
    gap: 8px; /* Ridotto gap */
  }
  
  .chat-input input {
    padding: 10px 14px; /* Ridotto padding */
    font-size: 16px; /* CAMBIATO: Evita zoom su iOS */
  }
  
  .chat-input button {
    padding: 10px 16px; /* Ridotto padding */
    font-size: 14px; /* AGGIUNTO: Dimensione testo */
  }
  
  /* FIX MESSAGGI MOBILE */
  .message {
    max-width: 90%; /* CAMBIATO da 95% a 90% */
    padding: 10px 14px; /* Ridotto padding */
    font-size: 14px; /* AGGIUNTO: Dimensione testo esplicita */
    line-height: 1.4; /* AGGIUNTO: Line height ottimizzata */
    margin-bottom: 4px; /* AGGIUNTO: Spazio tra messaggi */
  }
  
  /* FIX HEADER CHAT MOBILE */
  .chat-header {
    padding: 12px 16px; /* Ridotto padding */
    font-size: 15px; /* Ridotta dimensione testo */
  }
  
  .chat-header img {
    width: 36px; /* Ridotta dimensione */
    height: 36px; /* Ridotta dimensione */
  }
  
  /* POPUP RESPONSIVE MIGLIORATO */
  .info-popup {
    width: 95% !important;
    max-width: none !important;
    padding: 16px !important; /* Ridotto padding */
    margin: 10px !important; /* Ridotto margine */
    max-height: 80vh !important; /* CAMBIATO da 85vh a 80vh */
    border-radius: 12px !important; /* Ridotto border radius */
  }
  
  /* FOOTER MOBILE */
  .footer-info {
    flex-direction: column;
    gap: 16px; /* Ridotto gap */
    padding: 16px; /* Ridotto padding */
    min-height: 120px; /* Ridotta altezza minima */
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 8px;
    gap: 8px; /* Ulteriormente ridotto */
  }
  
  .chat-window {
    height: 65vh; /* CAMBIATO per schermo più piccolo */
    border-radius: 16px; /* Ridotto border radius */
  }
  
  .chat-body {
    padding: 10px; /* Ulteriormente ridotto */
    gap: 6px;
    min-height: calc(65vh - 130px); /* Ricalcolato */
  }
  
  .chat-input {
    padding: 10px; /* Ulteriormente ridotto */
  }
  
  .chat-input input {
    padding: 8px 12px; /* Ulteriormente ridotto */
    font-size: 16px; /* Mantiene 16px per evitare zoom */
  }
  
  .chat-input button {
    padding: 8px 14px; /* Ulteriormente ridotto */
  }
  
  .message {
    max-width: 88%; /* Ulteriormente ridotto */
    padding: 8px 12px; /* Ulteriormente ridotto */
    font-size: 13px; /* Ridotta dimensione testo */
  }
  
  .chat-header {
    padding: 10px 14px; /* Ulteriormente ridotto */
    font-size: 14px; /* Ridotta dimensione */
  }
  
  .chat-header img {
    width: 32px; /* Ulteriormente ridotta */
    height: 32px; /* Ulteriormente ridotta */
  }
  
  /* SIDEBAR MOBILE OTTIMIZZATA */
  .sidebar {
    padding: 14px; /* Ridotto padding */
    gap: 10px; /* Ridotto gap */
    border-radius: 16px; /* Ridotto border radius */
  }
  
  .branding .photos img,
  .branding .photos .more {
    width: 36px; /* Ridotte dimensioni */
    height: 36px; /* Ridotte dimensioni */
  }
  
  .info-buttons button {
    padding: 12px 16px; /* Ridotto padding */
    font-size: 14px; /* Ridotta dimensione testo */
  }
  
  /* POPUP EXTRA SMALL */
  .info-popup {
    width: 98% !important;
    padding: 12px !important;
    margin: 5px !important;
    max-height: 75vh !important;
  }
}

/* ==================== FIX LANDSCAPE MOBILE ==================== */
@media (max-width: 768px) and (orientation: landscape) {
  .chat-window {
    height: 85vh; /* Aumenta altezza in landscape */
  }
  
  .chat-body {
    min-height: calc(85vh - 140px);
  }
  
  .main-content {
    flex-direction: row; /* Ripristina row in landscape se c'è spazio */
    gap: 12px;
  }
  
  .sidebar {
    width: 300px; /* Larghezza fissa in landscape */
    order: 0; /* Ripristina ordine normale */
  }
  
  .chat-window {
    order: 0; /* Ripristina ordine normale */
    flex: 1;
    max-width: none;
  }
}

/* ==================== FIX VERY SMALL SCREENS ==================== */
@media (max-width: 360px) {
  .chat-window {
    height: 60vh; /* Riduce ulteriormente per schermi molto piccoli */
    border-radius: 12px;
  }
  
  .chat-body {
    padding: 8px;
    min-height: calc(60vh - 120px);
  }
  
  .chat-input {
    padding: 8px;
  }
  
  .message {
    max-width: 85%;
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .chat-header {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .chat-header img {
    width: 28px;
    height: 28px;
  }
}

/* ==================== FIX TOUCH TARGETS ==================== */
@media (max-width: 768px) {
  /* Assicura che tutti i pulsanti siano facilmente toccabili */
  .chat-input button,
  .info-buttons button,
  .close-btn,
  .tab-button {
    min-height: 44px; /* Apple raccomanda minimo 44px per touch targets */
  }
  
  .chat-option-btn {
    min-height: 40px;
    padding: 8px 14px;
  }
}

/* ==================== CHAT ASSISTANT BUTTON (MOBILE ONLY) ==================== */
.chat-assistant-btn {
  display: none !important; /* Nascosto di default */
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
  color: white !important;
  border: 2px solid var(--primary-color) !important;
  position: relative;
  overflow: hidden;
}

.chat-assistant-btn::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent) !important;
}

.chat-assistant-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark), #003d7a) !important;
  color: white !important;
  border-color: var(--primary-dark) !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 25px rgba(0, 119, 204, 0.4) !important;
}

.chat-assistant-btn .assistant-icon {
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  transition: var(--transition) !important;
  background: white !important; /* AGGIUNTO: Sfondo bianco */
  padding: 2px !important; /* AGGIUNTO: Padding per dare spazio all'icona */
}

.chat-assistant-btn:hover .assistant-icon {
  transform: scale(1.1) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  background: white !important; /* MANTIENE: Sfondo bianco anche al hover */
}

/* ==================== MOBILE CHAT WIDGET ==================== */
@media (max-width: 768px) {
  /* NASCONDE LA CHAT DESKTOP SU MOBILE */
  .chat-window {
    display: none !important;
  }
  
  /* MOSTRA IL PULSANTE ASSISTENTE NELLA SIDEBAR */
  .chat-assistant-btn {
    display: flex !important;
    animation: slideInUp 0.5s ease-out 0.3s both;
    order: -1; /* Lo mette PRIMO nella lista */
  }
  
  @keyframes slideInUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Effetto pulse per attirare attenzione */
  .chat-assistant-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    transform: translate(-50%, -50%) scale(0);
    animation: pulseEffect 3s infinite;
  }
  
  @keyframes pulseEffect {
    0%, 70%, 100% {
      transform: translate(-50%, -50%) scale(0);
      opacity: 1;
    }
    35% {
      transform: translate(-50%, -50%) scale(1.1);
      opacity: 0;
    }
  }
  
  /* WIDGET CHAT FLOATING - BASSO DESTRA */
  .chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    cursor: pointer;
    transition: var(--transition);
  }
  
  .chat-widget-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 119, 204, 0.3);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: visible; /* CAMBIATO: da hidden a visible per la notifica */
  }
  
  .chat-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 119, 204, 0.4);
  }
  
  .chat-widget-button img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: white; /* AGGIUNTO: Sfondo bianco */
    padding: 3px; /* AGGIUNTO: Padding per dare spazio all'icona */
    border: 2px solid rgba(255, 255, 255, 0.3); /* AGGIUNTO: Bordo */
  }
  
  /* NOTIFICA BADGE - MIGLIORATO POSIZIONAMENTO */
  .chat-notification {
    position: absolute;
    top: -12px; /* CAMBIATO: da -8px a -12px per essere più visibile */
    right: -12px; /* CAMBIATO: da -8px a -12px per essere più visibile */
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 26px; /* AUMENTATO: da 24px a 26px */
    height: 26px; /* AUMENTATO: da 24px a 26px */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.4); /* MIGLIORATO: shadow più forte */
    animation: pulse-notification 2s infinite;
    border: 2px solid white; /* AGGIUNTO: Bordo bianco per contrasto */
    z-index: 1001; /* AGGIUNTO: z-index per stare sopra al widget */
  }
  
  @keyframes pulse-notification {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
  }
  
  /* CHAT OVERLAY MOBILE */
  .chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: none;
    backdrop-filter: blur(2px);
  }
  
  .chat-overlay.active {
    display: block;
  }
  
  /* CHAT MOBILE FULLSCREEN */
  .chat-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 85vh;
    background: var(--bg-primary);
    border-radius: 20px 20px 0 0;
    z-index: 1002;
    display: none;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }
  
  .chat-mobile.active {
    display: flex;
    transform: translateY(0);
  }
  
  .chat-mobile-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 20px 20px 0 0;
    position: relative;
  }
  
  .chat-mobile-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
  }
  
  .chat-mobile-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 16px;
  }
  
  .chat-mobile-title img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: white; /* AGGIUNTO: Sfondo bianco */
    padding: 2px; /* AGGIUNTO: Padding per dare spazio all'icona */
  }
  
  .chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  
  .chat-mobile-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-tertiary);
  }
  
  .chat-mobile-body::-webkit-scrollbar {
    width: 4px;
  }
  
  .chat-mobile-body::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .chat-mobile-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
  }
  
  .chat-mobile-input {
    padding: 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
    background: var(--bg-primary);
    align-items: flex-end;
  }
  
  .chat-mobile-input input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    outline: none;
    font-size: 16px; /* Evita zoom su iOS */
    transition: var(--transition);
    background: var(--bg-tertiary);
    max-height: 120px;
  }
  
  .chat-mobile-input input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--bg-primary);
  }
  
  .chat-mobile-input button {
    background: var(--primary-color);
    color: white;
    padding: 12px 16px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  
  .chat-mobile-input button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
  }
}

/* Assicura che sia nascosto su desktop */
@media (min-width: 769px) {
  .chat-assistant-btn,
  .chat-widget,
  .chat-overlay,
  .chat-mobile {
    display: none !important;
  }
}
/* ...existing code... */

/* ==================== NASCONDE ELEMENTI TOKEN ====================  */
.token-display,
.cost-display,
.budget-indicator,
.cost-warning,
.cost-critical {
  display: none !important;
}

/* ==================== STILE PULSANTE RESET ELEGANTE ==================== */
.elegant-reset-btn {
  background: linear-gradient(135deg, #4CAF50, #45a049) !important;
  color: white !important;
  border: none !important;
  padding: 12px 24px !important;
  border-radius: 25px !important;
  cursor: pointer !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3) !important;
  text-decoration: none !important;
  display: inline-block !important;
  min-width: 140px !important;
  text-align: center !important;
}

.elegant-reset-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4) !important;
  background: linear-gradient(135deg, #45a049, #4CAF50) !important;
}

.elegant-reset-btn:active {
  transform: translateY(0) !important;
  box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3) !important;
}

.elegant-reset-btn:focus {
  outline: none !important;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4), 0 0 0 3px rgba(76, 175, 80, 0.2) !important;
}

/* Container per il pulsante reset */
.limit-reached-container {
  margin-top: 15px !important;
  padding: 15px !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border-radius: 12px !important;
  text-align: center !important;
  animation: slideInUp 0.3s ease-out !important;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
  .elegant-reset-btn {
    padding: 10px 20px !important;
    font-size: 14px !important;
    min-width: 120px !important;
  }
  
  .limit-reached-container {
    margin-top: 12px !important;
    padding: 12px !important;
  }
}

/* ...existing code... */