/* =====================================================================
   Kalender Ketersediaan — stylesheet mandiri.
   Semua class diawali .ac- supaya tidak bentrok dengan Bootstrap 4/5.
   Ganti tema cukup dengan mengubah blok :root di bawah.
   ===================================================================== */

.ac-scope {
  --ac-bg:        #F5F6F8;
  --ac-surface:   #FFFFFF;
  --ac-ink:       #0F172A;
  --ac-muted:     #64748B;
  --ac-line:      rgba(15, 23, 42, .09);
  --ac-accent:    #4F46E5;
  --ac-accent-sf: rgba(79, 70, 229, .10);

  --ac-ok:        #15803D;
  --ac-ok-sf:     #E9F5EC;
  --ac-warn:      #B45309;
  --ac-warn-sf:   #FBF1E0;
  --ac-danger:    #B91C1C;
  --ac-danger-sf: #FBEBEB;

  --ac-radius:    14px;
  --ac-radius-sm: 10px;
  --ac-shadow:    0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .07);

  color: var(--ac-ink);
  font-feature-settings: "tnum" 1;
}

/* ---------------------------------------------------------------- head */

.ac-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.ac-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.ac-subtitle {
  margin: 6px 0 0;
  color: var(--ac-muted);
  font-size: 14px;
  max-width: 52ch;
}

/* ------------------------------------------------------------ filters */

.ac-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ac-muted);
}

.ac-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 18px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ac-filters::-webkit-scrollbar { display: none; }

@media (min-width: 768px) {
  .ac-filters { flex-wrap: wrap; overflow: visible; }
}

.ac-chip {
  flex: none;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ac-line);
  border-radius: 999px;
  background: var(--ac-surface);
  color: var(--ac-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.ac-chip:hover { border-color: rgba(15, 23, 42, .25); }

.ac-chip.is-on {
  background: var(--ac-ink);
  border-color: var(--ac-ink);
  color: #FFFFFF;
}

.ac-chip:focus-visible,
.ac-day:focus-visible,
.ac-nav-btn:focus-visible,
.ac-cta:focus-visible {
  outline: 2px solid var(--ac-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------- layout */

.ac-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

@media (min-width: 992px) {
  .ac-layout { grid-template-columns: minmax(0, 1fr) 320px; }
}

.ac-card {
  background: var(--ac-surface);
  border: 1px solid var(--ac-line);
  border-radius: var(--ac-radius);
  box-shadow: var(--ac-shadow);
  padding: 18px;
}

@media (min-width: 576px) { .ac-card { padding: 22px; } }

/* ------------------------------------------------------------ month nav */

.ac-monthbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.ac-month {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.ac-nav { display: flex; gap: 8px; }

.ac-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--ac-line);
  border-radius: var(--ac-radius-sm);
  background: var(--ac-surface);
  color: var(--ac-ink);
  cursor: pointer;
  transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.ac-nav-btn:hover:not(:disabled) {
  background: var(--ac-accent-sf);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}

.ac-nav-btn:active:not(:disabled) { transform: scale(.97); }
.ac-nav-btn:disabled { opacity: .35; cursor: not-allowed; }
.ac-nav-btn svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------ the grid */

.ac-dow,
.ac-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.ac-dow {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ac-muted);
  text-align: center;
}

.ac-day {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2px;
  min-height: 58px;
  padding: 7px 6px;
  border: 1px solid transparent;
  border-radius: var(--ac-radius-sm);
  background: var(--ac-bg);
  color: var(--ac-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

@media (min-width: 576px) { .ac-day { min-height: 84px; padding: 10px; } }

.ac-day-num { font-size: 15px; font-weight: 700; line-height: 1; }
@media (min-width: 576px) { .ac-day-num { font-size: 17px; } }

.ac-day-meta {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  opacity: .85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

@media (min-width: 576px) { .ac-day-meta { font-size: 12px; } }

.ac-day:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, .10);
}

.ac-day:active:not(:disabled) { transform: scale(.98); }

/* status */
.ac-day.is-available { background: var(--ac-ok-sf);     color: var(--ac-ok); }
.ac-day.is-limited   { background: var(--ac-warn-sf);   color: var(--ac-warn); }
.ac-day.is-full      { background: var(--ac-danger-sf); color: var(--ac-danger); }
.ac-day.is-closed    { background: var(--ac-bg); color: var(--ac-muted); border-style: dashed; border-color: var(--ac-line); }

.ac-day.is-past {
  background: transparent;
  color: rgba(15, 23, 42, .28);
  cursor: not-allowed;
}

.ac-day.is-past .ac-day-meta { display: none; }
.ac-day.is-past:hover { transform: none; box-shadow: none; }

.ac-day.is-today { box-shadow: inset 0 0 0 2px rgba(15, 23, 42, .35); }

.ac-day.is-selected {
  border-color: var(--ac-accent);
  box-shadow: 0 0 0 3px var(--ac-accent-sf);
}

.ac-day.is-blank {
  background: transparent;
  border: 0;
  cursor: default;
  pointer-events: none;
}

/* skeleton saat memuat */
.ac-grid.is-loading .ac-day {
  color: transparent;
  background: linear-gradient(90deg, #EDEFF3 25%, #F6F7F9 37%, #EDEFF3 63%);
  background-size: 400% 100%;
  animation: ac-shimmer 1.3s ease infinite;
  pointer-events: none;
}

@keyframes ac-shimmer {
  from { background-position: 100% 50%; }
  to   { background-position: 0 50%; }
}

/* ------------------------------------------------------------- legend */

.ac-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--ac-line);
  font-size: 12px;
  color: var(--ac-muted);
}

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

.ac-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex: none;
}

.ac-swatch.is-available { background: var(--ac-ok); }
.ac-swatch.is-limited   { background: var(--ac-warn); }
.ac-swatch.is-full      { background: var(--ac-danger); }
.ac-swatch.is-closed    { background: transparent; border: 1px dashed var(--ac-muted); }

/* -------------------------------------------------------------- panel */

@media (min-width: 992px) {
  .ac-panel { position: sticky; top: 20px; }
}

.ac-panel-empty { color: var(--ac-muted); font-size: 14px; }

.ac-panel-date {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.ac-panel-product { margin: 0 0 16px; color: var(--ac-muted); font-size: 13px; }

.ac-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.ac-pill.is-available { background: var(--ac-ok-sf);     color: var(--ac-ok); }
.ac-pill.is-limited   { background: var(--ac-warn-sf);   color: var(--ac-warn); }
.ac-pill.is-full      { background: var(--ac-danger-sf); color: var(--ac-danger); }
.ac-pill.is-closed    { background: var(--ac-bg);        color: var(--ac-muted); }

.ac-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 14px 0 10px;
}

.ac-summary-num { font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.ac-summary-of  { color: var(--ac-muted); font-size: 13px; }

/* daftar barang pada tanggal terpilih */
.ac-items { margin: 6px 0 18px; }

.ac-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--ac-line);
}

.ac-item:first-child { border-top: 0; }
.ac-item.is-booked .ac-item-name,
.ac-item.is-closed .ac-item-name { color: var(--ac-muted); }

.ac-item-main { min-width: 0; }
.ac-item-name { font-size: 14px; font-weight: 600; line-height: 1.3; }
.ac-item-sub  { font-size: 12px; color: var(--ac-muted); margin-top: 2px; }

.ac-item-action {
  flex: none;
  padding: 7px 12px;
  border: 1px solid var(--ac-line);
  border-radius: 999px;
  background: var(--ac-surface);
  color: var(--ac-accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .18s ease;
}

.ac-item-action:hover { background: var(--ac-accent-sf); color: var(--ac-accent); }

.ac-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--ac-radius-sm);
  background: var(--ac-accent);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.ac-cta:hover {
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, .28);
}

.ac-cta:active { transform: scale(.98); }
.ac-cta.is-disabled { background: var(--ac-bg); color: var(--ac-muted); pointer-events: none; }

.ac-note {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--ac-muted);
  line-height: 1.5;
}

/* -------------------------------------------------------------- alert */

.ac-alert {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(185, 28, 28, .25);
  border-radius: var(--ac-radius-sm);
  background: var(--ac-danger-sf);
  color: var(--ac-danger);
  font-size: 14px;
}

.ac-alert.is-shown { display: flex; }

.ac-alert button {
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ac-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .ac-scope *,
  .ac-scope *::before,
  .ac-scope *::after {
    transition: none !important;
    animation: none !important;
  }
}
