.tcf-calendar {
  color: #111827;
}

/* Reset di base per evitare ereditarietà da Elementor sui bottoni interni al calendario */
.tcf-calendar button {
  box-shadow: none !important;
  outline: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

/* =========================================
   TOOLBAR
   ========================================= */
.tcf-calendar__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 20px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.tcf-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Aumentata la specificità aggiungendo .tcf-calendar davanti e usando !important */
.tcf-calendar .tcf-nav-prev,
.tcf-calendar .tcf-nav-next {
  background: transparent !important;
  border: none !important;
  color: #111827 !important;
  cursor: pointer !important;
  padding: 4px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: color 0.2s, opacity 0.2s;
  min-width: 0 !important; /* Sovrascrive larghezze fisse di Elementor */
  border-radius: 0 !important;
  line-height: 1 !important;
}

.tcf-calendar .tcf-nav-next {
  color: #9ca3af !important;
}

.tcf-calendar .tcf-nav-prev:hover,
.tcf-calendar .tcf-nav-next:hover {
  color: #111827 !important;
  opacity: 0.8 !important;
  background: transparent !important;
}

.tcf-calendar .tcf-nav-today {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 100px !important;
  padding: 6px 14px !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  color: #374151 !important;
  cursor: pointer !important;
  transition: background 0.2s;
  margin: 0 0 0 12px !important; /* Spazio per staccarlo dalle frecce */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: normal !important;
}

.tcf-calendar .tcf-nav-today:hover {
  background: #f9fafb !important;
  color: #374151 !important;
}

.tcf-calendar__title-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.tcf-calendar__range {
  font-size: 24px;
  font-weight: 500;
  color: #374151;
  letter-spacing: -0.5px;
  margin: 0 !important; /* Evita margini da typography globale di Elementor */
  padding: 0 !important;
}

.tcf-range-chevron {
  color: #6b7280;
  margin-top: 4px;
  width: 16px;
  height: 16px;
	display: none;
}

/* =========================================
   CONTENITORI GENERALI E FIX
   ========================================= */
.tcf-calendar__desktop,
.tcf-calendar__mobile {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.tcf-loading-state,
.tcf-empty-state {
  padding: 32px 20px;
  text-align: center;
  color: #4b5563;
}

.tcf-empty-state--error {
  color: #b91c1c;
}

.tcf-event-card,
.tcf-mobile-item,
.tcf-week-event {
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

/* =========================================
   MEDIA QUERY MOBILE
   ========================================= */
@media (max-width: 767px) {
  .tcf-calendar__toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
  }

  .tcf-toolbar-controls {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }

  .tcf-calendar .tcf-nav-prev,
  .tcf-calendar .tcf-nav-next {
    flex: 0 0 auto !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .tcf-calendar .tcf-nav-today {
    flex: 1 1 auto !important;
    min-height: 44px !important;
    margin-left: auto !important;
  }

  .tcf-calendar__title-wrapper {
    width: 100%;
    justify-content: flex-start;
  }

  .tcf-calendar__range {
    font-size: 20px;
  }
}