/*
  Samin kauppa-apu – Vapaat ajat -alasivun lisätyylit
  Lataa tämä tiedosto nykyisen styles.css-tiedoston jälkeen.
*/

.main-nav a.is-current {
  position: relative;
  color: var(--green-700);
  font-weight: 600;
}

.main-nav a.is-current::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -17px;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--green-700);
}

.availability-page {
  padding: 28px 40px 38px;
  background:
    radial-gradient(circle at 100% 0%, rgb(235 239 227 / 45%), transparent 28%),
    #fff;
}

.availability-intro {
  margin-bottom: 18px;
}

.availability-eyebrow {
  margin: 0 0 5px;
  color: var(--green-700);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.availability-intro h1 {
  max-width: 820px;
  margin: 0;
  color: var(--green-900);
  font: 700 clamp(34px, 4.1vw, 48px)/1.14 "Lora", Georgia, serif;
  letter-spacing: -1.1px;
}

.availability-lead {
  max-width: 870px;
  margin: 10px 0 13px;
  font-size: 17px;
}

.calendar-updated {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #314334;
  font-size: 14px;
}

.calendar-updated svg {
  width: 24px;
  height: 24px;
  color: var(--green-900);
}

.week-calendar,
.selected-time,
.booking-steps {
  border: 1px solid var(--line);
  border-radius: 18px;
}

.week-calendar {
  padding: 12px 16px 10px;
  background: rgb(255 255 255 / 92%);
}

.calendar-loading[hidden],
.calendar-error[hidden],
.calendar-content[hidden],
.selected-time[hidden],
.calendar-messages[hidden],
.calendar-message[hidden],
.next-free-button[hidden] {
  display: none;
}

.calendar-messages {
  margin-bottom: 11px;
  display: grid;
  gap: 8px;
}

.calendar-message {
  min-height: 74px;
  padding: 13px 16px;
  border: 1px solid #d8dfcf;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  background: linear-gradient(100deg, #f3f6ed, #fbfcf8);
  color: var(--green-900);
}

.calendar-message-custom {
  grid-template-columns: 46px minmax(0, 1fr);
  border-color: #e3d5ba;
  background: linear-gradient(100deg, #fbf5e9, #fffaf2);
}

.calendar-message-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e2eadb;
  color: var(--green-700);
}

.calendar-message-custom .calendar-message-icon {
  background: #f1dfc0;
}

.calendar-message-icon svg {
  width: 27px;
  height: 27px;
}

.calendar-message-custom p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.calendar-message-copy h2 {
  margin: 0;
  font: 700 17px/1.3 "Lora", Georgia, serif;
}

.calendar-message-copy p {
  margin: 3px 0 0;
  color: #4c584f;
  font-size: 13px;
  line-height: 1.45;
}

.next-free-button {
  min-height: 42px;
  max-width: 230px;
  padding: 7px 15px;
  border: 1.5px solid var(--green-700);
  border-radius: 8px;
  background: var(--green-700);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
}

.next-free-button:hover {
  filter: brightness(.97);
}

.next-free-button:focus-visible {
  outline: 3px solid rgb(117 155 103 / 38%);
  outline-offset: 3px;
}

.calendar-loading {
  min-height: 350px;
  padding: 42px 34px 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--green-900);
  text-align: center;
}

.loading-calendar-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #edf2e7;
  color: var(--green-700);
  animation: loading-calendar-pulse 1.8s ease-in-out infinite;
}

.loading-calendar-icon svg {
  width: 43px;
  height: 43px;
}

.loading-copy {
  position: relative;
  margin-top: 15px;
  padding-bottom: 25px;
}

.loading-copy p {
  margin: 0;
  font: 700 22px/1.25 "Lora", Georgia, serif;
}

.loading-copy > span:not(.loading-dots) {
  display: block;
  margin-top: 4px;
  color: #536056;
  font-size: 13px;
}

.loading-dots {
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
}

.loading-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-500);
  animation: loading-dot 1.15s ease-in-out infinite;
}

.loading-dots i:nth-child(2) {
  animation-delay: 140ms;
}

.loading-dots i:nth-child(3) {
  animation-delay: 280ms;
}

.loading-week {
  width: 100%;
  max-width: 970px;
  margin-top: 25px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.loading-week span {
  height: 72px;
  border: 1px solid #eee9df;
  border-radius: 11px;
  background:
    linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 78%) 48%, transparent 66%),
    #f4f2ed;
  background-size: 220% 100%;
  animation: loading-shimmer 1.8s linear infinite;
}

.calendar-error {
  min-height: 350px;
  padding: 45px 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: left;
}

.calendar-error-icon {
  flex: 0 0 66px;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f4ead9;
  color: #7a5d31;
}

.calendar-error-icon svg {
  width: 38px;
  height: 38px;
}

.calendar-error h2 {
  margin: 0;
  color: var(--green-900);
  font: 700 22px/1.25 "Lora", Georgia, serif;
}

.calendar-error p {
  max-width: 540px;
  margin: 5px 0 14px;
  color: #4d584f;
  font-size: 14px;
}

.calendar-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.calendar-error-actions button,
.calendar-error-actions a {
  min-height: 42px;
  padding: 0 17px;
  border: 1.5px solid var(--green-700);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--green-700);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.calendar-error-actions button {
  background: var(--green-700);
  color: #fff;
}

.calendar-error-actions button:hover,
.calendar-error-actions a:hover {
  filter: brightness(.97);
}

.calendar-error-actions button:focus-visible,
.calendar-error-actions a:focus-visible {
  outline: 3px solid rgb(117 155 103 / 38%);
  outline-offset: 3px;
}

@keyframes loading-calendar-pulse {
  0%, 100% { transform: scale(1); background-color: #edf2e7; }
  50% { transform: scale(1.045); background-color: #e2ebda; }
}

@keyframes loading-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: .42; }
  30% { transform: translateY(-5px); opacity: 1; }
}

@keyframes loading-shimmer {
  from { background-position: 150% 0; }
  to { background-position: -70% 0; }
}

.calendar-toolbar {
  min-height: 46px;
  display: grid;
  grid-template-columns: 44px minmax(240px, auto) 44px auto 1fr;
  align-items: center;
  gap: 12px;
}

.calendar-toolbar h2 {
  margin: 0;
  color: var(--green-900);
  font: 700 25px/1.2 "Lora", Georgia, serif;
  text-align: center;
}

.week-arrow,
.current-week-button {
  min-height: 40px;
  border: 1.5px solid var(--green-700);
  border-radius: 7px;
  background: #fff;
  color: var(--green-700);
  cursor: pointer;
}

.week-arrow {
  width: 44px;
  display: grid;
  place-items: center;
}

.week-arrow svg {
  width: 22px;
  height: 22px;
}

.current-week-button {
  padding: 0 16px;
  font: inherit;
  font-size: 13px;
}

.week-arrow:hover,
.current-week-button:hover {
  background: var(--cream-2);
}

.week-arrow:disabled,
.current-week-button:disabled {
  border-color: #c9c8c2;
  background: #f4f3f0;
  color: #a09f9a;
  cursor: not-allowed;
  opacity: .72;
}

.week-arrow:disabled:hover,
.current-week-button:disabled:hover {
  background: #f4f3f0;
}

.week-arrow:focus-visible,
.current-week-button:focus-visible,
.time-slot:focus-visible,
.contact-action:focus-visible {
  outline: 3px solid rgb(117 155 103 / 38%);
  outline-offset: 3px;
}

.calendar-legend {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 22px;
  color: #3b463d;
  font-size: 12px;
  white-space: nowrap;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.calendar-legend i {
  width: 15px;
  height: 15px;
  border-radius: 50%;
}

.legend-free {
  background: var(--green-500);
}

.legend-unavailable {
  background: #e9e6df;
}

.week-grid {
  margin-top: 5px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day-column {
  min-width: 0;
  padding: 8px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.day-column h3 {
  margin: 0 0 8px;
  color: var(--green-900);
  font: 700 17px/1.2 "Lora", Georgia, serif;
  text-align: center;
  text-transform: uppercase;
}

.day-column.is-today {
  border-color: #b6c9ad;
  box-shadow: inset 0 3px 0 var(--green-500);
}

.day-column.is-after-max-date {
  border-color: #ebe7df;
  background: #faf9f6;
}

.day-column.is-after-max-date h3 {
  color: #93958f;
}

.day-column.is-unavailable-weekday {
  background: #f5f4f0;
}

.day-column.is-after-max-date .time-unavailable {
  background: #f3f1ed;
  color: #9a9b97;
}

.day-slots {
  display: grid;
  gap: 5px;
}

.time-slot,
.time-unavailable {
  min-height: 30px;
  width: 100%;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font: inherit;
  font-size: 13px;
  line-height: 1;
}

.time-slot {
  border: 1.4px solid var(--green-700);
  background: #fff;
  color: var(--green-900);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.time-slot:hover {
  background: #eef4e9;
  transform: translateY(-1px);
}

.time-slot.is-selected {
  border-color: var(--green-700);
  background: var(--green-700);
  color: #fff;
  box-shadow: 0 3px 8px rgb(47 88 45 / 20%);
}

.time-unavailable {
  border: 1px solid #efebe4;
  background: #f7f5f1;
  color: #5e625e;
}

.time-unavailable small {
  color: #8b8d89;
  font-size: 8px;
  text-transform: uppercase;
}

.mobile-calendar-hint {
  display: none;
}

.empty-week {
  grid-column: 1 / -1;
  margin: 18px 0;
  color: #465047;
  text-align: center;
}

.selected-time {
  min-height: 112px;
  margin-top: 10px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 1.08fr);
  align-items: center;
  gap: 24px;
  background: linear-gradient(100deg, #fcf9f1, #fffaf1);
}

.selected-time-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.selected-time-icon {
  flex: 0 0 70px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e9eee0;
  color: var(--green-900);
}

.selected-time-icon svg {
  width: 42px;
  height: 42px;
}

.selected-label {
  margin: 0;
  color: #25392a;
  font-size: 14px;
  font-weight: 600;
}

.selected-value {
  margin: 1px 0 3px;
  color: var(--green-900);
  font: 700 22px/1.2 "Lora", Georgia, serif;
}

.selected-note {
  margin: 0;
  color: #4c554d;
  font-size: 12px;
}

.contact-actions {
  padding-left: 24px;
  border-left: 1px solid #d8cfbf;
  display: grid;
  grid-template-columns: 1fr 1.16fr;
  gap: 8px 12px;
}

.contact-actions[hidden] {
  display: none;
}

.contact-action {
  min-height: 52px;
  padding: 8px 14px;
  border: 2px solid var(--green-700);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.contact-action svg {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}

.contact-action-phone {
  background: linear-gradient(135deg, #619052, #47783b);
  color: #fff;
}

.contact-action-email {
  background: #fff;
  color: var(--green-900);
}

.selected-time-chat {
  grid-column: 1 / -1;
}

.selected-time-chat .contact-action {
  width: 100%;
  min-height: 44px;
}

.contact-action-chat {
  padding-block: 6px;
  border-color: #9fbd94;
  background: linear-gradient(135deg, #edf6e8, #fbfdf9);
  color: var(--green-900);
  box-shadow: 0 3px 10px rgb(48 82 41 / 8%);
}

.contact-action-chat-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.contact-action-chat-label {
  line-height: 1.15;
}

.contact-action-chat-status {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #52644d;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}

.contact-action-chat-status::before {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4f9b4b;
  box-shadow: 0 0 0 3px rgb(79 155 75 / 13%);
}

.contact-action:hover {
  filter: brightness(.97);
}

.contact-actions p {
  grid-column: 1 / -1;
  margin: 0;
  color: #4c554d;
  font-size: 11px;
  text-align: center;
}

.booking-steps {
  margin-top: 12px;
  padding: 17px 25px;
  background: linear-gradient(90deg, #fff, #fbfaf5);
}

.booking-steps ol {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
  list-style: none;
}

.booking-steps li {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.booking-steps li:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -29px;
  color: var(--green-500);
  font-size: 28px;
}

.booking-step-number {
  position: absolute;
  top: -2px;
  left: -4px;
  z-index: 1;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-500);
  color: #fff;
  font: 700 17px/1 "Lora", Georgia, serif;
}

.booking-step-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef2e8;
  color: var(--green-900);
}

.booking-step-icon svg {
  width: 34px;
  height: 34px;
}

.booking-steps h2 {
  margin: 0;
  color: var(--green-900);
  font: 700 17px/1.25 "Lora", Georgia, serif;
}

.booking-steps p {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .availability-page {
    padding-inline: 26px;
  }

  .calendar-toolbar {
    grid-template-columns: 44px minmax(210px, auto) 44px auto;
  }

  .calendar-legend {
    grid-column: 1 / -1;
    justify-self: center;
    margin: 3px 0 5px;
  }

  .mobile-calendar-hint {
    margin: 8px 0 4px;
    display: block;
    color: #526055;
    font-size: 12px;
  }

  .week-grid {
    padding-bottom: 7px;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 25vw);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-color: var(--green-500) #f1eee8;
  }

  .day-column {
    scroll-snap-align: start;
  }

  .selected-time {
    grid-template-columns: 1fr;
  }

  .contact-actions {
    padding: 14px 0 0;
    border-top: 1px solid #d8cfbf;
    border-left: 0;
  }

  .booking-steps ol {
    gap: 19px;
  }

  .booking-steps li:not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 760px) {
  .availability-page {
    padding: 25px 15px 28px;
  }

  .availability-intro h1 {
    font-size: 34px;
  }

  .availability-lead {
    font-size: 16px;
  }

  .week-calendar {
    padding: 12px 10px 9px;
  }

  .calendar-message {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
    padding: 13px;
  }

  .calendar-message-icon {
    width: 42px;
    height: 42px;
  }

  .next-free-button {
    grid-column: 2;
    width: 100%;
    max-width: none;
  }

  .calendar-loading,
  .calendar-error {
    min-height: 335px;
  }

  .calendar-loading {
    padding-inline: 12px;
  }

  .loading-week {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
  }

  .loading-week span:nth-child(n + 4) {
    display: none;
  }

  .calendar-error {
    flex-direction: column;
    text-align: center;
  }

  .calendar-error-actions {
    justify-content: center;
  }

  .calendar-toolbar {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 8px;
  }

  .calendar-toolbar h2 {
    font-size: 20px;
  }

  .current-week-button {
    grid-column: 1 / -1;
    justify-self: center;
    min-height: 36px;
  }

  .calendar-legend {
    gap: 18px;
  }

  .week-grid {
    grid-auto-columns: minmax(230px, 82vw);
  }

  .day-column {
    padding: 12px;
  }

  .day-column h3 {
    font-size: 20px;
  }

  .time-slot,
  .time-unavailable {
    min-height: 42px;
    font-size: 15px;
  }

  .selected-time {
    padding: 18px 15px;
  }

  .selected-time-summary {
    align-items: flex-start;
    gap: 13px;
  }

  .selected-time-icon {
    flex-basis: 54px;
    width: 54px;
    height: 54px;
  }

  .selected-time-icon svg {
    width: 32px;
    height: 32px;
  }

  .selected-value {
    font-size: 19px;
  }

  .contact-actions {
    grid-template-columns: 1fr;
  }

  .contact-actions p {
    grid-column: auto;
  }

  .booking-steps {
    padding: 18px;
  }

  .booking-steps ol {
    grid-template-columns: 1fr;
  }

  .booking-steps li {
    min-height: 66px;
  }

  .site-footer {
    padding-block: 15px;
  }

  .site-footer ul {
    display: block;
  }

  .site-footer li,
  .site-footer li:first-child,
  .site-footer li:last-child {
    min-height: 0;
    padding: 6px 0;
    justify-content: flex-start;
    border: 0;
  }

  .site-footer li:nth-child(2) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .time-slot,
  .loading-calendar-icon,
  .loading-dots i,
  .loading-week span {
    transition: none;
    animation: none;
  }
}
