/* Voa Entregador — Bottom sheet, headers e info rows
   Carregado da estrutura de componentes */

.item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
    text-align: left;
    width: 100%;
  }
  .item:hover, .item.active { background: var(--surface-2); border-color: var(--ink-200); }
  .item .avatar {
    width: 40px; height: 40px; border-radius: 12px;
    background: var(--brand-soft); color: var(--brand);
    display: grid; place-items: center; font-weight: 600; font-size: 14px;
    flex-shrink: 0;
  }
  .item .meta { min-width: 0; }
  .item .name {
    font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .item .sub {
    font-size: 12px; color: var(--ink-500);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 2px;
  }
  .item .sub.sub-link {
    cursor: pointer;
  }
  .item .sub.sub-link:hover {
    color: var(--brand);
    text-decoration: underline;
  }
  .item .sub.sub-count {
    font-weight: 600;
    color: var(--ink-700);
  }
  .item .right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
  .item .right .dist { font-size: 12px; color: var(--ink-500); font-weight: 500; }
  .status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 600;
  }
  .status-pill .d { width: 6px; height: 6px; border-radius: 50%; }
  .status-open   { background: var(--open-soft);   color: var(--open); }
  .status-open   .d { background: var(--open); }
  .status-opening{ background: var(--opening-soft);color: #9A6400; }
  .status-opening .d { background: var(--opening); }
  .status-closing{ background: var(--closing-soft);color: #7A2FC2; }
  .status-closing .d { background: var(--closing); }
  .status-closed { background: var(--closed-soft); color: var(--closed); }
  .status-closed .d { background: var(--closed); }

  /* Card de agrupamento nos results de busca */
  .item .avatar-cluster {
    background: var(--ink-900);
    color: white;
  }
  .status-cluster {
    background: var(--ink-100);
    color: var(--ink-900);
    font-weight: 700;
  }

  .sheet-backdrop {
    position: absolute; inset: 0;
    background: rgba(11,18,32,0.25);
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s;
    z-index: 30;
  }
  .sheet-backdrop.show { opacity: 1; pointer-events: auto; }

  .sheet {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: var(--surface);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -10px 40px rgba(11,18,32,0.14);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 40;
    padding: 8px 20px calc(var(--bottom-nav-h) + 16px);
    max-height: 75%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .sheet.show { transform: translateY(0); }
  #sheet-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow-y: auto;
  }
  /* Lista de members de um agrupamento rola sozinha dentro do sheet.
     Altura limitada a ~3 rows para forçar o scroll interno quando há 4+. */
  .cluster-list {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    max-height: 232px;
    padding-right: 4px;
    margin-right: -4px;
  }

  .handle {
    width: 40px; height: 4px; border-radius: 2px;
    background: var(--ink-200);
    margin: 8px auto 16px;
  }

  .sheet-header {
    display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: flex-start;
    margin-bottom: 16px;
  }
  .sheet-header .avatar {
    width: 48px; height: 48px; border-radius: 14px;
    background: var(--brand-soft); color: var(--brand);
    display: grid; place-items: center; font-weight: 600; font-size: 16px;
  }
  .sheet-header h2 {
    margin: 0 0 4px; font-size: 18px; font-weight: 700; letter-spacing: -0.015em;
  }
  .sheet-header .addr { margin: 0; color: var(--ink-500); font-size: 13px; line-height: 1.4; }
  .sheet-header .addr.addr-link {
    cursor: pointer;
  }
  .close-btn, .back-btn {
    width: 32px; height: 32px; border-radius: 10px;
    background: var(--ink-100); color: var(--ink-700);
    display: grid; place-items: center;
    transition: background 0.15s;
  }
  .close-btn:hover, .back-btn:hover { background: var(--ink-200); }
  .sheet-actions-top {
    display: flex; gap: 6px; align-items: center;
  }

  /* Alias dentro do item de lista */
  .item .meta .alias {
    display: inline-block;
    font-size: 12px; font-weight: 600;
    color: var(--brand);
    margin-top: 2px;
    text-decoration: none;
    transition: color 0.15s;
  }
  .item .meta .alias[onclick] { cursor: pointer; }
  .item .meta .alias[onclick]:hover { color: var(--brand-2); text-decoration: underline; }

  /* Alias no header do sheet do estabelecimento */
  .sheet-alias {
    display: inline-block;
    font-size: 13px; font-weight: 600;
    color: var(--brand-2);
    margin: 2px 0 4px;
  }
  .sheet-alias[onclick] { cursor: pointer; }

  .info-rows { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; border-top: 1px solid var(--ink-200); }
  .info-row {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 14px 2px;
    border-bottom: 1px solid var(--ink-200);
    gap: 16px;
  }
  .info-row:last-child { border-bottom: none; }
  .info-row .k { color: var(--ink-500); font-size: 13px; font-weight: 500; padding-top: 2px; flex-shrink: 0; }
  .info-row .v { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; text-align: right; }
  .info-row .v.multiline { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
  .info-row .v.multiline span { line-height: 1.3; }
  .info-row .v .hint { display: block; font-size: 11px; font-weight: 500; color: var(--ink-400); margin-top: 2px; }

  .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
  .btn {
    padding: 14px;
    border-radius: 14px;
    font-weight: 600; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: transform 0.1s, background 0.15s;
  }
  .btn:active { transform: scale(0.98); }
  .btn-primary { background: var(--brand); color: white; }
  .btn-primary:hover { background: var(--brand-2); }
  .btn-secondary { background: var(--ink-100); color: var(--ink-900); }
  .btn-secondary:hover { background: var(--ink-200); }

  /* Sheet — cluster (lista de estabelecimentos no local) */
  .cluster-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
  /* Sheet — lista de busca */
