/* =========================================================================
   APP SHELL & NAVIGATION RAIL (ESCRITORIO + TABLET + MÓVIL)
   ========================================================================= */
.vdt-shell {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg-app);
}

.vdt-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-width);
  background: var(--bg-app);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  z-index: 100;
}

.vdt-rail__logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #323235;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: -0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.vdt-sidebar-icon {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
  margin: auto;
}

.vdt-rail__nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.vdt-rail__item {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-item);
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.vdt-rail__item:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.vdt-rail__item.activo {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.vdt-rail__item--crear {
  margin-top: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text-main);
}

.vdt-rail__dot {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-main);
}

/* Tooltip flotante lateral */
.vdt-rail__tooltip {
  position: absolute;
  left: 58px;
  background: #18181b;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.vdt-rail__item:hover .vdt-rail__tooltip {
  opacity: 1;
  transform: translateX(0);
}

.vdt-rail__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.vdt-avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

/* Contenido principal */
.vdt-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--rail-width);
  width: calc(100% - var(--rail-width));
  padding: 28px 36px 64px;
}

.vdt-main > * {
  width: 100%;
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

/* Buscador en píldora */
.vdt-search-wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto 24px;
  position: relative;
}

.vdt-search-input {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 12px 20px 12px 44px;
  font-size: 0.94rem;
  color: var(--text-main);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.vdt-search-input:focus {
  outline: none;
  background: #fff;
  border-color: var(--border-strong);
}

.vdt-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Barra horizontal de píldoras (Municipios / Categorías) */
.vdt-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: 28px;
  scrollbar-width: none;
}
.vdt-pills::-webkit-scrollbar { display: none; }

.vdt-pill {
  flex: 0 0 auto;
  border: none;
  background: var(--bg-subtle);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.vdt-pill:hover {
  background: var(--bg-hover);
}

.vdt-pill.activo {
  background: var(--color-primary);
  color: #fff;
}

/* Secciones editoriales */
.vdt-section {
  margin-bottom: 36px;
}

.vdt-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.vdt-section__title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Cuadrícula de tiendas estilo Patreon (3 columnas limpias) */
.vdt-grid-tiendas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.vdt-tienda-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: var(--radius-item);
  transition: background 0.15s ease;
}

.vdt-tienda-item:hover {
  background: var(--bg-subtle);
}

.vdt-tienda-item__logo {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: var(--bg-subtle);
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-muted);
}

.vdt-tienda-item__info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

.vdt-tienda-item__info p {
  font-size: 0.83rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================================================================
   RESPONSIVE: TABLETS (768px - 1024px)
   ========================================================================= */
@media (max-width: 1024px) {
  .vdt-main {
    padding: 24px 24px 64px;
  }

  .vdt-pills {
    justify-content: flex-start;
  }

  .vdt-grid-tiendas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

/* =========================================================================
   RESPONSIVE: MÓVILES (< 768px) — BARRA INFERIOR FIJA TIPO APP
   ========================================================================= */
@media (max-width: 767px) {
  .vdt-rail {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: calc(62px + env(safe-area-inset-bottom, 0px));
    padding: 0 8px env(safe-area-inset-bottom, 0px);
    flex-direction: row;
    justify-content: space-between;
    border-right: none;
    border-top: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
  }

  .vdt-rail__logo,
  .vdt-rail__tooltip {
    display: none;
  }

  .vdt-rail__nav {
    flex-direction: row;
    justify-content: space-around;
    width: auto;
    flex: 1;
    gap: 2px;
  }

  .vdt-rail__item {
    width: 44px;
    height: 44px;
  }

  .vdt-rail__item--crear {
    margin-top: 0;
  }

  .vdt-rail__footer {
    margin-top: 0;
    margin-left: 4px;
    padding-right: 4px;
  }

  .vdt-main {
    margin-left: 0;
    width: 100%;
    padding: 16px 16px calc(84px + env(safe-area-inset-bottom, 0px));
  }

  .vdt-search-wrap {
    margin-bottom: 16px;
  }

  .vdt-search-input {
    font-size: 16px;
    padding: 11px 16px 11px 40px;
  }

  .vdt-pills {
    justify-content: flex-start;
    margin-bottom: 20px;
    padding-bottom: 4px;
  }

  .vdt-grid-tiendas {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}