/* Shops management */

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
}

.monospace {
  font-family: monospace;
}

/* Category multiselect */
.multiselect {
  position: relative;
}

.multiselect.dropdown-active {
  z-index: 2147483000;
}

.ms-trigger {
  cursor: pointer;
}

.ms-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  left: 0;
  z-index: 2147483000;
  display: none;
  max-height: 240px;
  padding: 0.5rem;
  overflow-y: auto;
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.ms-menu.open {
  display: block;
}

.ms-item {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 0.25rem;
}

.ms-item:hover {
  background: var(--gray-100);
}

.ms-item input {
  margin: 0;
}

.ms-chipwrap,
.shop-meta,
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ms-chip,
.shop-chip,
.doc-chip {
  padding: 0.2rem 0.55rem;
  color: var(--gray-700);
  font-size: 0.72rem;
  background: var(--gray-100);
  border-radius: 999px;
}

/* Shop and document cards */
.shop-card,
.doc-card {
  overflow: hidden;
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
}

.shop-card {
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.shop-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.shop-logo {
  width: 56px;
  height: 56px;
  margin-right: 0.5rem;
  flex-shrink: 0;
  background-color: var(--gray-100);
  background-position: center;
  background-size: cover;
  border-radius: 0.5rem;
}

.shop-title,
.doc-title {
  color: var(--ossi-navy);
  font-weight: 600;
}

.shop-meta {
  margin-top: 0.5rem;
}

.doc-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  background-color: var(--gray-100);
  background-position: center;
  background-size: cover;
}

.doc-body {
  padding: 0.75rem;
}

.doc-title {
  margin-bottom: 0.25rem;
}

.doc-meta {
  gap: 0.25rem;
  color: var(--gray-500);
  font-size: 0.7rem;
}

/* Unified shop form */
.shop-form-card > .card-header {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: var(--surface-card, #fff);
}

.shop-form-actions .btn {
  white-space: nowrap;
}

.shop-map-preview {
  width: 100%;
  min-height: 260px;
  background: var(--gray-100);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
}

.hours {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1rem;
}

.hours .day {
  min-width: 0;
  padding: 0.5rem;
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
}

.hours .day input {
  width: 100%;
  font-size: 0.8rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 991.98px) {
  .hours {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .shop-form-card > .card-header {
    position: static;
  }

  .shop-form-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .shop-form-actions .btn {
    width: 100%;
    white-space: normal;
  }

  .hours {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .grid-3 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .shop-card,
  .doc-card {
    border-radius: 0.65rem;
  }

  .doc-thumb {
    height: 110px;
  }

  .shop-logo {
    width: 48px;
    height: 48px;
  }

  .ms-menu {
    max-height: 200px;
  }
}

@media (max-width: 480px) {
  .shop-form-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-form-actions #btnSave {
    grid-column: 1 / -1;
  }

  .hours {
    grid-template-columns: 1fr;
  }
}
