/*
  Solterra date picker
  Zero-dependency calendar panel for [data-sol-calendar] inputs.
  Styling reuses the site design tokens from style.css.
*/

.sc-cal-input {
  cursor: pointer;
  padding-right: 42px !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.sc-cal {
  position: fixed;
  z-index: 1200;
  width: 320px;
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
  background: #fff;
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: var(--radius-md, 12px);
  box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,.1));
  padding: 14px;
  font-family: var(--font-body, 'Inter', sans-serif);
  color: var(--text-dark, #1E293B);
  display: none;
  user-select: none;
}
.sc-cal.is-open { display: block; }

.sc-cal-head {
  display: grid;
  grid-template-columns: 30px 30px 1fr 1fr 30px 30px;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}
.sc-cal-nav {
  height: 30px;
  border: 1px solid var(--border-light, #E2E8F0);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-dark, #1E293B);
  font-size: 15px;
  line-height: 1;
  transition: background-color .15s, border-color .15s;
}
.sc-cal-nav:hover { background: var(--bg-main, #FAFAFA); border-color: var(--primary-color, #E94D40); }
.sc-cal-sel {
  width: 100%;
  height: 30px;
  padding: 0 4px;
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: 6px;
  background: #fff;
  color: var(--text-dark, #1E293B);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.sc-cal-dow,
.sc-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.sc-cal-dow { margin-bottom: 4px; }
.sc-cal-dow span {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #64748B);
  padding: 4px 0;
}
.sc-cal-cell {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.sc-cal-cell:hover { background: #F1EFE8; }
.sc-cal-cell.is-empty { cursor: default; }
.sc-cal-cell.is-past { color: #B4B2A9; cursor: not-allowed; }
.sc-cal-cell.is-past:hover { background: transparent; }
.sc-cal-cell.is-today { font-weight: 700; color: var(--primary-color, #E94D40); }
.sc-cal-cell.is-selected,
.sc-cal-cell.is-selected:hover {
  background: var(--primary-color, #E94D40);
  color: #fff;
  font-weight: 700;
}

.sc-cal-foot {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light, #E2E8F0);
}
.sc-cal-foot button {
  flex: 1;
  height: 32px;
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: 6px;
  background: #fff;
  color: var(--text-dark, #1E293B);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.sc-cal-foot button:hover { background: var(--bg-main, #FAFAFA); border-color: var(--primary-color, #E94D40); }
.sc-cal-foot button[data-cal="today"] { border-color: var(--primary-color, #E94D40); color: var(--primary-color, #E94D40); }

@media (max-width: 480px) {
  .sc-cal { width: calc(100vw - 16px); }
}
