.calendar-container {
    min-width: 850px;
    max-width: 850px;
    width: 850px;
    background-color: white;
}

#calendar_main_container {
    max-width: 400px;
}

.second-screen__calendar-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .5rem
}

/* =========== MONTH AND NEXT-PREVIOUS BUTTONS ==========*/
.second-screen__calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.second-screen__nav-btn {
  background: white;
  font-size: 20px;
  width: 20px;
  height: 20px;
  border-radius: 5.12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}

.second-screen__nav-btn:not(:disabled)>* {
  color: var(--main-txt-clr);
}

.second-screen__nav-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  color: #6c6c89;
  background-color: white;
  border: none;
}

/* =========== CALENDAR BUTTONS ==========*/

.second-screen__days {
  display: contents
}

.second-screen__day {
  background: white;
  border: solid 1px var(--grey-txt-clr);
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  display: inline-flex;
  text-align: center;
  color: var(--text-color);
  font-size: 15px;
  font-family: Erply Ladna;
  font-weight: 500;
  line-height: 15px;
  aspect-ratio: 1/1;
  margin: .1rem;
  cursor: pointer;
}

.second-screen__weekday {
  width: 100%;
  text-align: center;
  color: #444;
  font-size: 12px;
  font-family: Erply Ladna;
  font-weight: 400;
  text-transform: uppercase;
  line-height: 12px;
  word-wrap: break-word
}

.second-screen__day--empty {
  background: none !important;
  border: none !important;
  padding: 0
}

.second-screen__day--selected {
  background: var(--main-green);
  border-color: var(--main-green);
}

.second-screen__day--disabled {
  background: none !important;
  border: solid 1px var(--grey-background);
  color: rgb(220, 220, 220) !important;
  cursor: not-allowed;
}

/* =========== TIME BUTTONS ==========*/
.second-screen__time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  gap: .5rem;
  width: 360px;
}

.second-screen__time-slot {
  height: 40px;
  width: 70px;
  max-width: 70px;
  background: #fff;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .05);
  color: var(--main-txt-clr);
  font-size: 14px;
  font-family: Erply Ladna;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
}

.second-screen__time-slot--selected {
  background: var(--main-green);
  color: var(--main-txt-clr);
  border: 1px solid var(--main-green);
}

.second-screen__time-slot--selected:hover {
  background: var(--main-green)
}

/* =========== LOADER ==========*/
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    z-index: 9999;
    display: none;
}

@keyframes spin {
    0% {
      transform: rotate(0deg);
    }

    100% {
      transform: rotate(360deg);
    }
}

.loader-overlay__spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--loader-clr);
    border-top: 5px solid var(--loader-accent-clr);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-overlay--active {
    display: flex;
    align-items: center;
    justify-content: center;
}


@media (max-width: 850px) {
  .second-screen__time-grid {
      max-width: 400px;
  }

	.calendar-container {
		  flex-direction: column;
		  min-width: 100%;
      width: auto;
      min-height: calc(100dvh - 135px);
	}

	.footer .buttons {
  		justify-content: space-between;
	}
}

@media (max-width: 4000px) {
  .second-screen__time-grid {
    max-width: auto;
    width: auto;
  }
}

@media (max-width: 480px) {
  #calendar_main_container {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
    
  .second-screen__calendar-grid {
    gap: 0.25rem;
  }
  
  .second-screen__day {
    font-size: 12px;
  }
  
  .second-screen__weekday {
    font-size: 11px;
  }
  
  .second-screen__time-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.25rem;
  }
  
  .second-screen__time-slot {
    width: 100%;
    max-width: none;
    min-width: 60px;
  }

  .footer .info {
    width: 100%;    
  }
}

/* safari (newer) */
@media (max-width: 480px) {
    @supports (-webkit-touch-callout: none) {
        #calendar_main_container {
            max-width: 90%;
        }
    }
}